@@ -868,9 +868,9 @@ pub trait AtomCore: private::Sealed + Sized {
868868 }
869869
870870 /// Create an efficient evaluator for a (nested) expression.
871- /// All free parameters must appear in `params` and all other variables
872- /// and user functions in the expression must occur in the function map .
873- /// The function map may have nested expressions .
871+ /// All free parameters must appear in `params` and all nested functions
872+ /// must be registered using [`EvaluatorBuilder::add_function`] or [`EvaluatorBuilder::add_function_with_map`] .
873+ /// All other functions, must have an evaluation hook .
874874 ///
875875 /// For the best performance, the evaluator should be JIT-compiled ([ExpressionEvaluator::jit_compile])
876876 /// or compiled to C++ with inline ASM using [ExpressionEvaluator::export_cpp].
@@ -920,23 +920,22 @@ pub trait AtomCore: private::Sealed + Sized {
920920 EvaluatorBuilder :: new ( self . as_atom_view ( ) , params)
921921 }
922922
923- /// Convert nested expressions to a tree suitable for repeated evaluations with
924- /// different values for `params`.
925- /// All variables and all user functions in the expression must occur in the map.
923+ /// Create an efficient evaluator for (nested) expressions.
924+ /// All free parameters must appear in `params` and all nested functions
925+ /// must be registered using [`EvaluatorBuilder::add_function`] or [`EvaluatorBuilder::add_function_with_map`].
926+ /// All other functions, must have an evaluation hook.
926927 ///
927928 /// # Example
928929 ///
929930 /// ```
930931 /// use symbolica::prelude::*;
931932 /// let expr1 = parse!("x + y");
932933 /// let expr2 = parse!("x - y");
933- /// let x = parse!("x");
934- /// let y = parse!("y");
935- /// let params = vec![x.clone(), y.clone()];
936- /// let evaluator = Atom::evaluator_multiple(&[expr1, expr2], ¶ms)
934+ /// let params = vec![parse!("x"), parse!("y")];
935+ /// let mut evaluator = Atom::evaluator_multiple(&[expr1, expr2], ¶ms)
937936 /// .build()
938- /// .unwrap();
939- /// let mut evaluator = evaluator .map_coeff(&|c| c.to_real().unwrap().to_f64());
937+ /// .unwrap()
938+ /// .map_coeff(&|c| c.to_real().unwrap().to_f64());
940939 /// let mut out = vec![0., 0.];
941940 /// evaluator.evaluate(&[1.0, 2.0], &mut out);
942941 /// assert_eq!(out, &[3.0, -1.0]);
0 commit comments