Term Class

A linear mathematical term in the form of 'Sca · Var'. For instance:
  • C#
    2 * totalCost
    is a term where totalCost is of type VarD0.
  • C#
    cost[i, j] * x[i, j]
    is a term where cost is of type ParD2 and x is of type VarD2. Note that, given i and j are Sets; x[i, j] is a Var and cost[i, j] is a Sca.
  • C#
    2 * cost[i, j] / (1 + demand[i]) * y[j]
    is also a term. The scalar; i.e., the coefficient can be expressed as mathematical operations. Note that the order is not strict as long as linearity is satisfied. Above term for instance could also be expressed as:
    C#
    2 * cost[i, j] * y[j] / (1 + demand[i])

Definition

Namespace: Orx.MathProg
Assembly: Orx.MathProg (in Orx.MathProg.dll) Version: 1.0.0
C#
public class Term
Inheritance
Object    Term

Methods

Equals Compares this to obj wrt reference equality.
(Overrides ObjectEquals(Object))
Finalize
(Inherited from Object)
GetHashCode Returns the hash code.
(Overrides ObjectGetHashCode)
GetType
(Inherited from Object)
MemberwiseClone
(Inherited from Object)
ToString
(Inherited from Object)

Operators

Addition(Sca, Term) Adds a term and a scalar; and returns the resulting linear expression.
Addition(Term, Sca) Adds a term and a scalar; and returns the resulting linear expression.
Addition(Term, Term) Adds two terms; and returns the resulting linear expression.
Addition(Term, Var) Adds a term and a variable; and returns the resulting linear expression.
Addition(Term, VarD0) Adds a term and a variable; and returns the resulting linear expression.
Addition(Var, Term) Adds a term and a variable; and returns the resulting linear expression.
Addition(VarD0, Term) Adds a term and a variable; and returns the resulting linear expression.
Division(Term, Sca) Divides a term by a scalar and returns the resulting linear term.
Equality(Sca, Term) Creates a constraint expression where lhs = rhs.

Note that a constraint is composed of a constraint expression and forall sets expression.

C#
ConstraintExpr expr =                required[i, j] == density * x[i, j];
Constraint     con  = forall(i, j) | required[i, j] == density * x[i, j];
Equality(Term, Sca) Creates a constraint expression where lhs = rhs.

Note that a constraint is composed of a constraint expression and forall sets expression.

C#
ConstraintExpr expr =                density * x[i, j] == required[i, j];
Constraint     con  = forall(i, j) | density * x[i, j] == required[i, j];
Equality(Term, Term) Creates a constraint expression where lhs = rhs.

Note that a constraint is composed of a constraint expression and forall sets expression.

C#
ConstraintExpr expr =                flowInM3[i, j] == density * x[i, j];
Constraint     con  = forall(i, j) | flowInM3[i, j] == density * x[i, j];
Equality(Term, Var) Creates a constraint expression where lhs = rhs.

Note that a constraint is composed of a constraint expression and forall sets expression.

C#
ConstraintExpr expr =                density * x[i, j] == assignedDemand;
Constraint     con  = forall(i, j) | density * x[i, j] == assignedDemand;
Equality(Term, VarD0) Creates a constraint expression where lhs = rhs.

Note that a constraint is composed of a constraint expression and forall sets expression.

C#
ConstraintExpr expr =                density * x[i, j] == assignedDemand;
Constraint     con  = forall(i, j) | density * x[i, j] == assignedDemand;
Equality(Var, Term) Creates a constraint expression where lhs = rhs.

Note that a constraint is composed of a constraint expression and forall sets expression.

C#
ConstraintExpr expr =                density * x[i, j] == assignedDemand;
Constraint     con  = forall(i, j) | density * x[i, j] == assignedDemand;
Equality(VarD0, Term) Creates a constraint expression where lhs = rhs.

Note that a constraint is composed of a constraint expression and forall sets expression.

C#
ConstraintExpr expr =                density * x[i, j] == assignedDemand;
Constraint     con  = forall(i, j) | density * x[i, j] == assignedDemand;
GreaterThanOrEqual(Sca, Term) Creates a constraint expression where lhs >= rhs.

Note that a constraint is composed of a constraint expression and forall sets expression.

C#
ConstraintExpr expr =                capacity[i, j] >= density * x[i, j];
Constraint     con  = forall(i, j) | capacity[i, j] >= density * x[i, j];
GreaterThanOrEqual(Term, Sca) Creates a constraint expression where lhs >= rhs.

Note that a constraint is composed of a constraint expression and forall sets expression.

C#
ConstraintExpr expr =                density * x[i, j] >= required[i, j];
Constraint     con  = forall(i, j) | density * x[i, j] >= required[i, j];
GreaterThanOrEqual(Term, Term) Creates a constraint expression where lhs >= rhs.

Note that a constraint is composed of a constraint expression and forall sets expression.

C#
ConstraintExpr expr =                M * y[i] >= density * x[i, j];
Constraint     con  = forall(i, j) | M * y[i] >= density * x[i, j];
GreaterThanOrEqual(Term, Var) Creates a constraint expression where lhs >= rhs.

