Matrix4x4-Impl.h
Go to the documentation of this file.
321 m_elements[0] + m.m_elements[0], m_elements[1] + m.m_elements[1], m_elements[2] + m.m_elements[2], m_elements[3] + m.m_elements[3],
322 m_elements[4] + m.m_elements[4], m_elements[5] + m.m_elements[5], m_elements[6] + m.m_elements[6], m_elements[7] + m.m_elements[7],
323 m_elements[8] + m.m_elements[8], m_elements[9] + m.m_elements[9], m_elements[10] + m.m_elements[10], m_elements[11] + m.m_elements[11],
324 m_elements[12] + m.m_elements[12], m_elements[13] + m.m_elements[13], m_elements[14] + m.m_elements[14], m_elements[15] + m.m_elements[15]);
341 m_elements[0] - m.m_elements[0], m_elements[1] - m.m_elements[1], m_elements[2] - m.m_elements[2], m_elements[3] - m.m_elements[3],
342 m_elements[4] - m.m_elements[4], m_elements[5] - m.m_elements[5], m_elements[6] - m.m_elements[6], m_elements[7] - m.m_elements[7],
343 m_elements[8] - m.m_elements[8], m_elements[9] - m.m_elements[9], m_elements[10] - m.m_elements[10], m_elements[11] - m.m_elements[11],
344 m_elements[12] - m.m_elements[12], m_elements[13] - m.m_elements[13], m_elements[14] - m.m_elements[14], m_elements[15] - m.m_elements[15]);
371 m_elements[0] * m.m_elements[0] + m_elements[1] * m.m_elements[4] + m_elements[2] * m.m_elements[8] + m_elements[3] * m.m_elements[12],
372 m_elements[0] * m.m_elements[1] + m_elements[1] * m.m_elements[5] + m_elements[2] * m.m_elements[9] + m_elements[3] * m.m_elements[13],
373 m_elements[0] * m.m_elements[2] + m_elements[1] * m.m_elements[6] + m_elements[2] * m.m_elements[10] + m_elements[3] * m.m_elements[14],
374 m_elements[0] * m.m_elements[3] + m_elements[1] * m.m_elements[7] + m_elements[2] * m.m_elements[11] + m_elements[3] * m.m_elements[15],
376 m_elements[4] * m.m_elements[0] + m_elements[5] * m.m_elements[4] + m_elements[6] * m.m_elements[8] + m_elements[7] * m.m_elements[12],
377 m_elements[4] * m.m_elements[1] + m_elements[5] * m.m_elements[5] + m_elements[6] * m.m_elements[9] + m_elements[7] * m.m_elements[13],
378 m_elements[4] * m.m_elements[2] + m_elements[5] * m.m_elements[6] + m_elements[6] * m.m_elements[10] + m_elements[7] * m.m_elements[14],
379 m_elements[4] * m.m_elements[3] + m_elements[5] * m.m_elements[7] + m_elements[6] * m.m_elements[11] + m_elements[7] * m.m_elements[15],
381 m_elements[8] * m.m_elements[0] + m_elements[9] * m.m_elements[4] + m_elements[10] * m.m_elements[8] + m_elements[11] * m.m_elements[12],
382 m_elements[8] * m.m_elements[1] + m_elements[9] * m.m_elements[5] + m_elements[10] * m.m_elements[9] + m_elements[11] * m.m_elements[13],
383 m_elements[8] * m.m_elements[2] + m_elements[9] * m.m_elements[6] + m_elements[10] * m.m_elements[10] + m_elements[11] * m.m_elements[14],
384 m_elements[8] * m.m_elements[3] + m_elements[9] * m.m_elements[7] + m_elements[10] * m.m_elements[11] + m_elements[11] * m.m_elements[15],
386 m_elements[12] * m.m_elements[0] + m_elements[13] * m.m_elements[4] + m_elements[14] * m.m_elements[8] + m_elements[15] * m.m_elements[12],
387 m_elements[12] * m.m_elements[1] + m_elements[13] * m.m_elements[5] + m_elements[14] * m.m_elements[9] + m_elements[15] * m.m_elements[13],
388 m_elements[12] * m.m_elements[2] + m_elements[13] * m.m_elements[6] + m_elements[14] * m.m_elements[10] + m_elements[15] * m.m_elements[14],
389 m_elements[12] * m.m_elements[3] + m_elements[13] * m.m_elements[7] + m_elements[14] * m.m_elements[11] + m_elements[15] * m.m_elements[15]);
416 m.m_elements[0] + m_elements[0], m.m_elements[1] + m_elements[1], m.m_elements[2] + m_elements[2], m.m_elements[3] + m_elements[3],
417 m.m_elements[4] + m_elements[4], m.m_elements[5] + m_elements[5], m.m_elements[6] + m_elements[6], m.m_elements[7] + m_elements[7],
418 m.m_elements[8] + m_elements[8], m.m_elements[9] + m_elements[9], m.m_elements[10] + m_elements[10], m.m_elements[11] + m_elements[11],
419 m.m_elements[12] + m_elements[12], m.m_elements[13] + m_elements[13], m.m_elements[14] + m_elements[14], m.m_elements[15] + m_elements[15]);
436 m.m_elements[0] - m_elements[0], m.m_elements[1] - m_elements[1], m.m_elements[2] - m_elements[2], m.m_elements[3] - m_elements[3],
437 m.m_elements[4] - m_elements[4], m.m_elements[5] - m_elements[5], m.m_elements[6] - m_elements[6], m.m_elements[7] - m_elements[7],
438 m.m_elements[8] - m_elements[8], m.m_elements[9] - m_elements[9], m.m_elements[10] - m_elements[10], m.m_elements[11] - m_elements[11],
439 m.m_elements[12] - m_elements[12], m.m_elements[13] - m_elements[13], m.m_elements[14] - m_elements[14], m.m_elements[15] - m_elements[15]);
617 m.m_elements[0] = m_elements[5] * m_elements[10] * m_elements[15] + m_elements[6] * m_elements[11] * m_elements[13] + m_elements[7] * m_elements[9] * m_elements[14] - m_elements[5] * m_elements[11] * m_elements[14] - m_elements[6] * m_elements[9] * m_elements[15] - m_elements[7] * m_elements[10] * m_elements[13];
618 m.m_elements[1] = m_elements[1] * m_elements[11] * m_elements[14] + m_elements[2] * m_elements[9] * m_elements[15] + m_elements[3] * m_elements[10] * m_elements[13] - m_elements[1] * m_elements[10] * m_elements[15] - m_elements[2] * m_elements[11] * m_elements[13] - m_elements[3] * m_elements[9] * m_elements[14];
619 m.m_elements[2] = m_elements[1] * m_elements[6] * m_elements[15] + m_elements[2] * m_elements[7] * m_elements[13] + m_elements[3] * m_elements[5] * m_elements[14] - m_elements[1] * m_elements[7] * m_elements[14] - m_elements[2] * m_elements[5] * m_elements[15] - m_elements[3] * m_elements[6] * m_elements[13];
620 m.m_elements[3] = m_elements[1] * m_elements[7] * m_elements[10] + m_elements[2] * m_elements[5] * m_elements[11] + m_elements[3] * m_elements[6] * m_elements[9] - m_elements[1] * m_elements[6] * m_elements[11] - m_elements[2] * m_elements[7] * m_elements[9] - m_elements[3] * m_elements[5] * m_elements[10];
621 m.m_elements[4] = m_elements[4] * m_elements[11] * m_elements[14] + m_elements[6] * m_elements[8] * m_elements[15] + m_elements[7] * m_elements[10] * m_elements[12] - m_elements[4] * m_elements[10] * m_elements[15] - m_elements[6] * m_elements[11] * m_elements[12] - m_elements[7] * m_elements[8] * m_elements[14];
622 m.m_elements[5] = m_elements[0] * m_elements[10] * m_elements[15] + m_elements[2] * m_elements[11] * m_elements[12] + m_elements[3] * m_elements[8] * m_elements[14] - m_elements[0] * m_elements[11] * m_elements[14] - m_elements[2] * m_elements[8] * m_elements[15] - m_elements[3] * m_elements[10] * m_elements[12];
623 m.m_elements[6] = m_elements[0] * m_elements[7] * m_elements[14] + m_elements[2] * m_elements[4] * m_elements[15] + m_elements[3] * m_elements[6] * m_elements[12] - m_elements[0] * m_elements[6] * m_elements[15] - m_elements[2] * m_elements[7] * m_elements[12] - m_elements[3] * m_elements[4] * m_elements[14];
624 m.m_elements[7] = m_elements[0] * m_elements[6] * m_elements[11] + m_elements[2] * m_elements[7] * m_elements[8] + m_elements[3] * m_elements[4] * m_elements[10] - m_elements[0] * m_elements[7] * m_elements[10] - m_elements[2] * m_elements[4] * m_elements[11] - m_elements[3] * m_elements[6] * m_elements[8];
625 m.m_elements[8] = m_elements[4] * m_elements[9] * m_elements[15] + m_elements[5] * m_elements[11] * m_elements[12] + m_elements[7] * m_elements[8] * m_elements[13] - m_elements[4] * m_elements[11] * m_elements[13] - m_elements[5] * m_elements[8] * m_elements[15] - m_elements[7] * m_elements[9] * m_elements[12];
626 m.m_elements[9] = m_elements[0] * m_elements[11] * m_elements[13] + m_elements[1] * m_elements[8] * m_elements[15] + m_elements[3] * m_elements[9] * m_elements[12] - m_elements[0] * m_elements[9] * m_elements[15] - m_elements[1] * m_elements[11] * m_elements[12] - m_elements[3] * m_elements[8] * m_elements[13];
627 m.m_elements[10] = m_elements[0] * m_elements[5] * m_elements[15] + m_elements[1] * m_elements[7] * m_elements[12] + m_elements[3] * m_elements[4] * m_elements[13] - m_elements[0] * m_elements[7] * m_elements[13] - m_elements[1] * m_elements[4] * m_elements[15] - m_elements[3] * m_elements[5] * m_elements[12];
628 m.m_elements[11] = m_elements[0] * m_elements[7] * m_elements[9] + m_elements[1] * m_elements[4] * m_elements[11] + m_elements[3] * m_elements[5] * m_elements[8] - m_elements[0] * m_elements[5] * m_elements[11] - m_elements[1] * m_elements[7] * m_elements[8] - m_elements[3] * m_elements[4] * m_elements[9];
629 m.m_elements[12] = m_elements[4] * m_elements[10] * m_elements[13] + m_elements[5] * m_elements[8] * m_elements[14] + m_elements[6] * m_elements[9] * m_elements[12] - m_elements[4] * m_elements[9] * m_elements[14] - m_elements[5] * m_elements[10] * m_elements[12] - m_elements[6] * m_elements[8] * m_elements[13];
630 m.m_elements[13] = m_elements[0] * m_elements[9] * m_elements[14] + m_elements[1] * m_elements[10] * m_elements[12] + m_elements[2] * m_elements[8] * m_elements[13] - m_elements[0] * m_elements[10] * m_elements[13] - m_elements[1] * m_elements[8] * m_elements[14] - m_elements[2] * m_elements[9] * m_elements[12];
631 m.m_elements[14] = m_elements[0] * m_elements[6] * m_elements[13] + m_elements[1] * m_elements[4] * m_elements[14] + m_elements[2] * m_elements[5] * m_elements[12] - m_elements[0] * m_elements[5] * m_elements[14] - m_elements[1] * m_elements[6] * m_elements[12] - m_elements[2] * m_elements[4] * m_elements[13];
632 m.m_elements[15] = m_elements[0] * m_elements[5] * m_elements[10] + m_elements[1] * m_elements[6] * m_elements[8] + m_elements[2] * m_elements[4] * m_elements[9] - m_elements[0] * m_elements[6] * m_elements[9] - m_elements[1] * m_elements[4] * m_elements[10] - m_elements[2] * m_elements[5] * m_elements[8];
660 return m_elements[std::distance(std::begin(m_elements), std::min_element(std::begin(m_elements), std::end(m_elements)))];
666 return m_elements[std::distance(std::begin(m_elements), std::max_element(std::begin(m_elements), std::end(m_elements)))];
691 m_elements[0] * m_elements[5] * m_elements[10] * m_elements[15] + m_elements[0] * m_elements[6] * m_elements[11] * m_elements[13] + m_elements[0] * m_elements[7] * m_elements[9] * m_elements[14] +
692 m_elements[1] * m_elements[4] * m_elements[11] * m_elements[14] + m_elements[1] * m_elements[6] * m_elements[8] * m_elements[15] + m_elements[1] * m_elements[7] * m_elements[10] * m_elements[12] +
693 m_elements[2] * m_elements[4] * m_elements[9] * m_elements[15] + m_elements[2] * m_elements[5] * m_elements[11] * m_elements[12] + m_elements[2] * m_elements[7] * m_elements[8] * m_elements[13] +
694 m_elements[3] * m_elements[4] * m_elements[10] * m_elements[13] + m_elements[3] * m_elements[5] * m_elements[8] * m_elements[14] + m_elements[3] * m_elements[6] * m_elements[9] * m_elements[12] -
695 m_elements[0] * m_elements[5] * m_elements[11] * m_elements[14] - m_elements[0] * m_elements[6] * m_elements[9] * m_elements[15] - m_elements[0] * m_elements[7] * m_elements[10] * m_elements[13] -
696 m_elements[1] * m_elements[4] * m_elements[10] * m_elements[15] - m_elements[1] * m_elements[6] * m_elements[11] * m_elements[12] - m_elements[1] * m_elements[7] * m_elements[8] * m_elements[14] -
697 m_elements[2] * m_elements[4] * m_elements[11] * m_elements[13] - m_elements[2] * m_elements[5] * m_elements[8] * m_elements[15] - m_elements[2] * m_elements[7] * m_elements[9] * m_elements[12] -
698 m_elements[3] * m_elements[4] * m_elements[9] * m_elements[14] - m_elements[3] * m_elements[5] * m_elements[10] * m_elements[12] - m_elements[3] * m_elements[6] * m_elements[8] * m_elements[13];
Matrix Mul(T s) const
Returns this matrix * input scalar.
Definition: Matrix4x4-Impl.h:348
bool IsSimilar(const MatrixExpression< T, E > &other, double tol=std::numeric_limits< double >::epsilon()) const
Definition: Matrix-Impl.h:169
static MatrixConstant< T > MakeZero()
Makes a M x N matrix with zeros.
Definition: Matrix-Impl.h:823
MatrixDiagonal< T, Matrix > Diagonal() const
Returns diagonal part of this matrix.
Definition: Matrix-Impl.h:633
MatrixDiagonal< T, Matrix > OffDiagonal() const
Returns off-diagonal part of this matrix.
Definition: Matrix-Impl.h:639
Matrix & operator*=(const T &s)
Multiplication assignment with input scalar.
Definition: Matrix-Impl.h:737
Matrix & operator/=(const T &s)
Division assignment with input scalar.
Definition: Matrix-Impl.h:752
Matrix RDiv(T s) const
Returns input matrix / this scalar.
Definition: Matrix4x4-Impl.h:459
void SetDiagonal(const T &s)
Sets diagonal elements with input scalar.
Definition: Matrix-Impl.h:92
Matrix< T, 2, 2 > operator+(const Matrix< T, 2, 2 > &a, const Matrix< T, 2, 2 > &b)
Returns a + b (element-size).
Definition: Matrix2x2-Impl.h:660
void IMul(const T &s)
Multiplies input scalar to this matrix.
Definition: Matrix-Impl.h:376
MatrixScalarRSub< T, Matrix > RSub(const T &s) const
Returns input scalar - this matrix.
Definition: Matrix-Impl.h:318
Matrix Div(T s) const
Returns this matrix / input scalar.
Definition: Matrix4x4-Impl.h:393
T AbsMaxN(const T *x, size_t n)
Returns absolute maximum among n-elements.
Definition: MathUtils-Impl.h:64
void IAdd(const T &s)
Adds input scalar to this matrix.
Definition: Matrix-Impl.h:350
void Set(const T &s)
Sets whole matrix with input scalar.
Definition: Matrix-Impl.h:52
MatrixScalarAdd< T, Matrix > Add(const T &s) const
Returns this matrix + input scalar.
Definition: Matrix-Impl.h:253
void SetRow(size_t i, const VectorExpression< T, E > &row)
Sets i-th row with input vector.
Definition: Matrix-Impl.h:116
void IDiv(const T &s)
Divides this matrix with input scalar.
Definition: Matrix-Impl.h:390
bool operator!=(const MatrixExpression< T, E > &m) const
Returns true if is not equal to m.
Definition: Matrix-Impl.h:791
Matrix Sub(T s) const
Returns this matrix - input scalar.
Definition: Matrix4x4-Impl.h:328
void ISub(const T &s)
Subtracts input scalar from this matrix.
Definition: Matrix-Impl.h:363
Matrix RSub(T s) const
Returns input scalar - this matrix.
Definition: Matrix4x4-Impl.h:423
constexpr size_t Cols() const
Returns number of columns of this matrix.
Definition: Matrix-Impl.h:211
T Max() const
Returns maximum among all elements.
Definition: Matrix-Impl.h:515
Matrix & operator+=(const T &s)
Addition assignment with input scalar.
Definition: Matrix-Impl.h:707
MatrixScalarDiv< T, Matrix > Div(const T &s) const
Returns this matrix / input scalar.
Definition: Matrix-Impl.h:299
MatrixScalarSub< T, Matrix > Sub(const T &s) const
Returns this matrix - input scalar.
Definition: Matrix-Impl.h:266
Matrix Inverse() const
Returns inverse matrix.
Definition: Matrix-Impl.h:677
MatrixScalarMul< T, Matrix > RMul(const T &s) const
Returns input scalar * this matrix.
Definition: Matrix-Impl.h:331
MatrixScalarAdd< T, Matrix > RAdd(const T &s) const
Returns input scalar + this matrix.
Definition: Matrix-Impl.h:305
T AbsMinN(const T *x, size_t n)
Returns absolute minimum among n-elements.
Definition: MathUtils-Impl.h:51
MatrixScalarMul< T, Matrix > Mul(const T &s) const
Returns this matrix * input scalar.
Definition: Matrix-Impl.h:279
Matrix Add(T s) const
Returns this matrix + input scalar.
Definition: Matrix4x4-Impl.h:308
Matrix< T, 2, 2 > operator/(const Matrix< T, 2, 2 > &a, T b)
Definition: Matrix2x2-Impl.h:720
Definition: pybind11Utils.h:24
T & operator[](size_t i)
Returns reference of i-th element.
Definition: Matrix-Impl.h:759
bool operator==(const MatrixExpression< T, E > &m) const
Returns true if is equal to m.
Definition: Matrix-Impl.h:784
constexpr bool IsSquare() const
Returns true if this matrix is a square matrix.
Definition: Matrix-Impl.h:193
Matrix< T, 2, 2 > operator-(const Matrix< T, 2, 2 > &a)
Returns a matrix with opposite sign.
Definition: Matrix2x2-Impl.h:654
Matrix & operator-=(const T &s)
Subtraction assignment with input scalar.
Definition: Matrix-Impl.h:722
const Matrix< T, M, N > & operator()() const
Returns actual implementation (the subclass).
Definition: MatrixExpression-Impl.h:34
T Determinant() const
Returns determinant of this matrix.
Definition: Matrix-Impl.h:569
Matrix RMul(T s) const
Returns input scalar * this matrix.
Definition: Matrix4x4-Impl.h:443
static MatrixIdentity< T > MakeIdentity()
Makes a M x N matrix with all diagonal elements to 1, and other elements to 0.
Definition: Matrix-Impl.h:829
T Min() const
Returns minimum among all elements.
Definition: Matrix-Impl.h:502
T AbsMin() const
Returns absolute minimum among all elements.
Definition: Matrix-Impl.h:528
Vector< T, 3 > operator*(const Quaternion< T > &q, const Vector< T, 3 > &v)
Returns quaternion q * vector v.
Definition: Quaternion-Impl.h:481
void SetOffDiagonal(const T &s)
Sets off-diagonal elements with input scalar.
Definition: Matrix-Impl.h:103
MatrixTypeCast< U, Matrix, T > CastTo() const
MatrixScalarRDiv< T, Matrix > RDiv(const T &s) const
Returns input matrix / this scalar.
Definition: Matrix-Impl.h:344
constexpr size_t Rows() const
Returns number of rows of this matrix.
Definition: Matrix-Impl.h:205
Matrix< T, N, M > Transposed() const
Returns transposed matrix.
Definition: Matrix-Impl.h:669
T AbsMax() const
Returns absolute maximum among all elements.
Definition: Matrix-Impl.h:541
Matrix RAdd(T s) const
Returns input scalar + this matrix.
Definition: Matrix4x4-Impl.h:403
void SetColumn(size_t j, const VectorExpression< T, E > &col)
Sets j-th column with input vector.
Definition: Matrix-Impl.h:130