Momentum
A library for solving nonlinear optimization problems related to human body kinematics
Loading...
Searching...
No Matches
fmt_eigen.h File Reference

libfmt formatter support for Eigen types. More...

#include <fmt/ostream.h>
#include <Eigen/Core>

Go to the source code of this file.

Detailed Description

libfmt formatter support for Eigen types.

Provides an fmt::formatter specialization for any type derived from Eigen::DenseBase (matrices, vectors, and expression templates). This makes Eigen objects directly usable with fmt::format, fmt::print, and related APIs by delegating to Eigen's operator<< via ostream_formatter.

Usage: simply #include "momentum/math/fmt_eigen.h" and format Eigen values normally, e.g. fmt::format("{}", matrix) or fmt::print("v = {}\n", vector).

Only enabled for libfmt >= 10.0.0, which introduced ostream_formatter. Note: Eigen::Quaternion is not derived from Eigen::DenseBase and is therefore not covered by this formatter.

Definition in file fmt_eigen.h.