Note that a constraint is composed of a constraint expression and forall sets expression.

C#
ConstraintExpr expr =                density * x[i, j] >= assignedDemand;
Constraint     con  = forall(i, j) | density * x[i, j] >= assignedDemand;
GreaterThanOrEqual(Term, VarD0) Creates a constraint expression where lhs >= rhs.

Note that a constraint is composed of a constraint expression and forall sets expression.

C#
ConstraintExpr expr =                density * x[i, j] >= assignedDemand;
Constraint     con  = forall(i, j) | density * x[i, j] >= assignedDemand;
GreaterThanOrEqual(Var, Term) Creates a constraint expression where lhs >= rhs.

Note that a constraint is composed of a constraint expression and forall sets expression.

C#
ConstraintExpr expr =                density * x[i, j] >= assignedDemand;
Constraint     con  = forall(i, j) | density * x[i, j] >= assignedDemand;
GreaterThanOrEqual(VarD0, Term) Creates a constraint expression where lhs >= rhs.

Note that a constraint is composed of a constraint expression and forall sets expression.

C#
ConstraintExpr expr =                density * x[i, j] >= assignedDemand;
Constraint     con  = forall(i, j) | density * x[i, j] >= assignedDemand;
(Var to Term) Implicit conversion of a variable to a linear term where the coefficient is 1.
(VarD0 to Term) Implicit conversion of a variable to a linear term where the coefficient is 1.
Inequality(Sca, Term) Invalid operation; throws an exception.
Inequality(Term, Sca) Invalid operation; throws an exception.
Inequality(Term, Term) Invalid operation; throws an exception.
Inequality(Term, Var) Invalid operation; throws an exception.
Inequality(Term, VarD0) Invalid operation; throws an exception.
Inequality(Var, Term) Invalid operation; throws an exception.
Inequality(VarD0, Term) Invalid operation; throws an exception.
LessThanOrEqual(Sca, Term) Creates a constraint expression where lhs <= rhs.

Note that a constraint is composed of a constraint expression and forall sets expression.

C#
ConstraintExpr expr =                required[i, j] <= density * x[i, j];
Constraint     con  = forall(i, j) | required[i, j] <= density * x[i, j];
LessThanOrEqual(Term, Sca) Creates a constraint expression where lhs <= rhs.

Note that a constraint is composed of a constraint expression and forall sets expression.

C#
ConstraintExpr expr =                density * x[i, j] <= capacity[i, j];
Constraint     con  = forall(i, j) | density * x[i, j] <= capacity[i, j];
LessThanOrEqual(Term, Term) Creates a constraint expression where lhs <= rhs.

Note that a constraint is composed of a constraint expression and forall sets expression.

C#
ConstraintExpr expr =                density * x[i, j] <= M * y[i];
Constraint     con  = forall(i, j) | density * x[i, j] <= M * y[i];
LessThanOrEqual(Term, Var) Creates a constraint expression where lhs <= rhs.

Note that a constraint is composed of a constraint expression and forall sets expression.

C#
ConstraintExpr expr =                density * x[i, j] <= assignedCapacity;
Constraint     con  = forall(i, j) | density * x[i, j] <= assignedCapacity;
LessThanOrEqual(Term, VarD0) Creates a constraint expression where lhs <= rhs.

Note that a constraint is composed of a constraint expression and forall sets expression.

C#
ConstraintExpr expr =                density * x[i, j] <= assignedCapacity;
Constraint     con  = forall(i, j) | density * x[i, j] <= assignedCapacity;
LessThanOrEqual(Var, Term) Creates a constraint expression where lhs <= rhs.

Note that a constraint is composed of a constraint expression and forall sets expression.

C#
ConstraintExpr expr =                density * x[i, j] <= assignedCapacity;
Constraint     con  = forall(i, j) | density * x[i, j] <= assignedCapacity;
LessThanOrEqual(VarD0, Term) Creates a constraint expression where lhs <= rhs.

Note that a constraint is composed of a constraint expression and forall sets expression.

C#
ConstraintExpr expr =                density * x[i, j] <= assignedCapacity;
Constraint     con  = forall(i, j) | density * x[i, j] <= assignedCapacity;
Multiply(Sca, Term) Multiplies a scalar with a term and returns the resulting linear term.
Multiply(Term, Sca) Multiplies a scalar with a term and returns the resulting linear term.
Subtraction(Sca, Term) Substracts a term from a scalar; and returns the resulting linear expression.
Subtraction(Term, Sca) Substracts a scalar from a term; and returns the resulting linear expression.
Subtraction(Term, Term) Substracts one term from another; and returns the resulting linear expression.
Subtraction(Term, Var) Substracts a variable from a term; and returns the resulting linear expression.
Subtraction(Term, VarD0) Substracts a variable from a term; and returns the resulting linear expression.
Subtraction(Var, Term) Substracts a term from a variable; and returns the resulting linear expression.
Subtraction(VarD0, Term) Substracts a term from a variable; and returns the resulting linear expression.
UnaryNegation(Term) Negates the term; i.e., negates the coefficient of the term.

See Also