Google OR-Tools v9.9
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
com.google.ortools.linearsolver.MPVariable Class Reference

Public Member Functions

synchronized void delete ()
 
String name ()
 
void setInteger (boolean integer)
 
double solutionValue ()
 
int index ()
 
double lb ()
 
double ub ()
 
void setLb (double lb)
 
void setUb (double ub)
 
void setBounds (double lb, double ub)
 
double reducedCost ()
 
MPSolver.BasisStatus basisStatus ()
 

Protected Member Functions

 MPVariable (long cPtr, boolean cMemoryOwn)
 
void finalize ()
 

Static Protected Member Functions

static long getCPtr (MPVariable obj)
 
static long swigRelease (MPVariable obj)
 

Protected Attributes

transient boolean swigCMemOwn
 

Detailed Description

The class for variables of a Mathematical Programming (MP) model.

Definition at line 16 of file MPVariable.java.

Constructor & Destructor Documentation

◆ MPVariable()

com.google.ortools.linearsolver.MPVariable.MPVariable ( long cPtr,
boolean cMemoryOwn )
protected

Definition at line 20 of file MPVariable.java.

Member Function Documentation

◆ basisStatus()

MPSolver.BasisStatus com.google.ortools.linearsolver.MPVariable.basisStatus ( )

Advanced usage: returns the basis status of the variable in the current
solution (only available for continuous problems).

See also
MPSolver::BasisStatus.

Definition at line 137 of file MPVariable.java.

◆ delete()

synchronized void com.google.ortools.linearsolver.MPVariable.delete ( )

Definition at line 46 of file MPVariable.java.

◆ finalize()

void com.google.ortools.linearsolver.MPVariable.finalize ( )
protected

Definition at line 42 of file MPVariable.java.

◆ getCPtr()

static long com.google.ortools.linearsolver.MPVariable.getCPtr ( MPVariable obj)
staticprotected

Definition at line 25 of file MPVariable.java.

◆ index()

int com.google.ortools.linearsolver.MPVariable.index ( )

Returns the index of the variable in the MPSolver::variables_.

Definition at line 84 of file MPVariable.java.

◆ lb()

double com.google.ortools.linearsolver.MPVariable.lb ( )

Returns the lower bound.

Definition at line 91 of file MPVariable.java.

◆ name()

String com.google.ortools.linearsolver.MPVariable.name ( )

Returns the name of the variable.

Definition at line 59 of file MPVariable.java.

◆ reducedCost()

double com.google.ortools.linearsolver.MPVariable.reducedCost ( )

Advanced usage: returns the reduced cost of the variable in the current
solution (only available for continuous problems).

Definition at line 127 of file MPVariable.java.

◆ setBounds()

void com.google.ortools.linearsolver.MPVariable.setBounds ( double lb,
double ub )

Sets both the lower and upper bounds.

Definition at line 119 of file MPVariable.java.

◆ setInteger()

void com.google.ortools.linearsolver.MPVariable.setInteger ( boolean integer)

Sets the integrality requirement of the variable.

Definition at line 66 of file MPVariable.java.

◆ setLb()

void com.google.ortools.linearsolver.MPVariable.setLb ( double lb)

Sets the lower bound.

Definition at line 105 of file MPVariable.java.

◆ setUb()

void com.google.ortools.linearsolver.MPVariable.setUb ( double ub)

Sets the upper bound.

Definition at line 112 of file MPVariable.java.

◆ solutionValue()

double com.google.ortools.linearsolver.MPVariable.solutionValue ( )

Returns the value of the variable in the current solution.

If the variable is integer, then the value will always be an integer (the
underlying solver handles floating-point values only, but this function
automatically rounds it to the nearest integer; see: man 3 round).

Definition at line 77 of file MPVariable.java.

◆ swigRelease()

static long com.google.ortools.linearsolver.MPVariable.swigRelease ( MPVariable obj)
staticprotected

Definition at line 29 of file MPVariable.java.

◆ ub()

double com.google.ortools.linearsolver.MPVariable.ub ( )

Returns the upper bound.

Definition at line 98 of file MPVariable.java.

Member Data Documentation

◆ swigCMemOwn

transient boolean com.google.ortools.linearsolver.MPVariable.swigCMemOwn
protected

Definition at line 18 of file MPVariable.java.


The documentation for this class was generated from the following file: