Dantzig.Constraint (Danztig v0.2.0)

View Source

TODO

Summary

Functions

Tests whether the coonstraint depends on a given variable. Similar to Dantzig.Polynomial.depends_on?/2.

Create new (normalized) constraint. Doesn't make sure the constraint is linear.

Create new (normalized) linear constraint. Will raise an error if the constraint is not linear.

Tests whether the coonstraint depends on a given variable. Similar to Dantzig.Polynomial.depends_on?/2.

Types

t()

@type t() :: %Dantzig.Constraint{
  left_hand_side: term(),
  metadata: term(),
  name: term(),
  operator: term(),
  right_hand_side: term()
}

Functions

depends_on?(constraint, variable_name)

Tests whether the coonstraint depends on a given variable. Similar to Dantzig.Polynomial.depends_on?/2.

get_variables_by(constraint, fun)

new(comparison, opts \\ [])

(macro)

new(left, operator, right, opts \\ [])

Create new (normalized) constraint. Doesn't make sure the constraint is linear.

Expects 3 required arguments:

  • left: a polynomial or number for the left hand side
  • operator: one of :==, :>= or :<=
  • right: a polynomial or number for the right hand side

Expects the following optional keyword arguments:

  • :name: the name for the constraint

new_linear(comparison, opts \\ [])

(macro)

new_linear(left, operator, right, opts \\ [])

Create new (normalized) linear constraint. Will raise an error if the constraint is not linear.

Expects 3 required arguments:

  • left: a polynomial or number for the left hand side
  • operator: one of :==, :>= or :<=
  • right: a polynomial or number for the right hand side

Expects the following optional keyword arguments:

  • :name: the name for the constraint

solve_for_variable(constraint, variable)

@spec solve_for_variable(t(), ProblemVariable.variable_name()) ::
  Dantzig.SolvedConstraint.t()

Tests whether the coonstraint depends on a given variable. Similar to Dantzig.Polynomial.depends_on?/2.