Struct numbers::ZeroEquation
source · pub struct ZeroEquation { /* private fields */ }Expand description
ZeroEquation is an equation with a list of values on one side and a solution on the other. Similar to Equation, but with a list of values (in a Vec) that will add up to the solution (or be subtracted if the number is negative). Sol is set to 0 and values can be moved to the solution side of the equation with move_to_sol().
Example
Implementations§
source§impl ZeroEquation
impl ZeroEquation
pub fn new(values: Vec<i128>) -> ZeroEquation
pub fn get_values(&self) -> Vec<i128>
pub fn get_value(&self, index: usize) -> i128
pub fn add_value(&mut self, value: i128)
pub fn remove_value(&mut self, index: usize)
pub fn get_sol(&self) -> i128
pub fn move_to_sol(&mut self, index: usize) -> i128
pub fn is_valid(&mut self) -> bool
pub fn get_error(&mut self) -> i128
Auto Trait Implementations§
impl RefUnwindSafe for ZeroEquation
impl Send for ZeroEquation
impl Sync for ZeroEquation
impl Unpin for ZeroEquation
impl UnwindSafe for ZeroEquation
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