DotNet Reference

DotNet Reference

Solver

Detailed Description

Definition at line 13 of file linear_solver/Solver.cs.

Public Types

enum  OptimizationProblemType {
  CLP_LINEAR_PROGRAMMING = 0, GLOP_LINEAR_PROGRAMMING = 2, CBC_MIXED_INTEGER_PROGRAMMING = 5, BOP_INTEGER_PROGRAMMING = 12,
  SAT_INTEGER_PROGRAMMING = 14
}
 
enum  ResultStatus {
  OPTIMAL, FEASIBLE, INFEASIBLE, UNBOUNDED,
  ABNORMAL, NOT_SOLVED = 6
}
 
enum  BasisStatus {
  FREE = 0, AT_LOWER_BOUND, AT_UPPER_BOUND, FIXED_VALUE,
  BASIC
}
 

Public Member Functions

void Dispose ()
 
 Solver (string name, Solver.OptimizationProblemType problem_type)
 
void Clear ()
 
int NumVariables ()
 
MPVariableVector variables ()
 
Variable LookupVariableOrNull (string var_name)
 
Variable MakeVar (double lb, double ub, bool integer, string name)
 
Variable MakeNumVar (double lb, double ub, string name)
 
Variable MakeIntVar (double lb, double ub, string name)
 
Variable MakeBoolVar (string name)
 
int NumConstraints ()
 
MPConstraintVector constraints ()
 
Constraint LookupConstraintOrNull (string constraint_name)
 
Constraint MakeConstraint (double lb, double ub)
 
Constraint MakeConstraint ()
 
Constraint MakeConstraint (double lb, double ub, string name)
 
Constraint MakeConstraint (string name)
 
Objective Objective ()
 
Solver.ResultStatus Solve ()
 
Solver.ResultStatus Solve (MPSolverParameters param)
 
double[] ComputeConstraintActivities ()
 
bool VerifySolution (double tolerance, bool log_errors)
 
void Reset ()
 
bool InterruptSolve ()
 
bool SetSolverSpecificParametersAsString (string parameters)
 
void EnableOutput ()
 
void SuppressOutput ()
 
long Iterations ()
 
long Nodes ()
 
double ComputeExactConditionNumber ()
 
void SetTimeLimit (long time_limit_milliseconds)
 
long WallTime ()
 
string ExportModelAsLpFormat (bool obfuscated)
 
string ExportModelAsMpsFormat (bool fixed_format, bool obfuscated)
 
void SetHint (MPVariableVector variables, double[] values)
 
bool SetNumThreads (int num_theads)
 
Variable[] MakeVarArray (int count, double lb, double ub, bool integer)
 
Variable[] MakeVarArray (int count, double lb, double ub, bool integer, string var_name)
 
Variable[,] MakeVarMatrix (int rows, int cols, double lb, double ub, bool integer)
 
Variable[,] MakeVarMatrix (int rows, int cols, double lb, double ub, bool integer, string name)
 
Variable[] MakeNumVarArray (int count, double lb, double ub)
 
Variable[] MakeNumVarArray (int count, double lb, double ub, string var_name)
 
Variable[,] MakeNumVarMatrix (int rows, int cols, double lb, double ub)
 
Variable[,] MakeNumVarMatrix (int rows, int cols, double lb, double ub, string name)
 
Variable[] MakeIntVarArray (int count, double lb, double ub)
 
Variable[] MakeIntVarArray (int count, double lb, double ub, string var_name)
 
Variable[,] MakeIntVarMatrix (int rows, int cols, double lb, double ub)
 
Variable[,] MakeIntVarMatrix (int rows, int cols, double lb, double ub, string name)
 
Variable[] MakeBoolVarArray (int count)
 
Variable[] MakeBoolVarArray (int count, string var_name)
 
Variable[,] MakeBoolVarMatrix (int rows, int cols)
 
Variable[,] MakeBoolVarMatrix (int rows, int cols, string name)
 
Constraint Add (LinearConstraint constraint)
 
void Minimize (LinearExpr expr)
 
void Maximize (LinearExpr expr)
 
