Class ScalProd

java.lang.Object
com.google.ortools.sat.ScalProd
All Implemented Interfaces:
LinearExpr

public final class ScalProd
extends java.lang.Object
implements LinearExpr
A linear expression interface that can be parsed.
  • Constructor Summary

    Constructors
    Constructor Description
    ScalProd​(IntVar[] variables, long[] coefficients)  
    ScalProd​(Literal[] literals)  
    ScalProd​(Literal[] literals, long[] coefficients)  
  • Method Summary

    Modifier and Type Method Description
    long getCoefficient​(int index)
    Returns the ith coefficient.
    long getOffset()
    Returns the constant part of the expression.
    IntVar getVariable​(int index)
    Returns the ith variable.
    int numElements()
    Returns the number of elements in the interface.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ScalProd

      public ScalProd​(IntVar[] variables, long[] coefficients)
    • ScalProd

      public ScalProd​(Literal[] literals, long[] coefficients)
    • ScalProd

      public ScalProd​(Literal[] literals)
  • Method Details

    • numElements

      public int numElements()
      Description copied from interface: LinearExpr
      Returns the number of elements in the interface.
      Specified by:
      numElements in interface LinearExpr
    • getVariable

      public IntVar getVariable​(int index)
      Description copied from interface: LinearExpr
      Returns the ith variable.
      Specified by:
      getVariable in interface LinearExpr
    • getCoefficient

      public long getCoefficient​(int index)
      Description copied from interface: LinearExpr
      Returns the ith coefficient.
      Specified by:
      getCoefficient in interface LinearExpr
    • getOffset

      public long getOffset()
      Description copied from interface: LinearExpr
      Returns the constant part of the expression.
      Specified by:
      getOffset in interface LinearExpr