This commit is contained in:
Rendo 2025-11-09 01:15:52 +05:00
commit 9c487308be
6 changed files with 127 additions and 11 deletions

View file

@ -1,9 +1,22 @@
use crate::formula::Formula;
use crate::{formula::Formula, node::Node};
mod formula;
mod node;
#[cfg(test)]
mod tests;
fn main() {
let formula = Formula::new();
dbg!(formula.run(vec![1f64]));
let mut formula = Formula::new();
formula
.modify_tree()
.insert_node(Node::function(|inputs| inputs.iter().sum(), Some(2)), None);
if let Err(x) = formula
.modify_tree()
.go_down(0)
.add_node(Node::number(1f64))
{
println!("{x}");
}
formula.display_tree();
let results = formula.run(vec![0f64, 1f64, 2f64, 3f64, 4f64, 5f64]);
}