Struct totsu_core::solver::Solver

source ·
pub struct Solver<L: LinAlg> {
    pub par: SolverParam<L::F>,
}
Expand description

First-order conic linear program solver struct.

This struct abstracts a solver of a conic linear program: \[ \begin{array}{ll} {\rm minimize} & c^T x \\ {\rm subject \ to} & A x + s = b \\ & s \in \mathcal{K}, \end{array} \] where

  • variables \( x \in \mathbb{R}^n,\ s \in \mathbb{R}^m \)
  • \( c \in \mathbb{R}^n \) as an objective linear operator
  • \( A \in \mathbb{R}^{m \times n} \) and \( b \in \mathbb{R}^m \) as constraint linear operators
  • a nonempty, closed, convex cone \( \mathcal{K} \).

The solution gives optimal values of primal variables \(x\) as well as dual variables \(y\) of the dual problem: \[ \begin{array}{ll} {\rm maximize} & -b^T y \\ {\rm subject \ to} & -A^T y = c \\ & y \in \mathcal{K}^*, \end{array} \] where

  • variables \( y \in \mathbb{R}^m \)
  • \( \mathcal{K}^* \) is the dual cone of \( \mathcal{K} \).

Fields§

§par: SolverParam<L::F>

solver parameters.

Implementations§

Query of a length of work slice.

Returns a length of work slice that Solver::solve requires.

  • op_a_size is a number of rows and columns of \(A\).

Creates an instance.

Returns Solver instance.

Changes solver parameters.

Returns Solver with its parameters changed.

  • f is a function to change parameters given by its argument.

Starts to solve a conic linear program.

Returns Ok with a tuple of optimal \(x, y\) or Err with SolverError type.

  • op_c is \(c\) as a linear Operator.
  • op_a is \(A\) as a linear Operator.
  • op_b is \(b\) as a linear Operator.
  • cone is \(\mathcal{K}\) expressed by Cone.
  • work slice is used for temporal variables. Solver::solve does not rely on dynamic heap allocation.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.