13public class KnapsackSolver : global::System.IDisposable {
14 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
19 swigCPtr =
new global::System.Runtime.InteropServices.HandleRef(
this, cPtr);
22 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(
KnapsackSolver 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(KnapsackSolver 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 KnapsackSolver(
string solver_name) : this(operations_research_algorithmsPINVOKE.new_KnapsackSolver__SWIG_0(solver_name), true) {
61 if (operations_research_algorithmsPINVOKE.SWIGPendingException.Pending)
throw operations_research_algorithmsPINVOKE.SWIGPendingException.Retrieve();
68 public void Init(
long[] profits,
long[,] weights,
long[] capacities) {
73, capacities.Length, capacities );