All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.ortools.linearsolver.MPVariable Maven / Gradle / Ivy

The newest version!
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 3.0.10
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package com.google.ortools.linearsolver;

import java.lang.reflect.*;

public class MPVariable {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

  protected MPVariable(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(MPVariable obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        operations_research_linear_solverJNI.delete_MPVariable(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public String name() {
    return operations_research_linear_solverJNI.MPVariable_name(swigCPtr, this);
  }

  public void setInteger(boolean integer) {
    operations_research_linear_solverJNI.MPVariable_setInteger(swigCPtr, this, integer);
  }

  public double solutionValue() {
    return operations_research_linear_solverJNI.MPVariable_solutionValue(swigCPtr, this);
  }

  public int index() {
    return operations_research_linear_solverJNI.MPVariable_index(swigCPtr, this);
  }

  public double lb() {
    return operations_research_linear_solverJNI.MPVariable_lb(swigCPtr, this);
  }

  public double ub() {
    return operations_research_linear_solverJNI.MPVariable_ub(swigCPtr, this);
  }

  public void setLb(double lb) {
    operations_research_linear_solverJNI.MPVariable_setLb(swigCPtr, this, lb);
  }

  public void setUb(double ub) {
    operations_research_linear_solverJNI.MPVariable_setUb(swigCPtr, this, ub);
  }

  public void setBounds(double lb, double ub) {
    operations_research_linear_solverJNI.MPVariable_setBounds(swigCPtr, this, lb, ub);
  }

  public double reducedCost() {
    return operations_research_linear_solverJNI.MPVariable_reducedCost(swigCPtr, this);
  }

  public MPSolver.BasisStatus basisStatus() {
    return MPSolver.BasisStatus.swigToEnum(operations_research_linear_solverJNI.MPVariable_basisStatus(swigCPtr, this));
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy