ProbLP

Struct ProbLP 

Source
pub struct ProbLP<L: LinAlgEx> { /* private fields */ }
Expand description

Linear program

The problem is \[ \begin{array}{ll} {\rm minimize} & c^Tx + d \\ {\rm subject \ to} & G x \preceq h \\ & A x = b, \end{array} \] where

  • variables \( x \in \mathbb{R}^n \)
  • \( c \in \mathbb{R}^n,\ d \in \mathbb{R} \)
  • \( G \in \mathbb{R}^{m \times n},\ h \in \mathbb{R}^m \)
  • \( A \in \mathbb{R}^{p \times n},\ b \in \mathbb{R}^p \).

In the following, \( d \) does not appear since it does not matter.

The representation as a conic linear program is as follows: \[ \begin{array}{ll} {\rm minimize} & c^Tx \\ {\rm subject \ to} & \left[ \begin{array}{c} G \\ A \end{array} \right] x + s = \left[ \begin{array}{c} h \\ b \end{array} \right] \\ & s \in \mathbb{R}_+^m \times \lbrace 0 \rbrace^n. \end{array} \]

Implementations§

Source§

impl<L: LinAlgEx> ProbLP<L>

Source

pub fn new( vec_c: MatBuild<L>, mat_g: MatBuild<L>, vec_h: MatBuild<L>, mat_a: MatBuild<L>, vec_b: MatBuild<L>, ) -> Self

Creates a LP with given data.

Returns the ProbLP instance.

  • vec_c is \(c\).
  • mat_g is \(G\).
  • vec_h is \(h\).
  • mat_a is \(A\).
  • vec_b is \(b\).
Source

pub fn problem( &mut self, ) -> (ProbLPOpC<'_, L>, ProbLPOpA<'_, L>, ProbLPOpB<'_, L>, ProbLPCone<L>, &mut [L::F])

Generates the problem data structures to be fed to Solver::solve.

Returns a tuple of operators, a cone and a work slice.

Auto Trait Implementations§

§

impl<L> Freeze for ProbLP<L>

§

impl<L> RefUnwindSafe for ProbLP<L>
where <L as LinAlg>::F: RefUnwindSafe,

§

impl<L> Send for ProbLP<L>
where <L as LinAlg>::F: Send,

§

impl<L> Sync for ProbLP<L>
where <L as LinAlg>::F: Sync,

§

impl<L> Unpin for ProbLP<L>
where <L as LinAlg>::F: Unpin,

§

impl<L> UnwindSafe for ProbLP<L>
where <L as LinAlg>::F: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.