|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
V
- the variable type.public interface LinearComb<V>
This interface is used to represent linear combinations. A linear combination is a type of polynomial.
Nested Class Summary | |
---|---|
static interface |
LinearComb.Term<V>
This interface is used to represent the terms of linear combinations. |
Method Summary | |
---|---|
LinearComb<V> |
add(double constant)
Adds, in the mathematical sense, the provided constant to this linear combination. |
LinearComb<V> |
add(LinearComb<? extends V> linComb)
Adds, in the mathematical sense, the provided linear combination to this linear combination. |
boolean |
equals(java.lang.Object obj)
Indicates if the provided object is equal to this linear combination. |
double |
getCoefficient(java.lang.Object variable)
Returns the coefficient of the term containing the provided variable. |
LinearComb.Term<V>[] |
getTermArray()
Returns the terms of this linear combination as an array. |
java.util.List<LinearComb.Term<V>> |
getTermList()
Returns the terms of this linear combination as list. |
double |
getZeroCutoff()
Returns the current zero cutoff. |
int |
hashCode()
Returns a content-based hash code for this linear combination. |
java.util.Iterator<LinearComb.Term<V>> |
iterator()
Returns an iterator over the terms of this linear combination. |
LinearComb<V> |
multiply(double constant)
Multiplies this linear combination by the provided constant. |
LinearComb<V> |
plugIn(java.util.Map<?,? extends LinearComb<? extends V>> linearCombs)
Plugs in the provided linear combinations to produce a new linear combination. |
LinearComb<V> |
plugIn(java.util.Map<?,java.lang.Double> numbers,
java.util.Map<?,? extends LinearComb<? extends V>> linearCombs)
Plugs in the provided numerical values and linear combinations to produce a new linear combination. |
LinearComb<V> |
plugIn(java.lang.Object variable,
double constant)
Assigns the value of the provided variable to the provided constant. |
LinearComb<V> |
plugIn(java.lang.Object variable,
LinearComb<? extends V> expr)
Assigns the value of the provided variable to the provided linear combination. |
LinearComb<V> |
plugInNumbers(java.util.Map<?,java.lang.Double> numbers)
Plugs in the provided numerical values to produce a new linear combination. |
LinearComb<V> |
solveFor(java.lang.Object variable,
double constant)
Equates this linear combination to the provided constant and solves for the provided variable. |
java.lang.String |
toString()
Returns an appropriate string representation of this linear combination. |
Methods inherited from interface sbrt.kernel.math.Polynomial |
---|
getConstant, terms |
Methods inherited from interface sbrt.kernel.math.MathExpr |
---|
getVariables, hasAllVariables, hasVariable, hasVariables, variables |
Method Detail |
---|
double getZeroCutoff()
The zero cutoff is a value used to decide if coefficients are close enough to zero to be considered equal to zero. In other words, the absolute value of the coefficient of every term of this linear combination will always be greater than the zero cutoff.
double getCoefficient(java.lang.Object variable)
variable
- the variable whose corresponding coefficient is to be
returned.
LinearComb<V> add(LinearComb<? extends V> linComb)
linComb
- the linear combination with which to add.
LinearComb<V> add(double constant)
constant
- the constant with which to add.
LinearComb<V> multiply(double constant)
constant
- the constant with which to multiply this linear
combination.
LinearComb<V> solveFor(java.lang.Object variable, double constant)
variable
- the variable in this linear combination for which to
solve.constant
- the constant with which this linear combination is
equated.
LinearComb<V> plugIn(java.lang.Object variable, LinearComb<? extends V> expr)
variable
- the variable in this linear combination whose value
will be assigned the provided linear combination.expr
- the linear combination to be "plugged in".
LinearComb<V> plugIn(java.lang.Object variable, double constant)
variable
- the variable in this linear combination whose value
will be assigned the provided constant.constant
- the value to be "plugged in".
LinearComb<V> plugInNumbers(java.util.Map<?,java.lang.Double> numbers)
If some of the keys in the provided map are not variables in this expression, their provided value is simply ignored. If a value is provided for each variable in this linear combination, the resulting expression will not contain any variables of its own, only a constant.
plugInNumbers
in interface MathExpr<V>
plugInNumbers
in interface Polynomial<V>
numbers
- objects mapped to numerical values.
LinearComb<V> plugIn(java.util.Map<?,? extends LinearComb<? extends V>> linearCombs)
If some of the keys in the provided map are not variables in this expression, their provided value is simply ignored.
linearCombs
- objects mapped to linear combinations.
LinearComb<V> plugIn(java.util.Map<?,java.lang.Double> numbers, java.util.Map<?,? extends LinearComb<? extends V>> linearCombs)
If some of the keys in either of the provided maps are not variables in this expression, their provided values are simply ignored.
numbers
- objects mapped to numerical values.linearCombs
- objects mapped to linear combinations.
plugIn(Map)
,
plugInNumbers(Map)
java.util.List<LinearComb.Term<V>> getTermList()
LinearComb.Term<V>[] getTermArray()
getTermArray
in interface Polynomial<V>
java.util.Iterator<LinearComb.Term<V>> iterator()
iterator
in interface java.lang.Iterable<LinearComb.Term<V>>
int hashCode()
hashCode
in interface MathExpr<V>
hashCode
in interface Polynomial<V>
hashCode
in class java.lang.Object
boolean equals(java.lang.Object obj)
For two linear combinations to be equal, they must contain the same numerical constant and terms.
equals
in interface MathExpr<V>
equals
in interface Polynomial<V>
equals
in class java.lang.Object
obj
- the object to be tested for equality with
this linear combination.
true
if this linear combination equals the provided
object; false
otherwise.Polynomial.Term.equals(Object)
java.lang.String toString()
toString
in interface MathExpr<V>
toString
in interface Polynomial<V>
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |