Liking cljdoc? Tell your friends :D

prolin.protocols


constraintclj

(constraint relation polynomial)

Construct a constraint, given a relation and a polynomial.

Construct a constraint, given a relation and a polynomial.
sourceraw docstring

Constraintcljprotocol

Representation of a linear constraint as an (in)equality

Representation of a linear constraint as an (in)equality

polynomialclj

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

relationclj

(relation this)

Return one of '>=, '<=, or '=

Return one of '>=, '<=, or '=
sourceraw docstring

linear-polynomialclj

(linear-polynomial constant variables)

Construct a linear polynomial, given a constant and variables map

Construct a linear polynomial, given a constant and variables map
sourceraw docstring

LinearPolynomialcljprotocol

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.

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.

constantclj

(constant this)

Returns the constant term of the polynomial

Returns the constant term of the polynomial

variablesclj

(variables this)

Return a map of variable identifiers to coefficients.

Return a map of variable identifiers to coefficients.
sourceraw docstring

Solvercljprotocol

An implementation of a linear programming solver

An implementation of a linear programming solver

optimizeclj

(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.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close