public class Linterm1
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable
A Linterm1 is a pair composed of a Coeff
coefficient
and a variable denoted by name.
It represents a single term in a Linexpr1
or
Lincons1
.
Modifier and Type | Field and Description |
---|---|
Coeff |
coeff
Variable coefficient.
|
Var |
var
Variable name.
|
Constructor and Description |
---|
Linterm1(Linterm1 t)
Creates a copy of the linear term.
|
Linterm1(java.lang.String v,
Coeff c) |
Linterm1(Var v,
Coeff c)
Creates a new linear term.
|
Modifier and Type | Method and Description |
---|---|
Linterm1 |
clone()
Returns a copy of this.
|
boolean |
equals(java.lang.Object x)
Whether x is a Linterm1 and structurally equal to this.
|
Coeff |
getCoefficient() |
Var |
getVariable() |
boolean |
isEqual(Linterm1 x)
Whether x and this are structurally equal.
|
void |
setCoeffcient(Coeff c) |
void |
setVariable(java.lang.String s) |
void |
setVariable(Var s) |
java.lang.String |
toString()
Returns a String representation of the linear term.
|
public Linterm1(java.lang.String v, Coeff c)
public Linterm1(Var v, Coeff c)
The coefficient is referenced, not copied.
public Linterm1(Linterm1 t)
The coefficient is copied.
public java.lang.String toString()
toString
in class java.lang.Object
public Linterm1 clone()
clone
in class java.lang.Object
public boolean isEqual(Linterm1 x)
public boolean equals(java.lang.Object x)
equals
in class java.lang.Object
public Var getVariable()
public Coeff getCoefficient()
public void setVariable(java.lang.String s)
public void setVariable(Var s)
public void setCoeffcient(Coeff c)