|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfuzzydl.milp.Expression
public class Expression
Linear expression of the form c + c1 * x1 + c2 * x2 + ... + cN * xN
| Constructor Summary | |
|---|---|
Expression()
|
|
Expression(double constant)
|
|
Expression(double constant,
Term... terms)
|
|
Expression(Expression expr)
Copy constructor. |
|
Expression(Term... terms)
|
|
| Method Summary | |
|---|---|
static Expression |
addConstant(Expression expr,
java.lang.Double constant)
Adds a double constant to an expression. |
static Expression |
addExpressions(Expression expr1,
Expression expr2)
Adds two expressions. |
static Expression |
addTerm(Expression expr,
Term term)
Adds a term to an expression. |
void |
addTerm(Term term)
Adds a term to an expression. |
Expression |
clone()
|
void |
computeVariables()
Creates a table with variables of the terms and their coefficients. |
double |
getConstant()
Gets the constant of the expression. |
double |
getConstantTerm(Variable var)
Given a variable, gets its coefficient in the expression. |
double |
getSolutionValue()
Gets a numerical solution to the expression. |
java.util.List<Term> |
getTerms()
Gets the terms of the expression. |
static Expression |
multiplyConstant(Expression expr,
java.lang.Double constant)
Multiplies a double constant and an expression. |
static Expression |
negateExpression(Expression expr)
Changes the sign of all the elements of an expression. |
static Expression |
subtractExpressions(Expression expr1,
Expression expr2)
Substracts two expressions. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Expression()
public Expression(double constant)
constant - Coefficient c.
public Expression(double constant,
Term... terms)
constant - Coefficient c.terms - List of terms(ci,xi).public Expression(Term... terms)
terms - List of terms(ci,xi).public Expression(Expression expr)
expr - An expression.| Method Detail |
|---|
public Expression clone()
clone in class java.lang.Objectpublic java.util.List<Term> getTerms()
public double getConstant()
public static Expression negateExpression(Expression expr)
expr - An expression.
public static Expression addConstant(Expression expr,
java.lang.Double constant)
expr - An expression.constant - A double constant.
public void addTerm(Term term)
term - A term.
public static Expression addTerm(Expression expr,
Term term)
expr - An expression.term - A term.
public static Expression addExpressions(Expression expr1,
Expression expr2)
expr1 - An expression.expr2 - Another expression.
public static Expression subtractExpressions(Expression expr1,
Expression expr2)
expr1 - First expression.expr2 - Second expression.
public static Expression multiplyConstant(Expression expr,
java.lang.Double constant)
expr - An expression.constant - A double constant.
public void computeVariables()
public double getConstantTerm(Variable var)
var - A variable.
public double getSolutionValue()
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||