Struct flag_algebra::sdp::Problem
source · pub struct Problem<N, F: Flag> {
pub ineqs: Vec<Ineq<N, F>>,
pub cs: Vec<MulAndUnlabel<F>>,
pub obj: QFlag<N, F>,
}Expand description
The optimisation problems over flags are translated into a sdp problem in the sdpa format.
Shape of the matrices:
For each i in ineqs (where i is itself a vector of inequalities): A diagonal block of size i.len()
For each cs: A block with the size od cs.input_matrix An optimization problem expressed in flags algebra.
Fields§
§ineqs: Vec<Ineq<N, F>>Set of contraint inequalities.
cs: Vec<MulAndUnlabel<F>>Set of Cauchy-Schwarz inequlities to be used.
obj: QFlag<N, F>Vector to be optimized.
Implementations§
source§impl<N, F> Problem<N, F>where
N: Display + Zero + Copy + PartialEq + Neg<Output = N>,
F: Flag,
impl<N, F> Problem<N, F>where N: Display + Zero + Copy + PartialEq + Neg<Output = N>, F: Flag,
sourcepub fn write_sdpa(&self, filename: &str) -> Result<()>
pub fn write_sdpa(&self, filename: &str) -> Result<()>
Write the semi-definite program in the file filename in the sdpa format.
sourcepub fn no_scale(self) -> Selfwhere
N: DivAssign + ScalarOperand + FromPrimitive,
pub fn no_scale(self) -> Selfwhere N: DivAssign + ScalarOperand + FromPrimitive,
Rescale the objective according to its scale field. If this method is not used, the output of the sdp solver may need to be rescaled.
sourcepub fn solve_csdp(&self, filename: &str) -> Result<f64, Error>
pub fn solve_csdp(&self, filename: &str) -> Result<f64, Error>
Solve the sdp using the CSDP solver.
pub fn run_csdp( &self, name: &str, initial_solution: Option<&str>, minimize_certificate: bool ) -> Result<f64, Error>
Trait Implementations§
Auto Trait Implementations§
impl<N, F> !RefUnwindSafe for Problem<N, F>
impl<N, F> !Send for Problem<N, F>
impl<N, F> !Sync for Problem<N, F>
impl<N, F> Unpin for Problem<N, F>where F: Unpin, N: Unpin,
impl<N, F> !UnwindSafe for Problem<N, F>
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
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.