aboutsummaryrefslogtreecommitdiff
path: root/src/function.rs
blob: 547ae0ed12f5dba3e79bb9e7ea64ff669f67b4b9 (plain)
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;
}