1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
pub struct FunctionArgument { args : Vec<f64>, } impl FunctionArgument { pub fn new(args: Vec<f64>) -> Self { Self { args } } pub fn get(&self, i : usize) -> f64 { self.args[i] } } pub trait Function { fn eval(&self, args: FunctionArgument) -> f64; }