Fixed basic problems
This commit is contained in:
parent
ce95eb2516
commit
06274cd5a5
3 changed files with 8 additions and 7 deletions
|
|
@ -1,6 +1,5 @@
|
|||
use crate::formula::node::graph_constructor::GraphBuilder;
|
||||
|
||||
mod function;
|
||||
mod graph_constructor;
|
||||
|
||||
pub struct Node {
|
||||
|
|
@ -20,8 +19,13 @@ impl Node {
|
|||
}
|
||||
pub fn get_value(&self) -> f64 {
|
||||
if self.children.len() == 0 {
|
||||
0f64
|
||||
return (self.function)(vec![0f64]);
|
||||
}
|
||||
for node in self.children {}
|
||||
let mut inputs: Vec<f64> = vec![];
|
||||
for node in &self.children {
|
||||
inputs.push(node.get_value());
|
||||
}
|
||||
|
||||
return (self.function)(inputs);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue