pub type DefaultSolver<T = f64> = Solver<T, DefaultProblemData<T>, DefaultVariables<T>, DefaultResiduals<T>, DefaultKKTSystem<T>, CompositeCone<T>, DefaultInfo<T>, DefaultSolution<T>, DefaultSettings<T>>;Expand description
Solver for problems in standard conic program form
Aliased Type§
pub struct DefaultSolver<T = f64> {
pub data: DefaultProblemData<T>,
pub variables: DefaultVariables<T>,
pub residuals: DefaultResiduals<T>,
pub kktsystem: DefaultKKTSystem<T>,
pub cones: CompositeCone<T>,
pub step_lhs: DefaultVariables<T>,
pub step_rhs: DefaultVariables<T>,
pub prev_vars: DefaultVariables<T>,
pub info: DefaultInfo<T>,
pub solution: DefaultSolution<T>,
pub timers: Option<Timers>,
/* private fields */
}Fields§
§data: DefaultProblemData<T>§variables: DefaultVariables<T>§residuals: DefaultResiduals<T>§kktsystem: DefaultKKTSystem<T>§cones: CompositeCone<T>§step_lhs: DefaultVariables<T>§step_rhs: DefaultVariables<T>§prev_vars: DefaultVariables<T>§info: DefaultInfo<T>§solution: DefaultSolution<T>§timers: Option<Timers>Implementations§
Source§impl<T> DefaultSolver<T>where
T: FloatT,
impl<T> DefaultSolver<T>where
T: FloatT,
Sourcepub fn update_data<DataP: MatrixProblemDataUpdate<T>, Dataq: VectorProblemDataUpdate<T>, DataA: MatrixProblemDataUpdate<T>, Datab: VectorProblemDataUpdate<T>>(
&mut self,
P: &DataP,
q: &Dataq,
A: &DataA,
b: &Datab,
) -> Result<(), DataUpdateError>
pub fn update_data<DataP: MatrixProblemDataUpdate<T>, Dataq: VectorProblemDataUpdate<T>, DataA: MatrixProblemDataUpdate<T>, Datab: VectorProblemDataUpdate<T>>( &mut self, P: &DataP, q: &Dataq, A: &DataA, b: &Datab, ) -> Result<(), DataUpdateError>
Overwrites internal problem data structures in a solver object with new data, avoiding new memory allocations.
See update_P, update_q, update_A, update_b for allowable inputs.
data updating functions will return an error when either presolving or chordal
decomposition have modfied the original problem structure. In order to guarantee
that data updates will be accepted regardless of the original problem data, set
presolve_enable = false, chordal_decomposition_enable = false and
input_sparse_dropzeros = false in the solver settings.
See also is_data_update_allowed().
Sourcepub fn update_P<Data: MatrixProblemDataUpdate<T>>(
&mut self,
data: &Data,
) -> Result<(), DataUpdateError>
pub fn update_P<Data: MatrixProblemDataUpdate<T>>( &mut self, data: &Data, ) -> Result<(), DataUpdateError>
Overwrites the P matrix data in an existing solver object. The input P can be
-
a nonempty
Vec, in which case the nonzero values of the originalPare overwritten, preserving the sparsity pattern, or -
a
CscMatrix, in which case the input must match the sparsity pattern of the upper triangular part of the originalP. -
an iterator
zip(&index,&values), specifying a selective update of values. -
an empty vector, in which case no action is taken.
Sourcepub fn update_A<Data: MatrixProblemDataUpdate<T>>(
&mut self,
data: &Data,
) -> Result<(), DataUpdateError>
pub fn update_A<Data: MatrixProblemDataUpdate<T>>( &mut self, data: &Data, ) -> Result<(), DataUpdateError>
Overwrites the A matrix data in an existing solver object. The input A can be
-
a nonempty
Vec, in which case the nonzero values of the originalAare overwritten, preserving the sparsity pattern, or -
a
CscMatrix, in which case the input must match the sparsity pattern of the originalA. -
an iterator
zip(&index,&values), specifying a selective update of values. -
an empty vector, in which case no action is taken.
Sourcepub fn update_q<Data: VectorProblemDataUpdate<T>>(
&mut self,
data: &Data,
) -> Result<(), DataUpdateError>
pub fn update_q<Data: VectorProblemDataUpdate<T>>( &mut self, data: &Data, ) -> Result<(), DataUpdateError>
Overwrites the q vector data in an existing solver object. No action is taken if the input is empty.
Sourcepub fn update_b<Data: VectorProblemDataUpdate<T>>(
&mut self,
data: &Data,
) -> Result<(), DataUpdateError>
pub fn update_b<Data: VectorProblemDataUpdate<T>>( &mut self, data: &Data, ) -> Result<(), DataUpdateError>
Overwrites the b vector data in an existing solver object. No action is taken if the input is empty.
Sourcepub fn is_data_update_allowed(&self) -> bool
pub fn is_data_update_allowed(&self) -> bool
Returns true if problem structure has been modified by
presolving, zero dropping or chordal decomposition
Source§impl<T> DefaultSolver<T>where
T: FloatT,
impl<T> DefaultSolver<T>where
T: FloatT,
pub fn new( P: &CscMatrix<T>, q: &[T], A: &CscMatrix<T>, b: &[T], cones: &[SupportedConeT<T>], settings: DefaultSettings<T>, ) -> Result<Self, SolverError>
Trait Implementations§
Source§impl<T> ConfigurablePrintTarget for DefaultSolver<T>where
T: FloatT,
impl<T> ConfigurablePrintTarget for DefaultSolver<T>where
T: FloatT,
Source§fn print_to_stdout(&mut self)
fn print_to_stdout(&mut self)
Source§fn print_to_file(&mut self, file: File)
fn print_to_file(&mut self, file: File)
Source§fn print_to_stream(&mut self, stream: Box<dyn Write + Send + Sync>)
fn print_to_stream(&mut self, stream: Box<dyn Write + Send + Sync>)
Source§fn print_to_sink(&mut self)
fn print_to_sink(&mut self)
Source§fn print_to_buffer(&mut self)
fn print_to_buffer(&mut self)
Source§fn get_print_buffer(&mut self) -> Result<String>
fn get_print_buffer(&mut self) -> Result<String>
Source§impl<T> SolverJSONReadWrite<T> for DefaultSolver<T>
impl<T> SolverJSONReadWrite<T> for DefaultSolver<T>
Source§fn save_to_file(&self, file: &mut File) -> Result<(), Error>
fn save_to_file(&self, file: &mut File) -> Result<(), Error>
Source§fn load_from_file(
file: &mut File,
settings: Option<DefaultSettings<T>>,
) -> Result<Self, SolverError>
fn load_from_file( file: &mut File, settings: Option<DefaultSettings<T>>, ) -> Result<Self, SolverError>
save_to_file