13public partial class Solver : global::System.IDisposable {
14 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
17 internal Solver(global::System.IntPtr cPtr,
bool cMemoryOwn) {
19 swigCPtr =
new global::System.Runtime.InteropServices.HandleRef(
this, cPtr);
22 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(
Solver obj) {
23 return (obj ==
null) ?
new global::System.Runtime.InteropServices.HandleRef(
null, global::System.IntPtr.Zero) : obj.swigCPtr;
26 internal static global::System.Runtime.InteropServices.HandleRef swigRelease(Solver obj) {
29 throw new global::System.ApplicationException(
"Cannot release ownership as memory is not owned");
30 global::System.Runtime.InteropServices.HandleRef ptr = obj.swigCPtr;
31 obj.swigCMemOwn =
false;
35 return new global::System.Runtime.InteropServices.HandleRef(
null, global::System.IntPtr.Zero);
45 global::System.GC.SuppressFinalize(
this);
48 protected virtual void Dispose(
bool disposing) {
50 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
55 swigCPtr =
new global::System.Runtime.InteropServices.HandleRef(
null, global::System.IntPtr.Zero);
60 public Solver(
string name, Solver.OptimizationProblemType problem_type) : this(operations_research_linear_solverPINVOKE.new_Solver(name, (int)problem_type), true) {
61 if (operations_research_linear_solverPINVOKE.SWIGPendingException.Pending)
throw operations_research_linear_solverPINVOKE.SWIGPendingException.Retrieve();
66 Solver ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
Solver(cPtr, true);
97 Variable ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
Variable(cPtr, false);
108 public Variable MakeVar(
double lb,
double ub,
bool integer,
string name) {
205 if (cPtr != global::System.IntPtr.Zero) {
207 double[] outArray =
new double[tmpVector.
Count];
208 tmpVector.
CopyTo(outArray);
215 bool ret = operations_research_linear_solverPINVOKE.Solver_VerifySolution(swigCPtr, tolerance, log_errors);
219 public void Reset() {
247 public long Nodes() {
262 public void SetTimeLimit(
long time_limit_milliseconds) {