Class LazyPiece

java.lang.Object
it.univr.di.labeledvalue.lazy.LazyWeight
it.univr.di.labeledvalue.lazy.LazyPiece

public final class LazyPiece
extends LazyWeight
Represent a linear piece wise function. value = m*x+c This class and its subclasses MUST BE considered IMMUTABLE even if we don't make it immutable for efficiency reasons.
Author:
posenato
  • Constructor Details

    • LazyPiece

      public LazyPiece​(org.apache.commons.math3.fraction.Fraction x1, int m1, int c1, boolean onlyIfNeg1)
      Parameters:
      x1 -
      m1 -
      c1 -
      onlyIfNeg1 -
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class LazyWeight
    • isOnlyIfNeg

      public boolean isOnlyIfNeg()
      Returns:
      the onlyIfNeg
    • getX

      public org.apache.commons.math3.fraction.Fraction getX()
      Specified by:
      getX in class LazyWeight
      Returns:
      the x
    • getC

      public int getC()
      Returns:
      the c
    • getM

      public int getM()
      Returns:
      the m
    • setX

      public void setX​(org.apache.commons.math3.fraction.Fraction newX)
      Specified by:
      setX in class LazyWeight
    • getValue

      public double getValue()
      Specified by:
      getValue in class LazyWeight