OGS
FormattingUtils.h
Go to the documentation of this file.
1
11
#pragma once
12
13
#include <spdlog/fmt/bundled/ostream.h>
14
15
#include <Eigen/Core>
16
#include <concepts>
17
18
#include "
mathlib_export.h
"
19
20
namespace
MathLib
21
{
22
struct
EigenIOFormat
23
{
24
static
MATHLIB_EXPORT
const
Eigen::IOFormat
full_precision
;
25
};
26
}
// namespace MathLib
27
28
template
<
typename
T>
29
requires
std::derived_from<T, Eigen::DenseBase<T>>
30
struct
fmt::formatter<T> : fmt::ostream_formatter
31
{
32
auto
format
(T
const
& value, fmt::format_context& ctx)
const
33
{
34
return
fmt::ostream_formatter::format(
35
value.format(
MathLib::EigenIOFormat::full_precision
), ctx);
36
}
37
};
mathlib_export.h
MATHLIB_EXPORT
#define MATHLIB_EXPORT
Definition
mathlib_export.h:15
MathLib
Definition
CreateComponent.h:32
MathLib::EigenIOFormat
Definition
FormattingUtils.h:23
MathLib::EigenIOFormat::full_precision
static MATHLIB_EXPORT const Eigen::IOFormat full_precision
Definition
FormattingUtils.h:24
fmt::formatter< T >::format
auto format(T const &value, fmt::format_context &ctx) const
Definition
FormattingUtils.h:32
MathLib
FormattingUtils.h
Generated by
1.11.0