public class Linterm0
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable
A Linterm0 is a pair composed of a Coeff
coefficient
and a variable denoted by dimension (i.e., integer starting
from 0).
It represents a single term in a Linexpr0
or
Lincons0
.
Modifier and Type | Field and Description |
---|---|
Coeff |
coeff
Variable coefficient.
|
int |
dim
Dimension index (positive).
|
Constructor and Description |
---|
Linterm0(int d,
Coeff c)
Creates a new linear term.
|
Linterm0(Linterm0 t)
Creates a copy of the linear term.
|
Modifier and Type | Method and Description |
---|---|
Linterm0 |
clone()
Returns a copy of this.
|
boolean |
equals(java.lang.Object x)
Whether x is a Linterm0 and structurally equal to this.
|
Coeff |
getCoefficient() |
int |
getDimension() |
boolean |
isEqual(Linterm0 x)
Whether x and this are structurally equal.
|
void |
setCoeffcient(Coeff c) |
void |
setDimension(int d) |
java.lang.String |
toString()
Returns a String representation of the linear term.
|
java.lang.String |
toString(java.lang.String[] names) |
java.lang.String |
toString(Var[] names)
Returns a String representation of the linear term.
|
public int dim
public Coeff coeff
public Linterm0(int d, Coeff c)
The coefficient is referenced, not copied.
public Linterm0(Linterm0 t)
The coefficient is copied.
public java.lang.String toString(Var[] names)
Dimension i is denoted by names[i].
public java.lang.String toString(java.lang.String[] names)
public java.lang.String toString()
Dimension i is denoted as xi.
toString
in class java.lang.Object
public Linterm0 clone()
clone
in class java.lang.Object
public boolean isEqual(Linterm0 x)
public boolean equals(java.lang.Object x)
equals
in class java.lang.Object
public int getDimension()
public Coeff getCoefficient()
public void setDimension(int d)
public void setCoeffcient(Coeff c)