pub struct SDPProblem {
pub n: usize,
pub c: Vec<f64>,
pub constraints: Vec<Vec<f64>>,
pub b: Vec<f64>,
}Expand description
SDP problem in standard form minimize: trace(C * X) subject to: trace(A_i * X) = b_i, X ≽ 0
Fields§
§n: usizeMatrix dimension
c: Vec<f64>Objective matrix C (n × n)
constraints: Vec<Vec<f64>>Constraint matrices A_i
b: Vec<f64>Constraint right-hand sides b_i
Implementations§
Source§impl SDPProblem
impl SDPProblem
Sourcepub fn set_objective(&mut self, c: Vec<f64>)
pub fn set_objective(&mut self, c: Vec<f64>)
Set objective matrix
Sourcepub fn add_constraint(&mut self, a: Vec<f64>, bi: f64)
pub fn add_constraint(&mut self, a: Vec<f64>, bi: f64)
Add constraint
Sourcepub fn num_constraints(&self) -> usize
pub fn num_constraints(&self) -> usize
Number of constraints
Trait Implementations§
Source§impl Clone for SDPProblem
impl Clone for SDPProblem
Source§fn clone(&self) -> SDPProblem
fn clone(&self) -> SDPProblem
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SDPProblem
impl RefUnwindSafe for SDPProblem
impl Send for SDPProblem
impl Sync for SDPProblem
impl Unpin for SDPProblem
impl UnwindSafe for SDPProblem
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more