(constraint relation polynomial)Construct a constraint, given a relation and a polynomial.
Construct a constraint, given a relation and a polynomial.
Representation of a linear constraint as an (in)equality
Representation of a linear constraint as an (in)equality
(polynomial this)Returns a LinearPolynomial representing the variables, coefficients and constant term of the (in)equality, when it is put in one of the forms:
a[0]x[0] + ... + a[n]x[n] + c = 0 a[0]x[0] + ... + a[n]x[n] + c <= 0 a[0]x[0] + ... + a[n]x[n] + c >= 0
Any linear (in)equality can be algebraically manipulated to this form without any loss of generality, and it is this form that is used to represent all linear constraints internally. See 'prolin.polynomial/subtract' for a function to help transform arbitrary (in)equalities to this format.
Returns a LinearPolynomial representing the variables, coefficients and constant term of the (in)equality, when it is put in one of the forms: a[0]x[0] + ... + a[n]x[n] + c = 0 a[0]x[0] + ... + a[n]x[n] + c <= 0 a[0]x[0] + ... + a[n]x[n] + c >= 0 Any linear (in)equality can be algebraically manipulated to this form without any loss of generality, and it is this form that is used to represent all linear constraints internally. See 'prolin.polynomial/subtract' for a function to help transform arbitrary (in)equalities to this format.
(relation this)Return one of '>=, '<=, or '=
Return one of '>=, '<=, or '=
(linear-polynomial constant variables)Construct a linear polynomial, given a constant and variables map
Construct a linear polynomial, given a constant and variables map
Representation of a linear polynomial (a polynomial of degree one). A linear polynomial consists of:
The keys representing variables can be any type that supports good equality semantics.
Representation of a linear polynomial (a polynomial of degree one). A linear polynomial consists of: - Any number of variables, each with a numerical coefficient - A constant numerical term The keys representing variables can be any type that supports good equality semantics.
(constant this)Returns the constant term of the polynomial
Returns the constant term of the polynomial
(variables this)Return a map of variable identifiers to coefficients.
Return a map of variable identifiers to coefficients.
An implementation of a linear programming solver
An implementation of a linear programming solver
(optimize this objective constraints minimize?)Maximize or minimize the given objective polynomial, subject to the provided set of LinearConstraints. Pass true as the third argument to minimize instead of maximize. Return a variables mapping representing the assignemtn of each variable present in the objective and constraints.
If there is no solution matching the constraints, throws an ex-info with a :reason key of :no-solution.
If the solution is unbounded by the provided constraints, throws an ex-info with a :reason key of :unbounded.
Maximize or minimize the given objective polynomial, subject to the provided set of LinearConstraints. Pass true as the third argument to minimize instead of maximize. Return a variables mapping representing the assignemtn of each variable present in the objective and constraints. If there is no solution matching the constraints, throws an ex-info with a :reason key of :no-solution. If the solution is unbounded by the provided constraints, throws an ex-info with a :reason key of :unbounded.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |