15 constexpr static double PI = 3.1415926535897932384626433832795028841971;
18 template <
typename T>
static int Sign(T val);
24 static double NormL2(
double val_0,
double val_1);
26 static double NormL2(
double val_0,
double val_1,
double val_2);
28 static double NormL2(
double val_0,
double val_1,
double val_2,
double val_3);
42 template <
size_t r,
size_t cr,
size_t c>
45 template <
size_t r,
size_t cr,
size_t c>
49 template <
size_t r,
size_t cr,
size_t c>
62 double rot_angle_sin,
Vec3d const &rot_axis);
65 Vec3d const &rot_axis);
96 return (T(0) < val) - (val < T(0));
101 for (
size_t i = 0; i < N; i++) {
102 res += val[i] * val[i];
104 return std::sqrt(res);
107template <
size_t r,
size_t cr,
size_t c>
111 for (
size_t i = 0; i < r; i++) {
112 for (
size_t j = 0; j < c; j++) {
117 for (
size_t i = 0; i < r; i++) {
118 for (
size_t k = 0; k < cr; k++) {
119 for (
size_t j = 0; j < c; j++) {
120 m_res[i][j] += m_1[i][k] * m_2[k][j];
128template <
size_t r,
size_t cr,
size_t c>
133 for (
size_t i = 0; i < r; i++) {
134 for (
size_t j = 0; j < c; j++) {
139 for (
size_t i = 0; i < r; i++) {
140 for (
size_t k = 0; k < cr; k++) {
141 for (
size_t j = 0; j < c; j++) {
142 m_res[i][j] += m_1[k][i] * m_2[k][j];
150template <
size_t r,
size_t cr,
size_t c>
155 for (
size_t i = 0; i < r; i++) {
156 for (
size_t j = 0; j < c; j++) {
161 for (
size_t i = 0; i < r; i++) {
162 for (
size_t j = 0; j < c; j++) {
163 for (
size_t k = 0; k < cr; k++) {
164 m_res[i][j] += m_1[i][k] * m_2[j][k];
Definition utils_math.hpp:75
static Vec4d FromMatrix(Mat3d const &rot_mat)
Definition utils_math.cpp:249
static Vec4d Multiply(Vec4d const &p, Vec4d const &q)
Definition utils_math.cpp:304
static Vec4d FromRodrigues(double rot_angle, Vec3d const &rot_axis)
Definition utils_math.cpp:214
static std::tuple< double, Vec3d > ToRodrigues(Vec4d const &quat)
Definition utils_math.cpp:228
static Mat3d ToMatrix(Vec4d const &quat)
Definition utils_math.cpp:286
static Vec4d Add(Vec4d const &p, Vec4d const &q)
Definition utils_math.cpp:319
static Vec4d Conjugate(Vec4d const &p)
Definition utils_math.cpp:330
static void Normalize(Vec4d *const q)
Definition utils_math.cpp:341
Definition utils_math.hpp:13
static Vec3d Cross(Vec3d const &val_1, Vec3d const &val_2)
Definition utils_math.cpp:94
static void Normalize(Vec3d *const val)
Definition utils_math.cpp:119
static Mat2d Inverse(Mat2d const &m_val)
Definition utils_math.cpp:52
static MatNd< r, c > DotTransportLHS(MatNd< cr, r > const &m_1, MatNd< cr, c > const &m_2)
Definition utils_math.hpp:129
static MatNd< r, c > DotTransportRHS(MatNd< r, cr > const &m_1, MatNd< c, cr > const &m_2)
Definition utils_math.hpp:151
static double NormL2(Vec2d const &val)
Definition utils_math.cpp:5
static double Determinant(Mat2d const &mat)
Definition utils_math.cpp:42
static Vec3d Rotate(Vec3d const &val_old, double rot_angle_cos, double rot_angle_sin, Vec3d const &rot_axis)
Definition utils_math.cpp:134
static constexpr double Infinity
Definition utils_math.hpp:16
static constexpr double PI
Definition utils_math.hpp:15
static int Sign(T val)
Definition utils_math.hpp:95
static Vec3d SphericalToCartesian(Vec3d const &vert_sph)
Definition utils_math.cpp:206
static MatNd< r, c > Dot(MatNd< r, cr > const &m_1, MatNd< cr, c > const &m_2)
Definition utils_math.hpp:108
static Vec3d CartesianToSpherical(Vec3d const &vert_cart)
Definition utils_math.cpp:198
Definition bond_entry.hpp:7
std::array< std::array< double, 3 >, 3 > Mat3d
Definition utils_macros.hpp:22
std::array< double, 2 > Vec2d
Definition utils_macros.hpp:17
std::vector< T > VecXT
Definition utils_macros.hpp:31
std::array< double, 3 > Vec3d
Definition utils_macros.hpp:18
std::array< std::array< double, Nc >, Nr > MatNd
Definition utils_macros.hpp:27
std::array< double, N > VecNd
Definition utils_macros.hpp:25
std::vector< double > VecXd
Definition utils_macros.hpp:29
std::array< double, 4 > Vec4d
Definition utils_macros.hpp:19
std::array< std::array< double, 2 >, 2 > Mat2d
Definition utils_macros.hpp:21