|
EmrysFilter 0.1.0
State estimation utilities in C++23 using Eigen
|
Printing: operator<< and std::formatter for every distribution, every filter (which prints its name and nests its state under it), and the library's error codes, so that std::cout << filter and std::println("{}", filter.state()) work.
More...
#include <EmrysFilter/Core/Macros.h>#include <expected>#include <format>#include <ostream>#include <sstream>#include <string>#include <string_view>#include <EmrysFilter/Core/Weights.h>Go to the source code of this file.
Classes | |
| struct | std::formatter< T, char > |
Formats any type the library describes (Emrys::internal::Printable) as its operator<< prints it. More... | |
Functions | |
| template<internal::Printable T> | |
| std::ostream & | Emrys::operator<< (std::ostream &stream, T const &value) |
| Prints value, any type the library describes (internal::Printable): a distribution, a filter, by name with its state nested under it, or an error code. | |
Printing: operator<< and std::formatter for every distribution, every filter (which prints its name and nests its state under it), and the library's error codes, so that std::cout << filter and std::println("{}", filter.state()) work.
Each type describes itself through an internal::describe() overload beside it, and this header turns any type with one into an internal::Printable, which the operator and the formatter take.
A description is a summary, never the elements: a particle set prints its count, its effective sample size, and its weighted mean and covariance, not its particles, which its states() and logWeights() print through Eigen. Its first line names the distribution and its dimension, and the lines after it are indented by two spaces per level, so a mixture's components nest under it. Numbers follow the stream's precision, as Eigen's do; the formatter takes a width, a fill, and an alignment, as a string does, and a precision, {:.3}, as the stream's.
Defining EMRYS_FILTER_NO_IO before the first EmrysFilter header leaves all of it out, with the standard headers format, ostream, and sstream; Eigen's EIGEN_NO_IO implies it (Macros.h).
Read Spaces next.