Morpheus 1.0.0
Dynamic matrix type and algorithms for sparse matrices
Loading...
Searching...
No Matches
DenseVector/Morpheus_Print_Impl.hpp
1
24#ifndef MORPHEUS_DENSEVECTOR_PRINT_IMPL_HPP
25#define MORPHEUS_DENSEVECTOR_PRINT_IMPL_HPP
26
27#include <Morpheus_FormatTags.hpp>
28
29#include <iostream>
30#include <iomanip> // setw, setprecision
31
32namespace Morpheus {
33namespace Impl {
34
35template <typename Printable, typename Stream>
36void print(
37 const Printable& p, Stream& s,
38 typename std::enable_if_t<
39 Morpheus::is_dense_vector_format_container_v<Printable>>* = nullptr) {
40 using size_type = typename Printable::size_type;
41 s << "<" << p.size() << "> with " << p.size() << " entries\n";
42
43 for (size_type n = 0; n < p.size(); n++) {
44 s << " " << std::setw(14) << n;
45 s << " " << std::setprecision(12) << std::setw(12) << "(" << p[n] << ")\n";
46 }
47}
48
49} // namespace Impl
50} // namespace Morpheus
51
52#endif // MORPHEUS_DENSEVECTOR_PRINT_IMPL_HPP
Generic Morpheus interfaces.
Definition: dummy.cpp:24