Package it.univr.di.labeledvalue.lazy
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
-
Nested Class Summary
Nested classes/interfaces inherited from class it.univr.di.labeledvalue.lazy.LazyWeight
LazyWeight.SubType
-
Constructor Summary
Constructors Constructor Description LazyPiece(org.apache.commons.math3.fraction.Fraction x1, int m1, int c1, boolean onlyIfNeg1)
-
Method Summary
Methods inherited from class it.univr.di.labeledvalue.lazy.LazyWeight
equals, formatLazy, getType, hashCode, max, sum, sumWithOverflowCheck
-
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
- Overrides:
toString
in classLazyWeight
-
isOnlyIfNeg
public boolean isOnlyIfNeg()- Returns:
- the onlyIfNeg
-
getX
public org.apache.commons.math3.fraction.Fraction getX()- Specified by:
getX
in classLazyWeight
- 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 classLazyWeight
-
getValue
public double getValue()- Specified by:
getValue
in classLazyWeight
-