p

optimus

# algebra

#### packagealgebra

Linear Supertypes
AnyRef, Any
Ordering
1. Alphabetic
2. By Inheritance
Inherited
1. algebra
2. AnyRef
3. Any
1. Hide All
2. Show All
Visibility
1. Public
2. Protected

### Type Members

1. abstract class BinaryOp extends Expression

Binary operator expression (a operator b), that should be extended by any binary operator expression type.

2. class Const extends Expression

Constant expression holding a double value.

3. case class ConstProduct(scalar: Const, ) extends Expression with scala.Product with Serializable

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).

scalar

the constant

a

the expression

4. case class Constraint(lhs: Expression, operator: ConstraintRelation, rhs: Expression) extends scala.Product with Serializable

A constraint has the form (expression RELATION expression).

A constraint has the form (expression RELATION expression). RELATION can be one of the {<=, =, >=}.

lhs

left hand side expression

operator

relation operator

rhs

right hand side expression

5. sealed abstract class ConstraintRelation extends EnumEntry
6. type DecodedIds = Vector[Int]
7. abstract class Expression extends LazyLogging

Expression abstraction, should be extended by anything that is an expression type.

8. sealed trait ExpressionType extends EnumEntry
9. type LongDoubleMap = TLongDoubleHashMap
10. case class Minus(, ) extends BinaryOp with scala.Product with Serializable

Minus operator for subtraction (a - b).

Minus operator for subtraction (a - b).

a

left hand side expression

b

right hand side expression

11. case class Plus(, ) extends BinaryOp with scala.Product with Serializable

Plus operator for addition (a + b).

Plus operator for addition (a + b).

a

left hand side expression

b

right hand side expression

12. case class Product(, ) extends BinaryOp with scala.Product with Serializable

Product operator (a * b).

Product operator (a * b).

a

left hand side expression

b

right hand side expression

13. case class Term(scalar: Const, vars: Vector[Var]) extends Expression with scala.Product with Serializable

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)

14. type UniqueId = Long
15. abstract class Var extends Expression

Abstract variable, should be extended by any variable type in order to inherit the algebraic properties.

### Value Members

1. final val ANONYMOUS: String("")
2. implicit def Double2Const(value: Double)
3. implicit def Int2Const(value: Int)
4. implicit def Long2Const(value: Long)
5. def decode(z: UniqueId)

Szudzik inverse pairing function.

Szudzik inverse pairing function. Uniquely decodes a natural number encoding into the pair of natural numbers that produced the encoding.

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

6. def encode(vars: Vector[Var])

Szudzik pairing function is a process for uniquely encoding a pair of natural numbers into a single natural number.

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.

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.

7. def encode(x: Long, y: Long)

Szudzik pairing function is a process that uniquely encodes a pair of natural numbers into a single natural number.

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.

x

a variable ID

y

another variable ID

returns

a unique ID in the space of encodings for x and y

8. def encode(x: Long)

Szudzik pairing function is a process for uniquely encoding a pair of natural numbers into a single natural number.

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.

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.

9. object AlgebraOps
10. object Const
11. object ConstraintRelation extends Enum[ConstraintRelation]
12. object ExpressionType extends Enum[ExpressionType]
13. case object One extends Const with scala.Product with Serializable
14. case object Zero extends Const with scala.Product with Serializable