-
Notifications
You must be signed in to change notification settings - Fork 13
/
lgr_print.hpp
60 lines (52 loc) · 1.39 KB
/
lgr_print.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#pragma once
#include <hpc_dimensional.hpp>
#include <hpc_index.hpp>
#include <hpc_matrix3x3.hpp>
#include <hpc_symmetric3x3.hpp>
#include <hpc_vector3.hpp>
#include <iostream>
namespace lgr {
#ifndef HPC_DISABLE_STRONG_INDICES
template <class Tag, class Integral>
std::ostream&
operator<<(std::ostream& stream, hpc::index<Tag, Integral> v)
{
stream << weaken(v);
return stream;
}
#endif
#ifndef HPC_DISABLE_DIMENSIONAL_ANALYSIS
template <class T, class Dimension>
std::ostream&
operator<<(std::ostream& stream, hpc::quantity<T, Dimension> v)
{
stream << weaken(v);
return stream;
}
#endif
template <class Scalar>
std::ostream&
operator<<(std::ostream& stream, hpc::vector3<Scalar> v)
{
stream << v(0) << " " << v(1) << " " << v(2);
return stream;
}
template <class Scalar>
std::ostream&
operator<<(std::ostream& stream, hpc::matrix3x3<Scalar> m)
{
stream << m(0, 0) << " " << m(0, 1) << " " << m(0, 2) << "\n";
stream << m(1, 0) << " " << m(1, 1) << " " << m(1, 2) << "\n";
stream << m(2, 0) << " " << m(2, 1) << " " << m(2, 2) << "\n";
return stream;
}
template <class Scalar>
std::ostream&
operator<<(std::ostream& stream, hpc::symmetric3x3<Scalar> m)
{
stream << m(0, 0) << " " << m(0, 1) << " " << m(0, 2) << "\n";
stream << m(1, 0) << " " << m(1, 1) << " " << m(1, 2) << "\n";
stream << m(2, 0) << " " << m(2, 1) << " " << m(2, 2) << "\n";
return stream;
}
} // namespace lgr