net.sourceforge.combean.mathprog.grooml
Class GTerm

An single, linear term in the model. Consists of - a double coefficient, - a variable name and - an abstract index (which may be any type) The mapping of the abstract index to an integer index in a concrete LP model happens later when the expression, to which the term belongs is bound to a concrete LP model with well-defined variables. These variables then do this mapping.

Field Summary
 double coeff
           
 Object idx
           
 String var
           
 
Constructor Summary
GTerm(String var, Object idx, double coeff)
            Constructor of such values)
 
Method Summary
GTerm clone()
          
double doubleValue()
          
Object index()
          
static GTerm parseTerm(String term)
           Parse a String that defines a term.
GTerm scale(Number factor)
          
void setIndex(Object idx)
          
String toString()
          
 

Constructor Detail

GTerm

public GTerm(String var, Object idx, double coeff)
Constructor
params:
var name of the variable in the term
params:
idx variable index (may be a single string or integer or a tuple
of such values)
params:
coeff linear coefficient of the term


Method Detail

clone

public GTerm clone()


doubleValue

public double doubleValue()


index

public Object index()


parseTerm

public static GTerm parseTerm(String term)
Parse a String that defines a term. The term has the following format: *? [ ] The index may be - a single string or a single number - a list of strings or a list of numbers
todo:
add support for simple variables (no index brackets required)


scale

public GTerm scale(Number factor)


setIndex

public void setIndex(Object idx)


toString

public String toString()