8#ifndef META_OCEAN_TEST_TESTMATH_TEST_SQUARE_MATRIX_4_H
9#define META_OCEAN_TEST_TESTMATH_TEST_SQUARE_MATRIX_4_H
41 static bool test(
const double testDuration,
Worker& worker);
104 template <
typename T>
113 template <
typename T>
122 template <
typename T>
131 template <
typename T>
140 template <
typename T>
149 template <
typename T>
165 template <
typename T>
177 template <
typename T>
187 template <
typename T>
194 return VectorT4<T>(matrix[0] * vector[0] + matrix[4] * vector[1] + matrix[8] * vector[2] + matrix[12] * vector[3],
195 matrix[1] * vector[0] + matrix[5] * vector[1] + matrix[9] * vector[2] + matrix[13] * vector[3],
196 matrix[2] * vector[0] + matrix[6] * vector[1] + matrix[10] * vector[2] + matrix[14] * vector[3],
197 matrix[3] * vector[0] + matrix[7] * vector[1] + matrix[11] * vector[2] + matrix[15] * vector[3]);
205 result[ 0] = matrix[0] * rightMatrix[ 0] + matrix[4] * rightMatrix[ 1] + matrix[ 8] * rightMatrix[ 2] + matrix[12] * rightMatrix[3];
206 result[ 1] = matrix[1] * rightMatrix[ 0] + matrix[5] * rightMatrix[ 1] + matrix[ 9] * rightMatrix[ 2] + matrix[13] * rightMatrix[3];
207 result[ 2] = matrix[2] * rightMatrix[ 0] + matrix[6] * rightMatrix[ 1] + matrix[10] * rightMatrix[ 2] + matrix[14] * rightMatrix[3];
208 result[ 3] = matrix[3] * rightMatrix[ 0] + matrix[7] * rightMatrix[ 1] + matrix[11] * rightMatrix[ 2] + matrix[15] * rightMatrix[3];
210 result[ 4] = matrix[0] * rightMatrix[ 4] + matrix[4] * rightMatrix[ 5] + matrix[ 8] * rightMatrix[ 6] + matrix[12] * rightMatrix[7];
211 result[ 5] = matrix[1] * rightMatrix[ 4] + matrix[5] * rightMatrix[ 5] + matrix[ 9] * rightMatrix[ 6] + matrix[13] * rightMatrix[7];
212 result[ 6] = matrix[2] * rightMatrix[ 4] + matrix[6] * rightMatrix[ 5] + matrix[10] * rightMatrix[ 6] + matrix[14] * rightMatrix[7];
213 result[ 7] = matrix[3] * rightMatrix[ 4] + matrix[7] * rightMatrix[ 5] + matrix[11] * rightMatrix[ 6] + matrix[15] * rightMatrix[7];
215 result[ 8] = matrix[0] * rightMatrix[ 8] + matrix[4] * rightMatrix[ 9] + matrix[ 8] * rightMatrix[10] + matrix[12] * rightMatrix[11];
216 result[ 9] = matrix[1] * rightMatrix[ 8] + matrix[5] * rightMatrix[ 9] + matrix[ 9] * rightMatrix[10] + matrix[13] * rightMatrix[11];
217 result[10] = matrix[2] * rightMatrix[ 8] + matrix[6] * rightMatrix[ 9] + matrix[10] * rightMatrix[10] + matrix[14] * rightMatrix[11];
218 result[11] = matrix[3] * rightMatrix[ 8] + matrix[7] * rightMatrix[ 9] + matrix[11] * rightMatrix[10] + matrix[15] * rightMatrix[11];
220 result[12] = matrix[0] * rightMatrix[12] + matrix[4] * rightMatrix[13] + matrix[ 8] * rightMatrix[14] + matrix[12] * rightMatrix[15];
221 result[13] = matrix[1] * rightMatrix[12] + matrix[5] * rightMatrix[13] + matrix[ 9] * rightMatrix[14] + matrix[13] * rightMatrix[15];
222 result[14] = matrix[2] * rightMatrix[12] + matrix[6] * rightMatrix[13] + matrix[10] * rightMatrix[14] + matrix[14] * rightMatrix[15];
223 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:32
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:201
static bool testMatrixSubtraction(const double testDuration)
Tests the matrix subtraction operators.
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 test(const double testDuration, Worker &worker)
Tests all square matrix 4x4 functions.
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:192
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 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