38template <
typename Vector>
53 [[nodiscard]]
auto vec() const noexcept -> const Vector& {
return *
vec_; }
71template <
typename Vector>
73 const Eigen::DenseBase<Vector>& vec) {
75 vec.cols() == 1,
"format_dense_vector requires a vector.");
88template <
typename Vector>
89struct formatter<
num_collect::util::impl::dense_vector_format_view<Vector>>
90 :
public formatter<typename Vector::Scalar> {
101 format_context& context)
const ->
decltype(context.out()) {
102 const auto& vec = val.vec();
103 return format_impl(vec, context);
114 auto format_impl(
const Vector& vec, format_context& context)
const
115 ->
decltype(context.out()) {
116 const Eigen::Index size = vec.size();
117 auto out = context.out();
120 for (Eigen::Index i = 0; i < size; ++i) {
122 out = write_comma(out);
124 context.advance_to(out);
125 out = formatter<typename Vector::Scalar>::format(vec(i), context);
139 -> format_context::iterator {
Definition of exceptions.
Definition of macros for logging.
Namespace of fmt library.
auto format_dense_vector(const Eigen::DenseBase< Vector > &vec)
Format a dense vector.
Namespace of num_collect source codes.
Definition of NUM_COLLECT_PRECONDITION macro.
#define NUM_COLLECT_PRECONDITION(CONDITION,...)
Check whether a precondition is satisfied and throw an exception if not.