MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
print.hpp File Reference
#include <ostream>
#include <iomanip>
#include <string>
#include <mtl/concepts/collection.hpp>
#include <mtl/concepts/vector.hpp>
#include <mtl/concepts/matrix.hpp>
#include <mtl/mat/compressed2D.hpp>

Namespaces

namespace  mtl

Functions

template<Vector V>
std::ostream & mtl::operator<< (std::ostream &os, const V &v)
 Print a vector: [v0, v1, ..., vn].
template<Matrix M>
std::ostream & mtl::operator<< (std::ostream &os, const M &m)
 Print a matrix in row-by-row format.
template<Vector V>
void mtl::print (std::ostream &os, const V &v, int precision=6)
 Print a vector to a stream with configurable precision.
template<Matrix M>
void mtl::print (std::ostream &os, const M &m, int precision=6)
 Print a matrix to a stream with configurable precision.
template<typename Value, typename Parameters>
void mtl::print_sparse (std::ostream &os, const mat::compressed2D< Value, Parameters > &A, int precision=6)
 Print sparse matrix in triplet format: (row, col) = value.
template<Matrix M>
void mtl::print_matlab (std::ostream &os, const M &m, const std::string &name="A", int precision=6)
 Print matrix in MATLAB format: name = [v1 v2 ...; v3 v4 ...; ...].