Java Reference

Java Reference

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.2
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 
13 public class MPObjective {
14  private transient long swigCPtr;
15  protected transient boolean swigCMemOwn;
16 
17  protected MPObjective(long cPtr, boolean cMemoryOwn) {
18  swigCMemOwn = cMemoryOwn;
19  swigCPtr = cPtr;
20  }
21 
22  protected static long getCPtr(MPObjective obj) {
23  return (obj == null) ? 0 : obj.swigCPtr;
24  }
25 
26  @SuppressWarnings("deprecation")
27  protected void finalize() {
28  delete();
29  }
30 
31  public synchronized void delete() {
32  if (swigCPtr != 0) {
33  if (swigCMemOwn) {
34  swigCMemOwn = false;
35  main_research_linear_solverJNI.delete_MPObjective(swigCPtr);
36  }
37  swigCPtr = 0;
38  }
39  }
40 
41  public void clear() {
42  main_research_linear_solverJNI.MPObjective_clear(swigCPtr, this);
43  }
44 
45  public void setCoefficient(MPVariable var, double coeff) {
46  main_research_linear_solverJNI.MPObjective_setCoefficient(swigCPtr, this, MPVariable.getCPtr(var), var, coeff);
47  }
48 
49  public double getCoefficient(MPVariable var) {
50  return main_research_linear_solverJNI.MPObjective_getCoefficient(swigCPtr, this, MPVariable.getCPtr(var), var);
51  }
52 
53  public void setOffset(double value) {
54  main_research_linear_solverJNI.MPObjective_setOffset(swigCPtr, this, value);
55  }
56 
57  public double offset() {
58  return main_research_linear_solverJNI.MPObjective_offset(swigCPtr, this);
59  }
60 
61  public void setOptimizationDirection(boolean maximize) {
62  main_research_linear_solverJNI.MPObjective_setOptimizationDirection(swigCPtr, this, maximize);
63  }
64 
65  public void setMinimization() {
66  main_research_linear_solverJNI.MPObjective_setMinimization(swigCPtr, this);
67  }
68 
69  public void setMaximization() {
70  main_research_linear_solverJNI.MPObjective_setMaximization(swigCPtr, this);
71  }
72 
73  public boolean maximization() {
74  return main_research_linear_solverJNI.MPObjective_maximization(swigCPtr, this);
75  }
76 
77  public boolean minimization() {
78  return main_research_linear_solverJNI.MPObjective_minimization(swigCPtr, this);
79  }
80 
81  public double value() {
82  return main_research_linear_solverJNI.MPObjective_value(swigCPtr, this);
83  }
84 
85  public double bestBound() {
86  return main_research_linear_solverJNI.MPObjective_bestBound(swigCPtr, this);
87  }
88 
89 }
double value()
boolean minimization()
void setMinimization()
void setOffset(double value)
void setCoefficient(MPVariable var, double coeff)
double bestBound()
void setMaximization()
MPObjective(long cPtr, boolean cMemoryOwn)
boolean maximization()
double getCoefficient(MPVariable var)
void clear()
Definition: MPVariable.java:13
double offset()
void setOptimizationDirection(boolean maximize)