net.sourceforge.combean.mathprog.grooml
Class GModelArithmeticCategory

A category that defines several operators for the convenient construction of LP models

 
Constructor Summary
GModelArithmeticCategory()
           
 
Method Summary
static GRow leftShift(GExpression self, Number rhs)
           Operator '<<' for defining an LP row from an expression and a value for the rhs of the row.
static GSet multiply(Map self, def other)
           Operator '*' for multiplying sets.
static GSet multiply(List self, def other)
          
static GExpression multiply(Number factor, GSimpleExpression expr)
           Operator '*' for scaling terms in expressions
static GRow or(GExpression self, Number rhs)
           Operator '|' for defining an LP row from an expression and a value for the rhs of the row.
static GRow or(String self, Number rhs)
          
static GExpression plus(GExpression self, def other)
           Operator '+' for adding expressions
static GExpression plus(String self, GExpression other)
          
static GExpression plus(GString self, GExpression other)
          
static GRow rightShift(GExpression self, Number rhs)
           Operator '>>' for defining an LP row from an expression and a value for the rhs of the row.
 

Constructor Detail

GModelArithmeticCategory

GModelArithmeticCategory()


Method Detail

leftShift

public static GRow leftShift(GExpression self, Number rhs)
Operator '<<' for defining an LP row from an expression and a value for the rhs of the row. Please note that the resulting row is anonymous, i.e., the name of the row has to be set explicitly at a later point in time.
params:
self the expression on the lhs of the row.
params:
rhs the value on the rhs of the row.
returns:
an anonymous row with the given expression on the lhs and the
constraint '<= given rhs value'


multiply

public static GSet multiply(Map self, def other)
Operator '*' for multiplying sets.
params:
self a set or a List (which is converted to a set)
params:
other a set or an object that can be converted to a set
returns:
the product set of the two given sets.


multiply

public static GSet multiply(List self, def other)


multiply

public static GExpression multiply(Number factor, GSimpleExpression expr)
Operator '*' for scaling terms in expressions


or

public static GRow or(GExpression self, Number rhs)
Operator '|' for defining an LP row from an expression and a value for the rhs of the row. Please note that the resulting row is anonymous, i.e., the name of the row has to be set explicitly at a later point in time. Unfortunately, overriding operator '==' (which would be more natural in that case) is not possible, since overriding the compareTo method also has effects on other operators, namely '<=, '>=', etc..
params:
self the expression on the lhs of the row.
params:
rhs the value on the rhs of the row.
returns:
an anonymous row with the given expression on the lhs and the
constraint '= given rhs value'
todo:
add support for an additional operator '|' to set the name
of a row.


or

public static GRow or(String self, Number rhs)


plus

public static GExpression plus(GExpression self, def other)
Operator '+' for adding expressions
params:
self an expression or a String (which is converted to an expression)
params:
other an object that can be converted to an expression
returns:
the combined expression of the two given expression


plus

public static GExpression plus(String self, GExpression other)


plus

public static GExpression plus(GString self, GExpression other)


rightShift

public static GRow rightShift(GExpression self, Number rhs)
Operator '>>' for defining an LP row from an expression and a value for the rhs of the row. Please note that the resulting row is anonymous, i.e., the name of the row has to be set explicitly at a later point in time.
params:
self the expression on the lhs of the row.
params:
rhs the value on the rhs of the row.
returns:
an anonymous row with the given expression on the lhs and the
constraint '>= given rhs value'