package algebra
- Alphabetic
- By Inheritance
- algebra
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- abstract class BinaryOp extends Expression
Binary operator expression (a operator b), that should be extended by any binary operator expression type.
- class Const extends Expression
Constant expression holding a double value.
- case class ConstProduct(scalar: Const, a: Expression) 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
- 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
- sealed abstract class ConstraintRelation extends EnumEntry
- type DecodedIds = Vector[Int]
- abstract class Expression extends LazyLogging
Expression abstraction, should be extended by anything that is an expression type.
- sealed trait ExpressionType extends EnumEntry
- type LongDoubleMap = TLongDoubleHashMap
- case class Minus(a: Expression, b: Expression) 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
- case class Plus(a: Expression, b: Expression) 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
- case class Product(a: Expression, b: Expression) 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
- 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)
- type UniqueId = Long
- abstract class Var extends Expression
Abstract variable, should be extended by any variable type in order to inherit the algebraic properties.
Value Members
- final val ANONYMOUS: String("")
- implicit def Double2Const(value: Double): Const
- implicit def Int2Const(value: Int): Const
- implicit def Long2Const(value: Long): Const
- def decode(z: UniqueId): DecodedIds
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
- def encode(vars: Vector[Var]): UniqueId
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.
- def encode(x: Long, y: Long): UniqueId
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
- def encode(x: Long): UniqueId
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.
- object AlgebraOps
- object Const
- object ConstraintRelation extends Enum[ConstraintRelation]
- object ExpressionType extends Enum[ExpressionType]
- case object One extends Const with scala.Product with Serializable
- case object Zero extends Const with scala.Product with Serializable