Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
MPConstraint.java
Go to the documentation of this file.
1/* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (https://www.swig.org).
3 * Version 4.2.1
4 *
5 * Do not make changes to this file unless you know what you are doing - modify
6 * the SWIG interface file instead.
7 * ----------------------------------------------------------------------------- */
8
9package com.google.ortools.linearsolver;
10
11import java.lang.reflect.*;
12
18public class MPConstraint {
19 private transient long swigCPtr;
20 protected transient boolean swigCMemOwn;
21
22 protected MPConstraint(long cPtr, boolean cMemoryOwn) {
23 swigCMemOwn = cMemoryOwn;
24 swigCPtr = cPtr;
25 }
26
27 protected static long getCPtr(MPConstraint obj) {
28 return (obj == null) ? 0 : obj.swigCPtr;
29 }
30
31 protected static long swigRelease(MPConstraint obj) {
32 long ptr = 0;
33 if (obj != null) {
34 if (!obj.swigCMemOwn)
35 throw new RuntimeException("Cannot release ownership as memory is not owned");
36 ptr = obj.swigCPtr;
37 obj.swigCMemOwn = false;
38 obj.delete();
39 }
40 return ptr;
41 }
42
43 @SuppressWarnings({"deprecation", "removal"})
44 protected void finalize() {
45 delete();
46 }
47
48 public synchronized void delete() {
49 if (swigCPtr != 0) {
50 if (swigCMemOwn) {
51 swigCMemOwn = false;
52 mainJNI.delete_MPConstraint(swigCPtr);
53 }
54 swigCPtr = 0;
55 }
56 }
57
61 public String name() {
62 return mainJNI.MPConstraint_name(swigCPtr, this);
63 }
64
71 public void setCoefficient(MPVariable var, double coeff) {
72 mainJNI.MPConstraint_setCoefficient(swigCPtr, this, MPVariable.getCPtr(var), var, coeff);
73 }
74
79 public double getCoefficient(MPVariable var) {
80 return mainJNI.MPConstraint_getCoefficient(swigCPtr, this, MPVariable.getCPtr(var), var);
81 }
82
86 public double lb() {
87 return mainJNI.MPConstraint_lb(swigCPtr, this);
88 }
89
93 public double ub() {
94 return mainJNI.MPConstraint_ub(swigCPtr, this);
95 }
96
100 public void setLb(double lb) {
101 mainJNI.MPConstraint_setLb(swigCPtr, this, lb);
102 }
103
107 public void setUb(double ub) {
108 mainJNI.MPConstraint_setUb(swigCPtr, this, ub);
109 }
110
114 public void setBounds(double lb, double ub) {
115 mainJNI.MPConstraint_setBounds(swigCPtr, this, lb, ub);
116 }
117
121 public boolean isLazy() {
122 return mainJNI.MPConstraint_isLazy(swigCPtr, this);
123 }
124
138 public void setIsLazy(boolean laziness) {
139 mainJNI.MPConstraint_setIsLazy(swigCPtr, this, laziness);
140 }
141
145 public int index() {
146 return mainJNI.MPConstraint_index(swigCPtr, this);
147 }
148
153 public double dualValue() {
154 return mainJNI.MPConstraint_dualValue(swigCPtr, this);
155 }
156
169 public MPSolver.BasisStatus basisStatus() {
170 return MPSolver.BasisStatus.swigToEnum(mainJNI.MPConstraint_basisStatus(swigCPtr, this));
171 }
172
173}
static long swigRelease(MPConstraint obj)
MPConstraint(long cPtr, boolean cMemoryOwn)
void setCoefficient(MPVariable var, double coeff)
static long getCPtr(MPConstraint obj)
static long getCPtr(MPVariable obj)
static BasisStatus swigToEnum(int swigValue)