8#ifndef META_OCEAN_TEST_TESTMATH_TEST_SQUARE_MATRIX_4_H
9#define META_OCEAN_TEST_TESTMATH_TEST_SQUARE_MATRIX_4_H
107 template <
typename T>
116 template <
typename T>
125 template <
typename T>
134 template <
typename T>
143 template <
typename T>
152 template <
typename T>
168 template <
typename T>
180 template <
typename T>
190 template <
typename T>
197 return VectorT4<T>(matrix[0] * vector[0] + matrix[4] * vector[1] + matrix[8] * vector[2] + matrix[12] * vector[3],
198 matrix[1] * vector[0] + matrix[5] * vector[1] + matrix[9] * vector[2] + matrix[13] * vector[3],
199 matrix[2] * vector[0] + matrix[6] * vector[1] + matrix[10] * vector[2] + matrix[14] * vector[3],
200 matrix[3] * vector[0] + matrix[7] * vector[1] + matrix[11] * vector[2] + matrix[15] * vector[3]);
208 result[ 0] = matrix[0] * rightMatrix[ 0] + matrix[4] * rightMatrix[ 1] + matrix[ 8] * rightMatrix[ 2] + matrix[12] * rightMatrix[3];
209 result[ 1] = matrix[1] * rightMatrix[ 0] + matrix[5] * rightMatrix[ 1] + matrix[ 9] * rightMatrix[ 2] + matrix[13] * rightMatrix[3];
210 result[ 2] = matrix[2] * rightMatrix[ 0] + matrix[6] * rightMatrix[ 1] + matrix[10] * rightMatrix[ 2] + matrix[14] * rightMatrix[3];
211 result[ 3] = matrix[3] * rightMatrix[ 0] + matrix[7] * rightMatrix[ 1] + matrix[11] * rightMatrix[ 2] + matrix[15] * rightMatrix[3];
213 result[ 4] = matrix[0] * rightMatrix[ 4] + matrix[4] * rightMatrix[ 5] + matrix[ 8] * rightMatrix[ 6] + matrix[12] * rightMatrix[7];
214 result[ 5] = matrix[1] * rightMatrix[ 4] + matrix[5] * rightMatrix[ 5] + matrix[ 9] * rightMatrix[ 6] + matrix[13] * rightMatrix[7];
215 result[ 6] = matrix[2] * rightMatrix[ 4] + matrix[6] * rightMatrix[ 5] + matrix[10] * rightMatrix[ 6] + matrix[14] * rightMatrix[7];
216 result[ 7] = matrix[3] * rightMatrix[ 4] + matrix[7] * rightMatrix[ 5] + matrix[11] * rightMatrix[ 6] + matrix[15] * rightMatrix[7];
218 result[ 8] = matrix[0] * rightMatrix[ 8] + matrix[4] * rightMatrix[ 9] + matrix[ 8] * rightMatrix[10] + matrix[12] * rightMatrix[11];
219 result[ 9] = matrix[1] * rightMatrix[ 8] + matrix[5] * rightMatrix[ 9] + matrix[ 9] * rightMatrix[10] + matrix[13] * rightMatrix[11];
220 result[10] = matrix[2] * rightMatrix[ 8] + matrix[6] * rightMatrix[ 9] + matrix[10] * rightMatrix[10] + matrix[14] * rightMatrix[11];
221 result[11] = matrix[3] * rightMatrix[ 8] + matrix[7] * rightMatrix[ 9] + matrix[11] * rightMatrix[10] + matrix[15] * rightMatrix[11];
223 result[12] = matrix[0] * rightMatrix[12] + matrix[4] * rightMatrix[13] + matrix[ 8] * rightMatrix[14] + matrix[12] * rightMatrix[15];
224 result[13] = matrix[1] * rightMatrix[12] + matrix[5] * rightMatrix[13] + matrix[ 9] * rightMatrix[14] + matrix[13] * rightMatrix[15];
225 result[14] = matrix[2] * rightMatrix[12] + matrix[6] * rightMatrix[13] + matrix[10] * rightMatrix[14] + matrix[14] * rightMatrix[15];
226 result[15] = matrix[3] * rightMatrix[12] + matrix[7] * rightMatrix[13] + matrix[11] * rightMatrix[14] + matrix[15] * rightMatrix[15];
This class implements a 4x4 square matrix.
Definition SquareMatrix4.h:85
This class implements a test for 4x4 square matrices.
Definition TestSquareMatrix4.h:34
static OCEAN_FORCE_INLINE SquareMatrixT4< T > standardMatrixMultiplication(const SquareMatrixT4< T > &matrix, const SquareMatrixT4< T > &rightMatrix)
Standard implementation of a multiplication between a 4x4 matrix and a 4x4 matrix.
Definition TestSquareMatrix4.h:204
static bool testMatrixSubtraction(const double testDuration)
Tests the matrix subtraction operators.
static bool test(const double testDuration, Worker &worker, const TestSelector &selector)
Tests all square matrix 4x4 functions.
static bool testProjectionMatrixCameraMatrix(const double testDuration)
Tests the projection matrix function with camera matrix.
static bool testEigenSystem(const double testDuration)
Tests the eigenSystem function.
static bool testProjectionMatrixFieldOfView(const double testDuration)
Tests the projection matrix function with field of view.
static bool testTranspose(const double testDuration)
Tests the transpose functions.
static bool testElementConstructor(const double testDuration)
Tests the element-based constructor.
static bool testDeterminant(const double testDuration)
Tests the determinant function.
static bool testVectorMultiplication(const double testDuration, Worker &worker)
Tests the vector multiplication operator.
static bool testWriteToMessenger()
Tests the messenger function.
static bool testMatrixAddition(const double testDuration)
Tests the matrix addition operators.
static bool testMatrixConversion(const double testDuration)
Tests the matrix conversion functions.
static bool testAccessor(const double testDuration)
Tests the accessor operators.
static OCEAN_FORCE_INLINE VectorT4< T > standardVectorMultiplication(const SquareMatrixT4< T > &matrix, const VectorT4< T > &vector)
Standard implementation of a multiplication between a 4x4 matrix and a 4x1 vector.
Definition TestSquareMatrix4.h:195
static bool testMatrixMultiplication(const double testDuration)
Tests the matrix multiplication operator.
static bool testTrace(const double testDuration)
Tests the trace function.
static bool testInvert(const double testDuration)
Tests the invert functions.
This class implements a test selector that parses test function strings and determines which tests sh...
Definition TestSelector.h:51
This class implements a vector with four elements.
Definition Vector4.h:97
This class implements a worker able to distribute function calls over different threads.
Definition Worker.h:33
The namespace covering the entire Ocean framework.
Definition Accessor.h:15