36 template< std::ptrdiff_t M,
typename MATRIX >
51 template< std::ptrdiff_t M,
typename DST_MATRIX,
typename SRC_MATRIX >
53 auto invert( DST_MATRIX && LVARRAY_RESTRICT_REF dstMatrix,
54 SRC_MATRIX
const & LVARRAY_RESTRICT_REF srcMatrix )
56 static_assert( std::is_floating_point< std::decay_t< decltype( dstMatrix[ 0 ][ 0 ] ) > >::value,
57 "The destination matrix must be contain floating point values." );
69 template< std::ptrdiff_t M,
typename MATRIX >
73 static_assert( std::is_floating_point< std::decay_t< decltype( matrix[ 0 ][ 0 ] ) > >::value,
74 "The matrix must be contain floating point values." );
98 template< std::ptrdiff_t M,
typename DST_VECTOR,
typename SYM_MATRIX_A,
typename VECTOR_B >
101 SYM_MATRIX_A
const & LVARRAY_RESTRICT_REF symMatrixA,
102 VECTOR_B
const & LVARRAY_RESTRICT_REF vectorB )
120 template< std::ptrdiff_t M,
typename DST_VECTOR,
typename SYM_MATRIX_A,
typename VECTOR_B >
123 SYM_MATRIX_A
const & LVARRAY_RESTRICT_REF symMatrixA,
124 VECTOR_B
const & LVARRAY_RESTRICT_REF vectorB )
143 template< std::ptrdiff_t M,
typename DST_MATRIX,
typename SYM_MATRIX_A,
typename MATRIX_B >
146 SYM_MATRIX_A
const & LVARRAY_RESTRICT_REF symMatrixA,
147 MATRIX_B
const & LVARRAY_RESTRICT_REF matrixB )
168 template< std::ptrdiff_t M,
typename DST_SYM_MATRIX,
typename MATRIX_A,
typename SYM_MATRIX_B >
171 MATRIX_A
const & LVARRAY_RESTRICT_REF matrixA,
172 SYM_MATRIX_B
const & LVARRAY_RESTRICT_REF symMatrixB )
189 template< std::ptrdiff_t M,
typename DST_SYM_MATRIX,
typename VECTOR_A >
192 VECTOR_A
const & LVARRAY_RESTRICT_REF vectorA )
210 template< std::ptrdiff_t M,
typename DST_SYM_MATRIX,
typename VECTOR_A,
typename VECTOR_B >
213 VECTOR_A
const & LVARRAY_RESTRICT_REF vectorA,
214 VECTOR_B
const & LVARRAY_RESTRICT_REF vectorB )
227 template< std::ptrdiff_t M,
typename SYM_MATRIX >
242 template< std::ptrdiff_t M,
typename DST_SYM_MATRIX,
typename SRC_SYM_MATRIX >
244 auto symInvert( DST_SYM_MATRIX && LVARRAY_RESTRICT_REF dstSymMatrix,
245 SRC_SYM_MATRIX
const & LVARRAY_RESTRICT_REF srcSymMatrix )
247 static_assert( std::is_floating_point< std::decay_t< decltype( dstSymMatrix[ 0 ] ) > >::value,
248 "The destination matrix must be contain floating point values." );
260 template< std::ptrdiff_t M,
typename SYM_MATRIX >
264 static_assert( std::is_floating_point< std::decay_t< decltype( symMatrix[ 0 ] ) > >::value,
265 "The matrix must be contain floating point values." );
283 template< std::ptrdiff_t M,
typename DST_VECTOR,
typename SYM_MATRIX >
286 SYM_MATRIX
const & LVARRAY_RESTRICT_REF symMatrix )
288 static_assert( std::is_floating_point< std::decay_t< decltype( eigenvalues[ 0 ] ) > >::value,
289 "eigenvalues must be contain floating point values." );
310 template< std::ptrdiff_t M,
typename DST_VECTOR,
typename DST_MATRIX,
typename SYM_MATRIX >
313 DST_MATRIX && LVARRAY_RESTRICT_REF eigenvectors,
314 SYM_MATRIX
const & LVARRAY_RESTRICT_REF symMatrix )
316 static_assert( std::is_floating_point< std::decay_t< decltype( eigenvalues[ 0 ] ) > >::value,
317 "eigenvalues must be contain floating point values." );
318 static_assert( std::is_floating_point< std::decay_t< decltype( eigenvectors[ 0 ][ 0 ] ) > >::value,
319 "eigenvectors must be contain floating point values." );
321 std::forward< DST_MATRIX >( eigenvectors ),
333 template< std::ptrdiff_t M,
typename DST_SYM_MATRIX,
typename SRC_MATRIX >
349 template< std::ptrdiff_t M,
typename DST_MATRIX,
typename SRC_SYM_MATRIX >
LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK void Ri_eq_symAijBj(DST_VECTOR &&LVARRAY_RESTRICT_REF dstVector, SYM_MATRIX_A const &LVARRAY_RESTRICT_REF symMatrixA, VECTOR_B const &LVARRAY_RESTRICT_REF vectorB)
Multiply the vector vectorB by the symmetric matrix symMatrixA and store the result in dstVector...
Definition: fixedSizeSquareMatrixOps.hpp:100
LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK void symRij_eq_AiBj_plus_AjBi(DST_SYM_MATRIX &&LVARRAY_RESTRICT_REF dstMatrix, VECTOR_A const &LVARRAY_RESTRICT_REF vectorA, VECTOR_B const &LVARRAY_RESTRICT_REF vectorB)
Perform the unscaled symmetric outer product of vectorA and vectorB with itself writing the result to...
Definition: fixedSizeSquareMatrixOps.hpp:212
LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK void Rij_eq_symAikBjk(DST_MATRIX &&LVARRAY_RESTRICT_REF dstMatrix, SYM_MATRIX_A const &LVARRAY_RESTRICT_REF symMatrixA, MATRIX_B const &LVARRAY_RESTRICT_REF matrixB)
Multiply the transpose of matrix matrixB by the symmetric matrix symMatrixA and store the result in d...
Definition: fixedSizeSquareMatrixOps.hpp:145
LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK void symEigenvectors(DST_VECTOR &&LVARRAY_RESTRICT_REF eigenvalues, DST_MATRIX &&LVARRAY_RESTRICT_REF eigenvectors, SYM_MATRIX const &LVARRAY_RESTRICT_REF symMatrix)
Compute the eigenvalues and eigenvectors of the symmetric matrix symMatrix.
Definition: fixedSizeSquareMatrixOps.hpp:312
LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK auto invert(DST_MATRIX &&LVARRAY_RESTRICT_REF dstMatrix, SRC_MATRIX const &LVARRAY_RESTRICT_REF srcMatrix)
Invert the source matrix srcMatrix and store the result in dstMatrix.
Definition: fixedSizeSquareMatrixOps.hpp:53
LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK auto symDeterminant(SYM_MATRIX const &symMatrix)
Definition: fixedSizeSquareMatrixOps.hpp:229
LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK auto invert(MATRIX &&matrix)
Invert the matrix matrix overwritting it.
Definition: fixedSizeSquareMatrixOps.hpp:71
Contains the implementation of arbitrary sized vector and matrix operations.
#define CONSTEXPR_WITHOUT_BOUNDS_CHECK
Expands to constexpr when array bound checking is disabled.
Definition: Macros.hpp:609
Contains the implementation of the 2x2 and 3x3 matrix operations.
LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK void Ri_add_symAijBj(DST_VECTOR &&LVARRAY_RESTRICT_REF dstVector, SYM_MATRIX_A const &LVARRAY_RESTRICT_REF symMatrixA, VECTOR_B const &LVARRAY_RESTRICT_REF vectorB)
Multiply the vector vectorB by the symmetric matrix symMatrixA and add the result to dstVector...
Definition: fixedSizeSquareMatrixOps.hpp:122
The top level namespace.
Definition: Array.hpp:24
LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK void Rij_eq_AikSymBklAjl(DST_SYM_MATRIX &&LVARRAY_RESTRICT_REF dstSymMatrix, MATRIX_A const &LVARRAY_RESTRICT_REF matrixA, SYM_MATRIX_B const &LVARRAY_RESTRICT_REF symMatrixB)
Multiply the transpose of matrix matrixA by the symmetric matrix symMatrixB then by matrixA and store...
Definition: fixedSizeSquareMatrixOps.hpp:170
LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK auto symInvert(SYM_MATRIX &&symMatrix)
Invert the symmetric matrix symMatrix overwritting it.
Definition: fixedSizeSquareMatrixOps.hpp:262
LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK auto determinant(MATRIX const &matrix)
Definition: fixedSizeSquareMatrixOps.hpp:38
LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK void symRij_eq_AiAj(DST_SYM_MATRIX &&LVARRAY_RESTRICT_REF dstMatrix, VECTOR_A const &LVARRAY_RESTRICT_REF vectorA)
Perform the outer product of vectorA with itself writing the result to dstMatrix. ...
Definition: fixedSizeSquareMatrixOps.hpp:191
LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK auto symInvert(DST_SYM_MATRIX &&LVARRAY_RESTRICT_REF dstSymMatrix, SRC_SYM_MATRIX const &LVARRAY_RESTRICT_REF srcSymMatrix)
Invert the symmetric matrix srcSymMatrix and store the result in dstSymMatrix.
Definition: fixedSizeSquareMatrixOps.hpp:244
LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK void symEigenvalues(DST_VECTOR &&LVARRAY_RESTRICT_REF eigenvalues, SYM_MATRIX const &LVARRAY_RESTRICT_REF symMatrix)
Compute the eigenvalues of the symmetric matrix symMatrix.
Definition: fixedSizeSquareMatrixOps.hpp:285
LVARRAY_HOST_DEVICE constexpr void denseToSymmetric(DST_SYM_MATRIX &&dstSymMatrix, SRC_MATRIX const &srcMatrix)
Convert the upper triangular part of srcMatrix to a symmetric matrix.
Definition: fixedSizeSquareMatrixOps.hpp:335
#define LVARRAY_HOST_DEVICE
Mark a function for both host and device usage.
Definition: Macros.hpp:549
LVARRAY_HOST_DEVICE constexpr void symmetricToDense(DST_MATRIX &&dstMatrix, SRC_SYM_MATRIX const &srcSymMatrix)
Convert the srcSymMatrix into a dense matrix.
Definition: fixedSizeSquareMatrixOps.hpp:351