optimus.algebra
Type members
Classlikes
Binary operator expression (a operator b), that should be extended by any binary operator expression type.
Binary operator expression (a operator b), that should be extended by any binary operator expression type.
- Value parameters:
- a
left hand side expression
- b
right hand side expression
Constant expression holding a double value.
Constant expression holding a double value.
- Value parameters:
- value
the value held by the constraint
- Companion:
- object
Const product represents an expression multiplied by a constant and has the form of (c * a).
Const product represents an expression multiplied by a constant and has the form of (c * a).
- Value parameters:
- a
the expression
- scalar
the constant
A constraint has the form (expression RELATION expression). RELATION can be one of the {<=, =, >=}.
A constraint has the form (expression RELATION expression). RELATION can be one of the {<=, =, >=}.
- Value parameters:
- lhs
left hand side expression
- operator
relation operator
- rhs
right hand side expression
Expression abstraction, should be extended by anything that is an expression type.
Expression abstraction, should be extended by anything that is an expression type.
Minus operator for subtraction (a - b).
Minus operator for subtraction (a - b).
- Value parameters:
- a
left hand side expression
- b
right hand side expression
Plus operator for addition (a + b).
Plus operator for addition (a + b).
- Value parameters:
- a
left hand side expression
- b
right hand side expression
Product operator (a * b).
Product operator (a * b).
- Value parameters:
- a
left hand side expression
- b
right hand side expression
Term is holding a coefficient and all variables which are involved in the product of the term.
Term is holding a coefficient and all variables which are involved in the product of the term.
scalar * (var_1 * ... * var_n)
Abstract variable, should be extended by any variable type in order to inherit the algebraic properties.
Abstract variable, should be extended by any variable type in order to inherit the algebraic properties.
- Value parameters:
- symbol
the symbol of the variable
Value members
Concrete methods
Szudzik inverse pairing function. Uniquely decodes a natural number encoding into the pair of natural numbers that produced the encoding.
Szudzik inverse pairing function. Uniquely decodes a natural number encoding into the pair of natural numbers that produced the encoding.
- Value parameters:
- z
the number to decode
- Returns:
a vector holding the pair of numbers
- Note:
In case the encoding refers to a single variable the vector will contain only
Szudzik pairing function is a process for uniquely encoding a pair of natural numbers into a single natural number. It is used by algebra to encode variable products by ID and produce unique product IDs.
Szudzik pairing function is a process for uniquely encoding a pair of natural numbers into a single natural number. It is used by algebra to encode variable products by ID and produce unique product IDs.
- Value parameters:
- x
a variable ID
- Returns:
a unique ID in the space of encodings for a single variable ID
- Note:
This variant encodes a variable ID alone.
Szudzik pairing function is a process that uniquely encodes a pair of natural numbers into a single natural number. It is used by algebra to encode variable products by ID and produce unique product IDs.
Szudzik pairing function is a process that uniquely encodes a pair of natural numbers into a single natural number. It is used by algebra to encode variable products by ID and produce unique product IDs.
- Value parameters:
- x
a variable ID
- y
another variable ID
- Returns:
a unique ID in the space of encodings for x and y
Szudzik pairing function is a process for uniquely encoding a pair of natural numbers into a single natural number. It is used by algebra to encode variable products by ID and produce unique product IDs.
Szudzik pairing function is a process for uniquely encoding a pair of natural numbers into a single natural number. It is used by algebra to encode variable products by ID and produce unique product IDs.
- Value parameters:
- vars
a vector of variables
- Returns:
a unique ID in the space of encodings for the variables
- Note:
This variant encodes a vector of variables. The vector should contain a single variable or a pair of variables.