pub struct ConstraintSolver { /* private fields */ }Expand description
Iterative constraint solver.
Implementations§
Source§impl ConstraintSolver
impl ConstraintSolver
pub fn new() -> Self
pub fn with_max_iterations(self, n: usize) -> Self
pub fn with_tolerance(self, tol: f32) -> Self
pub fn add(&mut self, constraint: Constraint)
pub fn constraint_count(&self) -> usize
pub fn remove(&mut self, index: usize)
Sourcepub fn solve(&self, params: &mut Params) -> SolveResult
pub fn solve(&self, params: &mut Params) -> SolveResult
Solve all constraints iteratively until convergence or max_iterations.
Sourcepub fn check_violations(&self, params: &Params) -> Vec<usize>
pub fn check_violations(&self, params: &Params) -> Vec<usize>
Check which constraints (by index) are violated.
Sourcepub fn is_satisfied(&self, params: &Params) -> bool
pub fn is_satisfied(&self, params: &Params) -> bool
True if all constraints are satisfied.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConstraintSolver
impl RefUnwindSafe for ConstraintSolver
impl Send for ConstraintSolver
impl Sync for ConstraintSolver
impl Unpin for ConstraintSolver
impl UnsafeUnpin for ConstraintSolver
impl UnwindSafe for ConstraintSolver
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more