void Minimize (Variable var)
 
void Maximize (Variable var)
 

Static Public Member Functions

static bool SupportsProblemType (Solver.OptimizationProblemType problem_type)
 
static int GetSolverEnum (String solverType)
 
static Solver CreateSolver (String name, String type)
 

Protected Member Functions

virtual void Dispose (bool disposing)
 

Protected Attributes

bool swigCMemOwn
 

Member Enumeration Documentation

◆ BasisStatus

enum BasisStatus
strong
Enumerator
FREE 
AT_LOWER_BOUND 
AT_UPPER_BOUND 
FIXED_VALUE 
BASIC 

Definition at line 266 of file linear_solver/Solver.cs.

◆ OptimizationProblemType

Enumerator
CLP_LINEAR_PROGRAMMING 
GLOP_LINEAR_PROGRAMMING 
CBC_MIXED_INTEGER_PROGRAMMING 
BOP_INTEGER_PROGRAMMING 
SAT_INTEGER_PROGRAMMING 

Definition at line 249 of file linear_solver/Solver.cs.

◆ ResultStatus

enum ResultStatus
strong
Enumerator
OPTIMAL 
FEASIBLE 
INFEASIBLE 
UNBOUNDED 
ABNORMAL 
NOT_SOLVED 

Definition at line 257 of file linear_solver/Solver.cs.

Constructor & Destructor Documentation

◆ Solver()

Solver ( string  name,
Solver.OptimizationProblemType  problem_type 
)
inline

Definition at line 47 of file linear_solver/Solver.cs.

Member Function Documentation

◆ Add()

Constraint Add ( LinearConstraint  constraint)
inline

Definition at line 203 of file linear_solver/csharp/SolverHelper.cs.

◆ Clear()

void Clear ( )
inline

Definition at line 56 of file linear_solver/Solver.cs.

◆ ComputeConstraintActivities()

double [] ComputeConstraintActivities ( )
inline

Definition at line 165 of file linear_solver/Solver.cs.

◆ ComputeExactConditionNumber()

double ComputeExactConditionNumber ( )
inline

Definition at line 215 of file linear_solver/Solver.cs.

◆ constraints()

MPConstraintVector constraints ( )
inline

Definition at line 110 of file linear_solver/Solver.cs.

◆ CreateSolver()

static Solver CreateSolver ( String  name,
String  type 
)
inlinestatic

Definition at line 193 of file linear_solver/csharp/SolverHelper.cs.

◆ Dispose() [1/2]

void Dispose ( )
inline

Definition at line 30 of file linear_solver/Solver.cs.

◆ Dispose() [2/2]

virtual void Dispose ( bool  disposing)
inlineprotectedvirtual

Definition at line 35 of file linear_solver/Solver.cs.

◆ EnableOutput()

void EnableOutput ( )
inline

Definition at line 197 of file linear_solver/Solver.cs.

◆ ExportModelAsLpFormat()

string ExportModelAsLpFormat ( bool  obfuscated)
inline

Definition at line 229 of file linear_solver/Solver.cs.

◆ ExportModelAsMpsFormat()

string ExportModelAsMpsFormat ( bool  fixed_format,
bool  obfuscated 
)
inline

Definition at line 234 of file linear_solver/Solver.cs.

◆ GetSolverEnum()

static int GetSolverEnum ( String  solverType)
inlinestatic

Definition at line 183 of file linear_solver/csharp/SolverHelper.cs.

◆ InterruptSolve()

bool InterruptSolve ( )
inline

Definition at line 186 of file linear_solver/Solver.cs.

◆ Iterations()

long Iterations ( )
inline

Definition at line 205 of file linear_solver/Solver.cs.

◆ LookupConstraintOrNull()

Constraint LookupConstraintOrNull ( string  constraint_name)
inline

Definition at line 115 of file linear_solver/Solver.cs.

◆ LookupVariableOrNull()

Variable LookupVariableOrNull ( string  var_name)
inline

Definition at line 70 of file linear_solver/Solver.cs.

◆ MakeBoolVar()

Variable MakeBoolVar ( string  name)
inline

