MPConstraint.java
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 4.0.0
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 
9 package com.google.ortools.linearsolver;
10 
11 import java.lang.reflect.*;
12 
18 public 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  @SuppressWarnings("deprecation")
32  protected void finalize() {
33  delete();
34  }
35 
36  public synchronized void delete() {
37  if (swigCPtr != 0) {
38  if (swigCMemOwn) {
39  swigCMemOwn = false;
41  }
42  swigCPtr = 0;
43  }
44  }
45 
49  public String name() {
51  }
52 
59  public void setCoefficient(MPVariable var, double coeff) {
60  main_research_linear_solverJNI.MPConstraint_setCoefficient(swigCPtr, this, MPVariable.getCPtr(var), var, coeff);
61  }
62 
67  public double getCoefficient(MPVariable var) {
68  return main_research_linear_solverJNI.MPConstraint_getCoefficient(swigCPtr, this, MPVariable.getCPtr(var), var);
69  }
70 
74  public double lb() {
75  return main_research_linear_solverJNI.MPConstraint_lb(swigCPtr, this);
76  }
77 
81  public double ub() {
82  return main_research_linear_solverJNI.MPConstraint_ub(swigCPtr, this);
83  }
84 
88  public void setLb(double lb) {
90  }
91 
95  public void setUb(double ub) {
97  }
98 
102  public void setBounds(double lb, double ub) {
104  }
105 
109  public boolean isLazy() {
111  }
112 
125  public void setIsLazy(boolean laziness) {
126  main_research_linear_solverJNI.MPConstraint_setIsLazy(swigCPtr, this, laziness);
127  }
128 
132  public int index() {
133  return main_research_linear_solverJNI.MPConstraint_index(swigCPtr, this);
134  }
135 
140  public double dualValue() {
142  }
143 
158  }
159 
160 }
String name()
Returns the name of the constraint.
static final native void MPConstraint_setCoefficient(long jarg1, MPConstraint jarg1_, long jarg2, MPVariable jarg2_, double jarg3)
The class for variables of a Mathematical Programming (MP) model.
Definition: MPVariable.java:16
static final native String MPConstraint_name(long jarg1, MPConstraint jarg1_)
MPConstraint(long cPtr, boolean cMemoryOwn)
static final native void MPConstraint_setIsLazy(long jarg1, MPConstraint jarg1_, boolean jarg2)
int index()
Returns the index of the constraint in the MPSolver::constraints_.
The class for constraints of a Mathematical Programming (MP) model.
static BasisStatus swigToEnum(int swigValue)
Definition: MPSolver.java:697
void setBounds(double lb, double ub)
Sets both the lower and upper bounds.
static final native double MPConstraint_getCoefficient(long jarg1, MPConstraint jarg1_, long jarg2, MPVariable jarg2_)
static final native void MPConstraint_setUb(long jarg1, MPConstraint jarg1_, double jarg2)
void setUb(double ub)
Sets the upper bound.
void setIsLazy(boolean laziness)
Advanced usage: sets the constraint "laziness".
This mathematical programming (MP) solver class is the main class though which users build and solve...
Definition: MPSolver.java:17
static final native void MPConstraint_setBounds(long jarg1, MPConstraint jarg1_, double jarg2, double jarg3)
static final native int MPConstraint_index(long jarg1, MPConstraint jarg1_)
Advanced usage: possible basis status values for a variable and the slack variable of a linear const...
Definition: MPSolver.java:686
double lb()
Returns the lower bound.
double dualValue()
Advanced usage: returns the dual value of the constraint in the current solution (only available for...
static final native void MPConstraint_setLb(long jarg1, MPConstraint jarg1_, double jarg2)
static final native boolean MPConstraint_isLazy(long jarg1, MPConstraint jarg1_)
static final native int MPConstraint_basisStatus(long jarg1, MPConstraint jarg1_)
double ub()
Returns the upper bound.
boolean isLazy()
Advanced usage: returns true if the constraint is "lazy" (see below).
static final native void delete_MPConstraint(long jarg1)
void setCoefficient(MPVariable var, double coeff)
Sets the coefficient of the variable on the constraint.
double getCoefficient(MPVariable var)
Gets the coefficient of a given variable on the constraint (which is 0 if the variable does not appe...
void setLb(double lb)
Sets the lower bound.
MPSolver.BasisStatus basisStatus()
Advanced usage: returns the basis status of the constraint.
static final native double MPConstraint_ub(long jarg1, MPConstraint jarg1_)
static final native double MPConstraint_lb(long jarg1, MPConstraint jarg1_)
static final native double MPConstraint_dualValue(long jarg1, MPConstraint jarg1_)