9 package com.google.ortools.algorithms;
12 private transient long swigCPtr;
21 return (obj ==
null) ? 0 : obj.swigCPtr;
28 public synchronized void delete() {
32 mainJNI.delete_KnapsackSolver(swigCPtr);
39 this(mainJNI.new_KnapsackSolver__SWIG_0(solver_name),
true);
43 this(mainJNI.new_KnapsackSolver__SWIG_1(solver_type.swigValue(), solver_name),
true);
46 public void init(
long[] profits,
long[][] weights,
long[] capacities) {
47 mainJNI.KnapsackSolver_init(swigCPtr,
this, profits, weights, capacities);
51 return mainJNI.KnapsackSolver_solve(swigCPtr,
this);
55 return mainJNI.KnapsackSolver_bestSolutionContains(swigCPtr,
this, item_id);
71 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
72 return swigValues[swigValue];
74 if (swigEnum.swigValue == swigValue)
76 throw new IllegalArgumentException(
"No enum " +
SolverType.class +
" with value " + swigValue);
79 @SuppressWarnings(
"unused")
81 this.swigValue = SwigNext.next++;
84 @SuppressWarnings(
"unused")
85 private SolverType(
int swigValue) {
86 this.swigValue = swigValue;
87 SwigNext.next = swigValue+1;
90 @SuppressWarnings(
"unused")
91 private SolverType(SolverType swigEnum) {
92 this.swigValue = swigEnum.swigValue;
93 SwigNext.next = this.swigValue+1;
96 private final int swigValue;
98 private static class SwigNext {
99 private static int next = 0;