50template <
typename Matrix>
67 [[nodiscard]]
auto mat() const noexcept -> const Matrix& {
return *
mat_; }
98template <
typename Matrix>
100 const Eigen::DenseBase<Matrix>& mat,
114template <
typename Matrix>
115struct formatter<
num_collect::util::impl::dense_matrix_format_view<Matrix>>
116 :
public formatter<typename Matrix::Scalar> {
127 format_context& context)
const ->
decltype(context.out()) {
128 const auto& mat = val.mat();
129 switch (val.type()) {
131 return format_one_line(mat, context);
133 return format_multi_line(mat, context);
148 ->
decltype(context.out()) {
149 const Eigen::Index rows = mat.rows();
150 const Eigen::Index cols = mat.cols();
151 auto out = context.out();
154 for (Eigen::Index row = 0; row < rows; ++row) {
156 out = write_comma(out);
160 for (Eigen::Index col = 0; col < cols; ++col) {
162 out = write_comma(out);
164 context.advance_to(out);
165 out = formatter<typename Matrix::Scalar>::format(
166 mat(row, col), context);
184 ->
decltype(context.out()) {
185 const Eigen::Index rows = mat.rows();
186 const Eigen::Index cols = mat.cols();
187 auto out = context.out();
192 for (Eigen::Index row = 0; row < rows; ++row) {
205 for (Eigen::Index col = 0; col < cols; ++col) {
207 out = write_comma(out);
209 context.advance_to(out);
210 out = formatter<typename Matrix::Scalar>::format(
211 mat(row, col), context);
230 -> format_context::iterator {
Class of exception on invalid arguments.
Definition of exceptions.
Definition of macros for logging.
#define NUM_COLLECT_LOG_AND_THROW(EXCEPTION_TYPE,...)
Write an error log and throw an exception for an error.
Namespace of fmt library.
auto format_dense_matrix(const Eigen::DenseBase< Matrix > &mat, dense_matrix_format_type type=dense_matrix_format_type::one_line)
Format a dense matrix.
dense_matrix_format_type
Enumeration of matrix format types.
@ multi_line
Multiple lines.
Namespace of num_collect source codes.