DotNet Reference
DotNet Reference
linear_solver/Solver.cs
Go to the documentation of this file.
23 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
42 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
47 public Solver(string name, Solver.OptimizationProblemType problem_type) : this(operations_research_linear_solverPINVOKE.new_Solver(name, (int)problem_type), true) {
48 if (operations_research_linear_solverPINVOKE.SWIGPendingException.Pending) throw operations_research_linear_solverPINVOKE.SWIGPendingException.Retrieve();
52 bool ret = operations_research_linear_solverPINVOKE.Solver_SupportsProblemType((int)problem_type);
66 MPVariableVector ret = new MPVariableVector(operations_research_linear_solverPINVOKE.Solver_variables(swigCPtr), false);
71 global::System.IntPtr cPtr = operations_research_linear_solverPINVOKE.Solver_LookupVariableOrNull(swigCPtr, var_name);
73 if (operations_research_linear_solverPINVOKE.SWIGPendingException.Pending) throw operations_research_linear_solverPINVOKE.SWIGPendingException.Retrieve();
78 global::System.IntPtr cPtr = operations_research_linear_solverPINVOKE.Solver_MakeVar(swigCPtr, lb, ub, integer, name);
80 if (operations_research_linear_solverPINVOKE.SWIGPendingException.Pending) throw operations_research_linear_solverPINVOKE.SWIGPendingException.Retrieve();
85 global::System.IntPtr cPtr = operations_research_linear_solverPINVOKE.Solver_MakeNumVar(swigCPtr, lb, ub, name);
87 if (operations_research_linear_solverPINVOKE.SWIGPendingException.Pending) throw operations_research_linear_solverPINVOKE.SWIGPendingException.Retrieve();
92 global::System.IntPtr cPtr = operations_research_linear_solverPINVOKE.Solver_MakeIntVar(swigCPtr, lb, ub, name);
94 if (operations_research_linear_solverPINVOKE.SWIGPendingException.Pending) throw operations_research_linear_solverPINVOKE.SWIGPendingException.Retrieve();
99 global::System.IntPtr cPtr = operations_research_linear_solverPINVOKE.Solver_MakeBoolVar(swigCPtr, name);
101 if (operations_research_linear_solverPINVOKE.SWIGPendingException.Pending) throw operations_research_linear_solverPINVOKE.SWIGPendingException.Retrieve();
111 MPConstraintVector ret = new MPConstraintVector(operations_research_linear_solverPINVOKE.Solver_constraints(swigCPtr), false);
116 global::System.IntPtr cPtr = operations_research_linear_solverPINVOKE.Solver_LookupConstraintOrNull(swigCPtr, constraint_name);
118 if (operations_research_linear_solverPINVOKE.SWIGPendingException.Pending) throw operations_research_linear_solverPINVOKE.SWIGPendingException.Retrieve();
123 global::System.IntPtr cPtr = operations_research_linear_solverPINVOKE.Solver_MakeConstraint__SWIG_0(swigCPtr, lb, ub);
129 global::System.IntPtr cPtr = operations_research_linear_solverPINVOKE.Solver_MakeConstraint__SWIG_1(swigCPtr);
135 global::System.IntPtr cPtr = operations_research_linear_solverPINVOKE.Solver_MakeConstraint__SWIG_2(swigCPtr, lb, ub, name);
137 if (operations_research_linear_solverPINVOKE.SWIGPendingException.Pending) throw operations_research_linear_solverPINVOKE.SWIGPendingException.Retrieve();
142 global::System.IntPtr cPtr = operations_research_linear_solverPINVOKE.Solver_MakeConstraint__SWIG_3(swigCPtr, name);
144 if (operations_research_linear_solverPINVOKE.SWIGPendingException.Pending) throw operations_research_linear_solverPINVOKE.SWIGPendingException.Retrieve();
149 global::System.IntPtr cPtr = operations_research_linear_solverPINVOKE.Solver_Objective(swigCPtr);
155 Solver.ResultStatus ret = (Solver.ResultStatus)operations_research_linear_solverPINVOKE.Solver_Solve__SWIG_0(swigCPtr);
160 Solver.ResultStatus ret = (Solver.ResultStatus)operations_research_linear_solverPINVOKE.Solver_Solve__SWIG_1(swigCPtr, MPSolverParameters.getCPtr(param));
161 if (operations_research_linear_solverPINVOKE.SWIGPendingException.Pending) throw operations_research_linear_solverPINVOKE.SWIGPendingException.Retrieve();
166 global::System.IntPtr cPtr = operations_research_linear_solverPINVOKE.Solver_ComputeConstraintActivities(swigCPtr);
178 bool ret = operations_research_linear_solverPINVOKE.Solver_VerifySolution(swigCPtr, tolerance, log_errors);
192 bool ret = operations_research_linear_solverPINVOKE.Solver_SetSolverSpecificParametersAsString(swigCPtr, parameters);
193 if (operations_research_linear_solverPINVOKE.SWIGPendingException.Pending) throw operations_research_linear_solverPINVOKE.SWIGPendingException.Retrieve();
216 double ret = operations_research_linear_solverPINVOKE.Solver_ComputeExactConditionNumber(swigCPtr);
221 operations_research_linear_solverPINVOKE.Solver_SetTimeLimit(swigCPtr, time_limit_milliseconds);
230 string ret = operations_research_linear_solverPINVOKE.Solver_ExportModelAsLpFormat(swigCPtr, obfuscated);
235 string ret = operations_research_linear_solverPINVOKE.Solver_ExportModelAsMpsFormat(swigCPtr, fixed_format, obfuscated);
240 operations_research_linear_solverPINVOKE.Solver_SetHint(swigCPtr, MPVariableVector.getCPtr(variables), values.Length, values );
int NumConstraints()
Definition: linear_solver/Solver.cs:105
Variable MakeVar(double lb, double ub, bool integer, string name)
Definition: linear_solver/Solver.cs:77
static global::System.IntPtr Solver_MakeConstraint__SWIG_3(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2)
static global::System.IntPtr Solver_MakeIntVar(global::System.Runtime.InteropServices.HandleRef jarg1, double jarg2, double jarg3, string jarg4)
static global::System.IntPtr Solver_MakeConstraint__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1)
MPConstraintVector constraints()
Definition: linear_solver/Solver.cs:110
Solver.ResultStatus Solve()
Definition: linear_solver/Solver.cs:154
static void Solver_SetTimeLimit(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
string ExportModelAsLpFormat(bool obfuscated)
Definition: linear_solver/Solver.cs:229
static long Solver_WallTime(global::System.Runtime.InteropServices.HandleRef jarg1)
void SuppressOutput()
Definition: linear_solver/Solver.cs:201
Constraint MakeConstraint(string name)
Definition: linear_solver/Solver.cs:141
int NumVariables()
Definition: linear_solver/Solver.cs:60
double ComputeExactConditionNumber()
Definition: linear_solver/Solver.cs:215
static global::System.IntPtr Solver_MakeNumVar(global::System.Runtime.InteropServices.HandleRef jarg1, double jarg2, double jarg3, string jarg4)
static bool Solver_VerifySolution(global::System.Runtime.InteropServices.HandleRef jarg1, double jarg2, bool jarg3)
static global::System.IntPtr Solver_MakeConstraint__SWIG_2(global::System.Runtime.InteropServices.HandleRef jarg1, double jarg2, double jarg3, string jarg4)
virtual void Dispose(bool disposing)
Definition: linear_solver/Solver.cs:35
static long Solver_Nodes(global::System.Runtime.InteropServices.HandleRef jarg1)
Constraint MakeConstraint(double lb, double ub, string name)
Definition: linear_solver/Solver.cs:134
long Iterations()
Definition: linear_solver/Solver.cs:205
bool VerifySolution(double tolerance, bool log_errors)
Definition: linear_solver/Solver.cs:177
MPVariableVector variables()
Definition: linear_solver/Solver.cs:65
static global::System.IntPtr Solver_LookupConstraintOrNull(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2)
static bool Pending
Definition: operations_research_linear_solverPINVOKE.cs:133
static int Solver_Solve__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static global::System.IntPtr Solver_LookupVariableOrNull(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2)
bool SetNumThreads(int num_theads)
Definition: linear_solver/Solver.cs:244
void SetHint(MPVariableVector variables, double[] values)
Definition: linear_solver/Solver.cs:239
void EnableOutput()
Definition: linear_solver/Solver.cs:197
Definition: operations_research_linear_solverPINVOKE.cs:13
static string Solver_ExportModelAsMpsFormat(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2, bool jarg3)
static int Solver_NumVariables(global::System.Runtime.InteropServices.HandleRef jarg1)
Constraint MakeConstraint()
Definition: linear_solver/Solver.cs:128
static int Solver_Solve__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr Solver_variables(global::System.Runtime.InteropServices.HandleRef jarg1)
Objective Objective()
Definition: linear_solver/Solver.cs:148
static double Solver_ComputeExactConditionNumber(global::System.Runtime.InteropServices.HandleRef jarg1)
Variable LookupVariableOrNull(string var_name)
Definition: linear_solver/Solver.cs:70
bool InterruptSolve()
Definition: linear_solver/Solver.cs:186
static global::System.IntPtr Solver_MakeVar(global::System.Runtime.InteropServices.HandleRef jarg1, double jarg2, double jarg3, bool jarg4, string jarg5)
Constraint LookupConstraintOrNull(string constraint_name)
Definition: linear_solver/Solver.cs:115
static void Solver_Clear(global::System.Runtime.InteropServices.HandleRef jarg1)
Solver.ResultStatus Solve(MPSolverParameters param)
Definition: linear_solver/Solver.cs:159
static void Solver_Reset(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr Solver_constraints(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr Solver_Objective(global::System.Runtime.InteropServices.HandleRef jarg1)
static long Solver_Iterations(global::System.Runtime.InteropServices.HandleRef jarg1)
void SetTimeLimit(long time_limit_milliseconds)
Definition: linear_solver/Solver.cs:220
static bool Solver_SetNumThreads(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
bool swigCMemOwn
Definition: linear_solver/Solver.cs:15
Definition: operations_research_linear_solverPINVOKE.cs:127
static bool SupportsProblemType(Solver.OptimizationProblemType problem_type)
Definition: linear_solver/Solver.cs:51
static bool Solver_SetSolverSpecificParametersAsString(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2)
static string Solver_ExportModelAsLpFormat(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2)
OptimizationProblemType
Definition: linear_solver/Solver.cs:249
string ExportModelAsMpsFormat(bool fixed_format, bool obfuscated)
Definition: linear_solver/Solver.cs:234
static bool Solver_SupportsProblemType(int jarg1)
Solver(string name, Solver.OptimizationProblemType problem_type)
Definition: linear_solver/Solver.cs:47
double[] ComputeConstraintActivities()
Definition: linear_solver/Solver.cs:165
static void Solver_SetHint(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, int length3, double[] jarg3)
bool SetSolverSpecificParametersAsString(string parameters)
Definition: linear_solver/Solver.cs:191
static global::System.Exception Retrieve()
Definition: operations_research_linear_solverPINVOKE.cs:152
void CopyTo(double[] array)
Definition: DoubleVector.cs:108
static global::System.IntPtr Solver_MakeConstraint__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, double jarg2, double jarg3)
static global::System.IntPtr Solver_ComputeConstraintActivities(global::System.Runtime.InteropServices.HandleRef jarg1)
static void delete_Solver(global::System.Runtime.InteropServices.HandleRef jarg1)
Variable MakeIntVar(double lb, double ub, string name)
Definition: linear_solver/Solver.cs:91
static bool Solver_InterruptSolve(global::System.Runtime.InteropServices.HandleRef jarg1)
Variable MakeBoolVar(string name)
Definition: linear_solver/Solver.cs:98
static void Solver_EnableOutput(global::System.Runtime.InteropServices.HandleRef jarg1)
static int Solver_NumConstraints(global::System.Runtime.InteropServices.HandleRef jarg1)
Variable MakeNumVar(double lb, double ub, string name)
Definition: linear_solver/Solver.cs:84
static void Solver_SuppressOutput(global::System.Runtime.InteropServices.HandleRef jarg1)
Constraint MakeConstraint(double lb, double ub)
Definition: linear_solver/Solver.cs:122
static global::System.IntPtr Solver_MakeBoolVar(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2)