3#include "_cexports/c_core_3d.h"
7#include "point_3d_h.hpp"
8#include "matrix_3d.hpp"
53 return {{1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0}};
67 template <std::
size_t N>
70 static_assert(N == 16,
"CVB: Matrix3D must have 16 elements");
109 return matrix_[row].data();
120 return matrix_[row].data();
130 const double &
At(
int row,
int column)
const noexcept
132 return (*
this)[row][column];
130 const double &
At(
int row,
int column)
const noexcept {
…}
142 double &
At(
int row,
int column)
noexcept
144 return (*
this)[row][column];
142 double &
At(
int row,
int column)
noexcept {
…}
155 return matrix_ == matrix.matrix_;
166 return !(*
this == matrix);
177 *
this = *
this + matrix;
189 *
this = *
this - matrix;
201 for (
auto &line : matrix_)
202 for (
auto &element : line)
215 for (
auto &line : matrix_)
216 for (
auto &element : line)
228 lhs[0][0] + rhs[0][0],
229 lhs[0][1] + rhs[0][1],
230 lhs[0][2] + rhs[0][2],
231 lhs[0][3] + rhs[0][3],
232 lhs[1][0] + rhs[1][0],
233 lhs[1][1] + rhs[1][1],
234 lhs[1][2] + rhs[1][2],
235 lhs[1][3] + rhs[1][3],
236 lhs[2][0] + rhs[2][0],
237 lhs[2][1] + rhs[2][1],
238 lhs[2][2] + rhs[2][2],
239 lhs[2][3] + rhs[2][3],
240 lhs[3][0] + rhs[3][0],
241 lhs[3][1] + rhs[3][1],
242 lhs[3][2] + rhs[3][2],
243 lhs[3][3] + rhs[3][3],
250 lhs[0][0] - rhs[0][0],
251 lhs[0][1] - rhs[0][1],
252 lhs[0][2] - rhs[0][2],
253 lhs[0][3] - rhs[0][3],
254 lhs[1][0] - rhs[1][0],
255 lhs[1][1] - rhs[1][1],
256 lhs[1][2] - rhs[1][2],
257 lhs[1][3] - rhs[1][3],
258 lhs[2][0] - rhs[2][0],
259 lhs[2][1] - rhs[2][1],
260 lhs[2][2] - rhs[2][2],
261 lhs[2][3] - rhs[2][3],
262 lhs[3][0] - rhs[3][0],
263 lhs[3][1] - rhs[3][1],
264 lhs[3][2] - rhs[3][2],
265 lhs[3][3] - rhs[3][3],
281 lhs[0][0] * rhs[0] + lhs[0][1] * rhs[1] + lhs[0][2] * rhs[2] + lhs[0][3] * rhs[3],
282 lhs[1][0] * rhs[0] + lhs[1][1] * rhs[1] + lhs[1][2] * rhs[2] + lhs[1][3] * rhs[3],
283 lhs[2][0] * rhs[0] + lhs[2][1] * rhs[1] + lhs[2][2] * rhs[2] + lhs[2][3] * rhs[3],
284 lhs[3][0] * rhs[0] + lhs[3][1] * rhs[1] + lhs[3][2] * rhs[2] + lhs[3][3] * rhs[3],
344 return {{lhs[0][0] / rhs, lhs[0][1] / rhs, lhs[0][2] / rhs, lhs[0][3] / rhs, lhs[1][0] / rhs, lhs[1][1] / rhs,
345 lhs[1][2] / rhs, lhs[1][3] / rhs, lhs[2][0] / rhs, lhs[2][1] / rhs, lhs[2][2] / rhs, lhs[2][3] / rhs,
346 lhs[3][0] / rhs, lhs[3][1] / rhs, lhs[3][2] / rhs, lhs[3][3] / rhs}};
Double precision row-major 4x4 matrix.
Definition matrix_3d_h.hpp:44
const double & At(int row, int column) const noexcept
Index based element access.
Definition matrix_3d_h.hpp:130
Matrix3DH operator*(const double &lhs, const Matrix3DH &rhs)
Multiply scalar with matrix .
Definition matrix_3d_h.hpp:328
const double * operator[](int row) const noexcept
Index based element access.
Definition matrix_3d_h.hpp:107
double * operator[](int row) noexcept
Index based element access.
Definition matrix_3d_h.hpp:118
Matrix3DH(const Matrix3D &matrix) noexcept
Create a homogeneous matrix from a matrix.
Definition matrix_3d_h.hpp:79
Matrix3DH & operator/=(const double &value) noexcept
Divides each element of this matrix by the given value.
Definition matrix_3d_h.hpp:213
Matrix3DH() noexcept=default
Default constructor for empty matrix.
Matrix3DH operator/(const Matrix3DH &lhs, const double &rhs)
Divide matrix by scalar.
Definition matrix_3d_h.hpp:342
Matrix3DH & operator-=(const Matrix3DH &matrix) noexcept
Subtracts and assigns to this matrix.
Definition matrix_3d_h.hpp:187
Matrix3DH & operator+=(const Matrix3DH &matrix) noexcept
Adds and assigns to this matrix.
Definition matrix_3d_h.hpp:175
Matrix3DH operator*(const Matrix3DH &lhs, const double &rhs)
Multiply matrix with scalar.
Definition matrix_3d_h.hpp:297
bool operator!=(const Matrix3DH &matrix) const noexcept
Compares to an other matrix.
Definition matrix_3d_h.hpp:164
double & At(int row, int column) noexcept
Index based element access.
Definition matrix_3d_h.hpp:142
Matrix3DH & operator*=(const double &value) noexcept
Multiplies and assigns to this matrix.
Definition matrix_3d_h.hpp:199
Point3DH< double > operator*(const Matrix3DH &lhs, const Point3DH< double > &rhs)
Multiply matrix with 3D point (homogeneous).
Definition matrix_3d_h.hpp:278
static Matrix3DH Identity() noexcept
The identity element.
Definition matrix_3d_h.hpp:51
bool operator==(const Matrix3DH &matrix) const noexcept
Compares to an other matrix.
Definition matrix_3d_h.hpp:153
Double precision 3x3 matrix class.
Definition matrix_3d.hpp:54
Multi-purpose 3D vector class (homogeneous).
Definition point_3d_h.hpp:22
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17
AffineMatrix2D operator+(const AffineMatrix2D &lhs, const AffineMatrix2D &rhs) noexcept
Add two affine matrices.
Definition affine_matrix_2d.hpp:223
AffineMatrix2D operator-(const AffineMatrix2D &lhs, const AffineMatrix2D &rhs) noexcept
Subtract two affine matrices.
Definition affine_matrix_2d.hpp:237