pub enum ResolutionError {
Unbounded,
Infeasible,
Other(&'static str),
Str(String),
}Expand description
Represents an error that occurred when solving a problem.
§Examples
§Infeasible
use good_lp::*;
let mut vars = variables!();
let x = vars.add_variable(); // unbounded variable
let result = vars.maximise(x)
.using(default_solver)
.with(constraint!(x <= 9))
.with(constraint!(x >= 10))
.solve(); // x cannot be less than 9 and more than 10 at the same time
assert_eq!(result.err(), Some(ResolutionError::Infeasible));Variants§
Unbounded
The problem is unbounded. It doesn’t have a finite optimal values for its variables. The objective can be made infinitely large without violating any constraints.
Infeasible
There exists no solution that satisfies all of the constraints
Other(&'static str)
Another error occurred
Str(String)
An error string
Trait Implementations§
Source§impl Clone for ResolutionError
impl Clone for ResolutionError
Source§fn clone(&self) -> ResolutionError
fn clone(&self) -> ResolutionError
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 moreSource§impl Debug for ResolutionError
impl Debug for ResolutionError
Source§impl Display for ResolutionError
impl Display for ResolutionError
Source§impl Error for ResolutionError
impl Error for ResolutionError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<Error> for ResolutionError
Available on crate feature microlp only.
impl From<Error> for ResolutionError
Available on crate feature
microlp only.Source§impl From<String> for ResolutionError
impl From<String> for ResolutionError
Source§impl PartialEq for ResolutionError
impl PartialEq for ResolutionError
impl StructuralPartialEq for ResolutionError
Auto Trait Implementations§
impl Freeze for ResolutionError
impl RefUnwindSafe for ResolutionError
impl Send for ResolutionError
impl Sync for ResolutionError
impl Unpin for ResolutionError
impl UnwindSafe for ResolutionError
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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