MPObjective.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 
16 public class MPObjective {
17  private transient long swigCPtr;
18  protected transient boolean swigCMemOwn;
19 
20  protected MPObjective(long cPtr, boolean cMemoryOwn) {
21  swigCMemOwn = cMemoryOwn;
22  swigCPtr = cPtr;
23  }
24 
25  protected static long getCPtr(MPObjective obj) {
26  return (obj == null) ? 0 : obj.swigCPtr;
27  }
28 
29  @SuppressWarnings("deprecation")
30  protected void finalize() {
31  delete();
32  }
33 
34  public synchronized void delete() {
35  if (swigCPtr != 0) {
36  if (swigCMemOwn) {
37  swigCMemOwn = false;
39  }
40  swigCPtr = 0;
41  }
42  }
43 
48  public void clear() {
50  }
51 
58  public void setCoefficient(MPVariable var, double coeff) {
59  main_research_linear_solverJNI.MPObjective_setCoefficient(swigCPtr, this, MPVariable.getCPtr(var), var, coeff);
60  }
61 
67  public double getCoefficient(MPVariable var) {
68  return main_research_linear_solverJNI.MPObjective_getCoefficient(swigCPtr, this, MPVariable.getCPtr(var), var);
69  }
70 
74  public void setOffset(double value) {
76  }
77 
81  public double offset() {
83  }
84 
88  public void setOptimizationDirection(boolean maximize) {
90  }
91 
95  public void setMinimization() {
97  }
98 
102  public void setMaximization() {
104  }
105 
109  public boolean maximization() {
111  }
112 
116  public boolean minimization() {
118  }
119 
131  public double value() {
132  return main_research_linear_solverJNI.MPObjective_value(swigCPtr, this);
133  }
134 
141  public double bestBound() {
143  }
144 
145 }
MPObjective(long cPtr, boolean cMemoryOwn)
static final native boolean MPObjective_maximization(long jarg1, MPObjective jarg1_)
The class for variables of a Mathematical Programming (MP) model.
Definition: MPVariable.java:16
static final native void MPObjective_setMaximization(long jarg1, MPObjective jarg1_)
void setMaximization()
Sets the optimization direction to maximize.
double bestBound()
Returns the best objective bound.
double offset()
Gets the constant term in the objective.
static final native double MPObjective_value(long jarg1, MPObjective jarg1_)
static final native void MPObjective_setMinimization(long jarg1, MPObjective jarg1_)
static final native void delete_MPObjective(long jarg1)
void setOffset(double value)
Sets the constant term in the objective.
void clear()
Clears the offset, all variables and coefficients, and the optimization direction.
static final native void MPObjective_clear(long jarg1, MPObjective jarg1_)
void setCoefficient(MPVariable var, double coeff)
Sets the coefficient of the variable in the objective.
void setMinimization()
Sets the optimization direction to minimize.
boolean minimization()
Is the optimization direction set to minimize?
double value()
Returns the objective value of the best solution found so far.
double getCoefficient(MPVariable var)
Gets the coefficient of a given variable in the objective It returns 0 if the variable does not ap...
static final native boolean MPObjective_minimization(long jarg1, MPObjective jarg1_)
static final native double MPObjective_bestBound(long jarg1, MPObjective jarg1_)
static final native double MPObjective_offset(long jarg1, MPObjective jarg1_)
static final native void MPObjective_setCoefficient(long jarg1, MPObjective jarg1_, long jarg2, MPVariable jarg2_, double jarg3)
static final native void MPObjective_setOptimizationDirection(long jarg1, MPObjective jarg1_, boolean jarg2)
A class to express a linear objective.
static final native double MPObjective_getCoefficient(long jarg1, MPObjective jarg1_, long jarg2, MPVariable jarg2_)
void setOptimizationDirection(boolean maximize)
Sets the optimization direction (maximize: true or minimize: false).
static final native void MPObjective_setOffset(long jarg1, MPObjective jarg1_, double jarg2)
boolean maximization()
Is the optimization direction set to maximize?