Definition at line 98 of file linear_solver/Solver.cs.

◆ MakeBoolVarArray() [1/2]

Variable [] MakeBoolVarArray ( int  count)
inline

Definition at line 154 of file linear_solver/csharp/SolverHelper.cs.

◆ MakeBoolVarArray() [2/2]

Variable [] MakeBoolVarArray ( int  count,
string  var_name 
)
inline

Definition at line 158 of file linear_solver/csharp/SolverHelper.cs.

◆ MakeBoolVarMatrix() [1/2]

Variable [,] MakeBoolVarMatrix ( int  rows,
int  cols 
)
inline

Definition at line 162 of file linear_solver/csharp/SolverHelper.cs.

◆ MakeBoolVarMatrix() [2/2]

Variable [,] MakeBoolVarMatrix ( int  rows,
int  cols,
string  name 
)
inline

Definition at line 172 of file linear_solver/csharp/SolverHelper.cs.

◆ MakeConstraint() [1/4]

Constraint MakeConstraint ( )
inline

Definition at line 128 of file linear_solver/Solver.cs.

◆ MakeConstraint() [2/4]

Constraint MakeConstraint ( double  lb,
double  ub 
)
inline

Definition at line 122 of file linear_solver/Solver.cs.

◆ MakeConstraint() [3/4]

Constraint MakeConstraint ( double  lb,
double  ub,
string  name 
)
inline

Definition at line 134 of file linear_solver/Solver.cs.

◆ MakeConstraint() [4/4]

Constraint MakeConstraint ( string  name)
inline

Definition at line 141 of file linear_solver/Solver.cs.

◆ MakeIntVar()

Variable MakeIntVar ( double  lb,
double  ub,
string  name 
)
inline

Definition at line 91 of file linear_solver/Solver.cs.

◆ MakeIntVarArray() [1/2]

Variable [] MakeIntVarArray ( int  count,
double  lb,
double  ub 
)
inline

Definition at line 115 of file linear_solver/csharp/SolverHelper.cs.

◆ MakeIntVarArray() [2/2]

Variable [] MakeIntVarArray ( int  count,
double  lb,
double  ub,
string  var_name 
)
inline

Definition at line 119 of file linear_solver/csharp/SolverHelper.cs.

◆ MakeIntVarMatrix() [1/2]

Variable [,] MakeIntVarMatrix ( int  rows,
int  cols,
double  lb,
double  ub 
)
inline

Definition at line 126 of file linear_solver/csharp/SolverHelper.cs.

◆ MakeIntVarMatrix() [2/2]

Variable [,] MakeIntVarMatrix ( int  rows,
int  cols,
double  lb,
double  ub,
string  name 
)
inline

Definition at line 139 of file linear_solver/csharp/SolverHelper.cs.

◆ MakeNumVar()

Variable MakeNumVar ( double  lb,
double  ub,
string  name 
)
inline

Definition at line 84 of file linear_solver/Solver.cs.

◆ MakeNumVarArray() [1/2]

Variable [] MakeNumVarArray ( int  count,
double  lb,
double  ub 
)
inline

Definition at line 76 of file linear_solver/csharp/SolverHelper.cs.

◆ MakeNumVarArray() [2/2]

Variable [] MakeNumVarArray ( int  count,
double  lb,
double  ub,
string  var_name 
)
inline

Definition at line 80 of file linear_solver/csharp/SolverHelper.cs.

◆ MakeNumVarMatrix() [1/2]

Variable [,] MakeNumVarMatrix ( int  rows,
int  cols,
double  lb,
double  ub 
)
inline

Definition at line 87 of file linear_solver/csharp/SolverHelper.cs.

◆ MakeNumVarMatrix() [2/2]

Variable [,] MakeNumVarMatrix ( int  rows,
int  cols,
double  lb,
double  ub,
string  name 
)
inline

Definition at line 100 of file linear_solver/csharp/SolverHelper.cs.

◆ MakeVar()

Variable MakeVar ( double  lb,
double  ub,
bool  integer,
string  name 
)
inline

Definition at line 77 of file linear_solver/Solver.cs.

