[−][src]Struct totsu::pdipm::PDIPM
A basic Primal-Dual Interior-Point Method solver struct.
This struct abstracts a solver of continuous scalar convex optimization problem: \[ \begin{array}{ll} {\rm minimize} & f_{\rm obj}(x) \\ {\rm subject \ to} & f_i(x) \le 0 \quad (i = 0, \ldots, m - 1) \\ & A x = b, \end{array} \] where
- variables \( x \in {\bf R}^n \)
- \( f_{\rm obj}: {\bf R}^n \rightarrow {\bf R} \), convex and twice differentiable
- \( f_i: {\bf R}^n \rightarrow {\bf R} \), convex and twice differentiable
- \( A \in {\bf R}^{p \times n} \), \( {\bf rank} A = p < n \), \( b \in {\bf R}^p \).
The solution gives optimal values of primal variables \(x\) as well as dual variables \(\lambda \in {\bf R}^m\) and \(\nu \in {\bf R}^p\).
Fields
eps: FP
Tolerance of the surrogate duality gap. Tolerance of the primal and dual residuals.
mu: FP
The factor to squeeze complementary slackness.
alpha: FP
The factor to decrease residuals in the backtracking line search.
beta: FP
The factor to decrease a step size in the backtracking line search.
s_coef: FP
The factor to determine an initial step size in the backtracking line search.
margin: FP
Initial margin value for dual variables of inequalities.
n_loop: usize
Max iteration number of outer-loop for the Newton step. Max iteration number of inner-loop for the backtracking line search.
svd_warm: bool
Enables to warm-start svd.
log_kkt: bool
Enables to log kkt matrix.
Methods
impl PDIPM
[src]
impl PDIPM
pub fn new() -> PDIPM | [src] |
Creates an instance with default parameters.
pub fn solve<L, Fo1, Fo2, Fi0, Fi1, Fi2, Fe, Fs>( | [src] |
Starts to solve a optimization problem by primal-dual interior-point method.
Returns Ok
with optimal \(x, \lambda, \nu\) concatenated vector
or Err
with message string.
n
is \(n\), the dimension of the variable \(x\).m
is \(m\), the number of inequality constraints \(f_i\).p
is \(p\), the number of rows of equality constraints \(A\) and \(b\).log
outputs solver progress.d_objective(x, df_o)
calculates first derivatives of the objective function \(\nabla f_{\rm obj}(x)\).dd_objective(x, ddf_o)
calculates second derivatives of the objective function \(\nabla^2 f_{\rm obj}(x)\).inequality(x, f_i)
calculates the inequality constraint functions \(f_i(x)\).d_inequality(x, df_i)
calculates first derivatives of the inequality constraint functions \(Df(x) = \left[\matrix{\nabla f_0(x) & \cdots & \nabla f_{m-1}(x)}\right]^T\).dd_inequality(x, ddf_i, i)
calculates second derivatives of the inequality constraint functions \(\nabla^2 f_i(x)\).equality(a, b)
produces the equality constraints affine parameters \(A\) and \(b\).start_point(x)
produces the initial values of \(x\). The initial values must satisfy all inequality constraints strictly: \(f_i(x)<0\). This may seem a hard requirement, but introducing slack variables helps in most cases. Refer pre-defined solver implementations for example.
Trait Implementations
impl LP for PDIPM
[src]
impl LP for PDIPM
fn solve_lp<L>( | [src] |
Runs the solver with given parameters.
Returns Ok
with optimal \(x\) or Err
with message string.
log
outputs solver progress.vec_c
is \(c\).mat_g
is \(G\).vec_h
is \(h\).mat_a
is \(A\).vec_b
is \(b\).
impl QP for PDIPM
[src]
impl QP for PDIPM
fn solve_qp<L>( | [src] |
Runs the solver with given parameters.
Returns Ok
with optimal \(x\) or Err
with message string.
log
outputs solver progress.mat_p
is \(P\).vec_q
is \(q\).mat_g
is \(G\).vec_h
is \(h\).mat_a
is \(A\).vec_b
is \(b\).
impl QCQP for PDIPM
[src]
impl QCQP for PDIPM
fn solve_qcqp<L>( | [src] |
Runs the solver with given parameters.
Returns Ok
with optimal \(x\) or Err
with message string.
log
outputs solver progress.mat_p
is \(P_0, \ldots, P_m\).vec_q
is \(q_0, \ldots, q_m\).scl_r
is \(r_0, \ldots, r_m\).mat_a
is \(A\).vec_b
is \(b\).
impl SOCP for PDIPM
[src]
impl SOCP for PDIPM
fn solve_socp<L>( | [src] |
Runs the solver with given parameters.
Returns Ok
with optimal \(x\) or Err
with message string.
log
outputs solver progress.vec_f
is \(f\).mat_g
is \(G_0, \ldots, G_{m-1}\).vec_h
is \(h_0, \ldots, h_{m-1}\).vec_c
is \(c_0, \ldots, c_{m-1}\).scl_d
is \(d_0, \ldots, d_{m-1}\).mat_a
is \(A\).vec_b
is \(b\).
impl SDP for PDIPM
[src]
impl SDP for PDIPM
fn solve_sdp<L>( | [src] |
Runs the solver with given parameters.
Returns Ok
with optimal \(x\) or Err
with message string.
log
outputs solver progress.vec_c
is \(c\).mat_f
is \(F_0, \ldots, F_n\).mat_a
is \(A\).vec_b
is \(b\).
NOTE: Current implementation is neither efficient nor accurate.
You may need lower eps
parameter.
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> | [src] |
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T | [src] |
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error> | [src] |
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId | [src] |