Struct lib::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
use numbers_rus::ZeroEquation;
let mut equation = ZeroEquation::new(vec![1, 2, 3]);
assert_eq!(equation.get_sol(), 0);Implementations§
source§impl ZeroEquation
impl ZeroEquation
pub fn new(values: Vec<i128>) -> ZeroEquation
sourcepub fn get_values(&self) -> Vec<i128>
pub fn get_values(&self) -> Vec<i128>
returns all the values in the equation
sourcepub fn remove_value(&mut self, index: usize)
pub fn remove_value(&mut self, index: usize)
removes a single value from the list of values