◆ MakeVarArray() [1/2]

Variable [] MakeVarArray ( int  count,
double  lb,
double  ub,
bool  integer 
)
inline

Definition at line 23 of file linear_solver/csharp/SolverHelper.cs.

◆ MakeVarArray() [2/2]

Variable [] MakeVarArray ( int  count,
double  lb,
double  ub,
bool  integer,
string  var_name 
)
inline

Definition at line 34 of file linear_solver/csharp/SolverHelper.cs.

◆ MakeVarMatrix() [1/2]

Variable [,] MakeVarMatrix ( int  rows,
int  cols,
double  lb,
double  ub,
bool  integer 
)
inline

Definition at line 46 of file linear_solver/csharp/SolverHelper.cs.

◆ MakeVarMatrix() [2/2]

Variable [,] MakeVarMatrix ( int  rows,
int  cols,
double  lb,
double  ub,
bool  integer,
string  name 
)
inline

Definition at line 60 of file linear_solver/csharp/SolverHelper.cs.

◆ Maximize() [1/2]

void Maximize ( LinearExpr  expr)
inline

Definition at line 221 of file linear_solver/csharp/SolverHelper.cs.

◆ Maximize() [2/2]

void Maximize ( Variable  var)
inline

Definition at line 242 of file linear_solver/csharp/SolverHelper.cs.

◆ Minimize() [1/2]

void Minimize ( LinearExpr  expr)
inline

Definition at line 207 of file linear_solver/csharp/SolverHelper.cs.

◆ Minimize() [2/2]

void Minimize ( Variable  var)
inline

Definition at line 235 of file linear_solver/csharp/SolverHelper.cs.

◆ Nodes()

long Nodes ( )
inline

Definition at line 210 of file linear_solver/Solver.cs.

◆ NumConstraints()

int NumConstraints ( )
inline

Definition at line 105 of file linear_solver/Solver.cs.

◆ NumVariables()

int NumVariables ( )
inline

Definition at line 60 of file linear_solver/Solver.cs.

◆ Objective()

Objective Objective ( )
inline

Definition at line 148 of file linear_solver/Solver.cs.

◆ Reset()

void Reset ( )
inline

Definition at line 182 of file linear_solver/Solver.cs.

◆ SetHint()

void SetHint ( MPVariableVector  variables,
double[]  values 
)
inline

Definition at line 239 of file linear_solver/Solver.cs.

◆ SetNumThreads()

bool SetNumThreads ( int  num_theads)
inline

Definition at line 244 of file linear_solver/Solver.cs.

◆ SetSolverSpecificParametersAsString()

bool SetSolverSpecificParametersAsString ( string  parameters)
inline

Definition at line 191 of file linear_solver/Solver.cs.

◆ SetTimeLimit()

void SetTimeLimit ( long  time_limit_milliseconds)
inline

Definition at line 220 of file linear_solver/Solver.cs.

◆ Solve() [1/2]

Solver.ResultStatus Solve ( )
inline

Definition at line 154 of file linear_solver/Solver.cs.

◆ Solve() [2/2]

Solver.ResultStatus Solve ( MPSolverParameters  param)
inline

Definition at line 159 of file linear_solver/Solver.cs.

◆ SupportsProblemType()

static bool SupportsProblemType ( Solver.OptimizationProblemType  problem_type)
inlinestatic

Definition at line 51 of file linear_solver/Solver.cs.

◆ SuppressOutput()

void SuppressOutput ( )
inline

Definition at line 201 of file linear_solver/Solver.cs.

◆ variables()

MPVariableVector variables ( )
inline

Definition at line 65 of file linear_solver/Solver.cs.

◆ VerifySolution()

bool VerifySolution ( double  tolerance,
bool  log_errors 
)
inline

Definition at line 177 of file linear_solver/Solver.cs.

◆ WallTime()

long WallTime ( )
inline

Definition at line 224 of file linear_solver/Solver.cs.

Member Data Documentation

◆ swigCMemOwn

bool swigCMemOwn
protected

Definition at line 15 of file linear_solver/Solver.cs.


The documentation for this class was generated from the following files: