Functionalities
- Parsing from string to function
- support for 1/2/3 variable(s) functions
- supports the following functions:
- Ln, Sin, Cos, Tan, Sec, Csc, ASin, ACos, ATan, Sinh, Cosh, Tanh, Coth, Sech, Csch, ASinh, ACosh, ATanh, Abs
- Ability to define parameters
- Some kind of expression semplification
1D Functions
- Derivative
- Definite integral between a and b
- Evaluate functions at x
2D Functions
- Derivative
- Hessian
- Evaluate functions at (x,y)
3D Functions
- Derivative
- Hessian
- Evaluate functions at (x,y,z)
Examples
Create a function with a macro and calculate gradient and hessian
use
use FromStr;
let func_3d = f3d!;
let gradient = func_3d.derivative;
println!;
// { ycos(x)-ln(z)sin(x) , sin(x) , cos(x)/z }
let hessian = func_3d.hessian;
println!;
// | -ysin(x)-ln(z)cos(z) | cos(x) | -sin(x)/z |
// | cos(x) | 0 | 0 |
// | -sin(x)/z | 0 | -cos(x)/z^2 |
Create a function with a context and use the parameter
use ;
let ctx = new;
let func_3d = F3Dbuild;