NetDEM v1.0
Loading...
Searching...
No Matches
utils_operators.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "utils_macros.hpp"
4#include <iostream>
5
6namespace netdem {
7
8extern std::ostream &operator<<(std::ostream &os, Vec3i const &obj);
9
10extern std::ostream &operator<<(std::ostream &os, Vec3d const &obj);
11
12template <size_t N>
13std::ostream &operator<<(std::ostream &os, VecNd<N> const &obj) {
14 for (size_t i = 0; i < N - 1; i++) {
15 os << obj[i] << ", ";
16 }
17 os << obj[N - 1];
18 return os;
19}
20
21extern std::ostream &operator<<(std::ostream &os, VecXd const &obj);
22
23extern std::ostream &operator<<(std::ostream &os, Vec4d const &obj);
24
25extern std::ostream &operator<<(std::ostream &os, Mat3d const &obj);
26
27extern Vec3d operator+(Vec3d const &lhs, double rhs);
28
29extern Vec3d operator+(double lhs, Vec3d const &rhs);
30
31extern Vec3i operator+(Vec3i const &lhs, int rhs);
32
33extern Vec3i operator+(int lhs, Vec3i const &rhs);
34
35extern Vec3d operator-(Vec3d const &lhs, double rhs);
36
37extern Vec3d operator-(double lhs, Vec3d const &rhs);
38
39extern Vec3d operator*(Vec3d const &lhs, double rhs);
40
41extern Vec3d operator*(double lhs, Vec3d const &rhs);
42
43extern Vec3d operator/(Vec3d const &lhs, double rhs);
44
45extern Vec3d operator/(double lhs, Vec3d const &rhs);
46
47extern Vec3d operator+(Vec3d const &lhs, Vec3d const &rhs);
48
49extern Vec3d operator-(Vec3d const &lhs, Vec3d const &rhs);
50
51extern Vec3d operator*(Vec3d const &lhs, Vec3d const &rhs);
52
53extern Vec3d operator/(Vec3d const &lhs, Vec3d const &rhs);
54
55
56extern Mat3d operator*(Mat3d const &lhs, double rhs);
57
58extern Mat3d operator*(double lhs, Mat3d const &rhs);
59
60extern Mat3d operator/(Mat3d const &lhs, double rhs);
61
62extern Mat3d operator/(double lhs, Mat3d const &rhs);
63
64extern Mat3d operator+(Mat3d const &lhs, Mat3d const &rhs);
65
66extern Mat3d operator-(Mat3d const &lhs, Mat3d const &rhs);
67
68} // namespace netdem
Definition bond_entry.hpp:7
std::array< std::array< double, 3 >, 3 > Mat3d
Definition utils_macros.hpp:22
std::array< double, 3 > Vec3d
Definition utils_macros.hpp:18
Vec3d operator+(Vec3d const &lhs, double rhs)
Definition utils_operators.cpp:33
std::array< double, N > VecNd
Definition utils_macros.hpp:25
std::array< int, 3 > Vec3i
Definition utils_macros.hpp:14
std::vector< double > VecXd
Definition utils_macros.hpp:29
std::array< double, 4 > Vec4d
Definition utils_macros.hpp:19
std::ostream & operator<<(std::ostream &os, Vec3i const &obj)
Definition utils_operators.cpp:5
Vec3d operator*(Vec3d const &lhs, double rhs)
Definition utils_operators.cpp:81
Vec3d operator/(Vec3d const &lhs, double rhs)
Definition utils_operators.cpp:97
Vec3d operator-(Vec3d const &lhs, double rhs)
Definition utils_operators.cpp:65