Fixed basic problems

This commit is contained in:
Rendo 2025-11-06 06:27:45 +05:00
commit 06274cd5a5
3 changed files with 8 additions and 7 deletions

View file

@ -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);
}
}