File treeweave.hpp

↰ Parent directory (include/treeweave)

Public C++ API for the treeweave piecewise-polynomial function approximator. Built on polyfit’s leaf evaluators; treeweave adds the adaptive tree (paneling) layer on top.

Definition (include/treeweave/treeweave.hpp)

Detailed Description

Thread safety. Once treeweave::fit(...) returns, the resulting Function is immutable through its operator() overloads, which are safe to call concurrently from multiple threads provided each call writes to a disjoint output slice. The batch path allocates and frees its scratch on each call via the caller-supplied allocator (default std::allocator<value_type>); no state is carried between calls. For pooled reuse, pass a stateful allocator; std::pmr::polymorphic_allocator over a monotonic_buffer_resource is the idiomatic choice. See tests/test_threadsafe.cpp.

Memory cost. Tightening tol, raising max_depth, raising max_memory_mib, or enabling allow_max_depth_leaves all increase the leaf count L. The Function holds one persistent allocation: the tree itself, O(L), shared by all threads and reported by Function::print_stats() / memory_usage(). Each batch call allocates and frees on return a scratch of roughly tile_K * (4 + (input_dim + output_dim) * sizeof(value_type)) plus 4 * (L + 1) bytes (with tile_K = max(65536, 32 * L)) and frees it on return.

Includes

  • algorithm

  • array

  • cmath

  • complex

  • concepts

  • cstddef

  • memory

  • optional

  • polyfit/polyfit.hpp

  • stdexcept

  • string

  • treeweave/detail/arch_degree_table.hpp

  • treeweave/detail/eval_policy.hpp

  • treeweave/detail/function_impl.hpp

  • treeweave/detail/tol_kind.hpp (File tol_kind.hpp)

  • treeweave_version.h

  • type_traits

  • utility

Included By

Namespaces

Classes

Functions

Typedefs

Variables