Packages

p

optimus

algebra

package algebra

Helper functions for summation of multiple expressions stored in iterable data structures and encoding/decoding of terms.

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

Type Members

  1. abstract class BinaryOp extends Expression

    Binary operator abstraction of the form (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(c: 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).

    c

    the constant

    a

    the expression

  4. class Constraint extends AnyRef

    A constraint has the form (expression RELATION expression) with RELATION in {<=, =, >=}

  5. abstract class Expression extends AnyRef

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

  6. case class Minus(a: Expression, b: Expression) extends BinaryOp with scala.Product with Serializable

    Binary operator for subtraction has the form (a - b).

    Binary operator for subtraction has the form (a - b).

    a

    the left hand side expression

    b

    the right had side expression

  7. case class Plus(a: Expression, b: Expression) extends BinaryOp with scala.Product with Serializable

    Binary operator for addition has the form (a + b).

    Binary operator for addition has the form (a + b).

    a

    the left hand side expression

    b

    the right had side expression

  8. case class Product(a: Expression, b: Expression) extends BinaryOp with scala.Product with Serializable

    Binary operator for multiplication has the form (a * b).

    Binary operator for multiplication has the form (a * b).

    a

    the left hand side expression

    b

    the right had side expression

  9. case class Term(coefficient: Const, variables: Vector[Variable]) 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.

    coefficient * (variable_1 * ... * variable_n)

  10. abstract class Variable extends Expression with Ordered[Variable]

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

Value Members

  1. implicit def Double2Const(value: Double): Const
  2. implicit def Int2Const(value: Int): Const
  3. def decode(z: Long): Vector[Int]

    Cantor inverse pairing function.

    Cantor inverse pairing function. Uniquely decodes a number into a sequence of natural numbers they produced it.

    z

    the number to decode

    returns

    a pair of numbers or one number if default value was used during encoding

  4. def encode(x: Int, y: Int = -1): Long

    Cantor pairing function.

    Cantor pairing function. A process to uniquely encode natural numbers into a single natural number.

    x

    the first number

    y

    the second number (default is -1 in case we want to encode only one)

    returns

    a unique number for x and y

  5. def sum[A, B, C, D](indexesA: Iterable[A], indexesB: Iterable[B], indexesC: Iterable[C], indexesD: Iterable[D])(f: (A, B, C, D) ⇒ Expression): Expression
  6. def sum[A, B, C](indexesA: Iterable[A], indexesB: Iterable[B], indexesC: Iterable[C])(f: (A, B, C) ⇒ Expression): Expression
  7. def sum[A, B](indexesA: Iterable[A], indexesB: Iterable[B])(f: (A, B) ⇒ Expression): Expression
  8. def sum[A](indexes: Iterable[A])(f: (A) ⇒ Expression): Expression
  9. def sum(expressions: Iterable[Expression]): Expression
  10. object Const
  11. object ConstraintRelation extends Enumeration

    Constraint relations (>= <= =).

  12. object ExpressionOrder extends Enumeration

    Expression order may be constant, linear, quadratic or higher order.

  13. object One extends Const with scala.Product with Serializable

    One is representing the special case of One constant.

  14. object Variable

    Object holding the anonymous constant for variables not having a specified symbol.

  15. object Zero extends Const with scala.Product with Serializable

    Zero is representing the special case of Zero constant.

Inherited from AnyRef

Inherited from Any

Ungrouped