Getting Started¶
Installation¶
Building from Source¶
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
ctest --test-dir build --output-on-failure
CMake Options¶
| Option | Default | Description |
|---|---|---|
TAX_BUILD_TEST |
ON |
Build Google Test suite |
TAX_BUILD_BENCHMARK |
OFF |
Build Google Benchmark suite |
TAX_USE_DACE |
OFF |
Enable DACE comparison tests |
Using tax in Your Project¶
Include¶
A single umbrella header pulls in everything:
Core Type¶
The central type is TruncatedTaylorExpansionT<T, N, M>:
| Parameter | Meaning |
|---|---|
T |
Scalar coefficient type (e.g. double) |
N |
Maximum total polynomial order |
M |
Number of independent variables (default 1) |
Two convenience aliases:
Creating Variables¶
Building Expressions¶
Arithmetic and math functions work naturally:
The right-hand side builds a lazy expression tree. Evaluation happens only on assignment to a TruncatedTaylorExpansionT object.
Extracting Results¶
f.value(); // f(x₀) — the constant term
f.coeff({k}); // coefficient of δxᵏ
f.derivative({k}); // k-th derivative (= k! · coeff)
f.eval(0.3); // evaluate polynomial at x₀ + 0.3
For multivariate DA objects:
auto [x, y] = tax::TEn<3, 2>::variables({0.0, 0.0});
tax::TEn<3, 2> g = x*x + x*y + y*y;
g.derivative({2, 0}); // ∂²g/∂x² = 2
g.derivative({1, 1}); // ∂²g/∂x∂y = 1
g.coeff<1, 1>(); // compile-time access
Coefficients vs Derivatives¶
A DA polynomial stores coefficients of the monomial basis:
\[
f(\mathbf{x}_0 + \delta\mathbf{x}) = \sum_{|\alpha| \le N} f_\alpha \, \delta\mathbf{x}^\alpha
\]
The relationship to partial derivatives is:
\[
f_\alpha = \frac{1}{\alpha!} \frac{\partial^{|\alpha|} f}{\partial x_1^{\alpha_1} \cdots \partial x_M^{\alpha_M}} \bigg|_{\mathbf{x}_0}
\]
The derivative() method returns the partial derivative (multiplies the coefficient by \(\alpha!\)), while coeff() returns the raw coefficient.
Next Steps¶
- Core Module — full treatment of the TTE type and expression templates
- Vector (Eigen) — Eigen integration, Jacobians, Hessians
- Automatic Domain Splitting — adaptive polynomial approximation
- Taylor Integrator — high-order ODE integration