|
Basix
|
Mathematical functions. More...
Functions | |
| template<typename U, typename V> | |
| std::pair< std::vector< typename U::value_type >, std::array< std::size_t, 2 > > | outer (const U &u, const V &v) |
| Compute the outer product of vectors u and v. | |
| template<typename U, typename V> | |
| std::array< typename U::value_type, 3 > | cross (const U &u, const V &v) |
| Compute the cross product u x v. | |
| template<std::floating_point T> | |
| std::pair< std::vector< T >, std::vector< T > > | eigh (std::span< const T > A, std::size_t n) |
| Compute the eigenvalues and eigenvectors of a square Hermitian matrix A. | |
| template<std::floating_point T> | |
| std::vector< T > | solve (md::mdspan< const T, md::dextents< std::size_t, 2 > > A, md::mdspan< const T, md::dextents< std::size_t, 2 > > B) |
| Solve A X = B. | |
| template<std::floating_point T> | |
| bool | is_singular (md::mdspan< const T, md::dextents< std::size_t, 2 > > A) |
| Check if A is a singular matrix. | |
| template<std::floating_point T> | |
| std::vector< std::size_t > | transpose_lu (std::pair< std::vector< T >, std::array< std::size_t, 2 > > &A) |
| Compute the LU decomposition of the transpose of a square matrix A. | |
| template<typename U, typename V, typename W> | |
| void | dot (const U &A, const V &B, W &&C, typename std::decay_t< U >::value_type alpha=1, typename std::decay_t< U >::value_type beta=0) |
| Compute C = alpha A * B + beta C. | |
| template<std::floating_point T> | |
| std::vector< T > | eye (std::size_t n) |
| Build an identity matrix. | |
| template<std::floating_point T> | |
| void | orthogonalise (md::mdspan< T, md::dextents< std::size_t, 2 > > wcoeffs, std::size_t start=0) |
| Orthogonalise the rows of a matrix (in place). | |
Mathematical functions.
| std::pair< std::vector< typename U::value_type >, std::array< std::size_t, 2 > > basix::math::outer | ( | const U & | u, |
| const V & | v ) |
Compute the outer product of vectors u and v.
| u | The first vector. |
| v | The second vector. |
| std::array< typename U::value_type, 3 > basix::math::cross | ( | const U & | u, |
| const V & | v ) |
Compute the cross product u x v.
| u | The first vector. It must has size 3. |
| v | The second vector. It must has size 3. |
| std::pair< std::vector< T >, std::vector< T > > basix::math::eigh | ( | std::span< const T > | A, |
| std::size_t | n ) |
Compute the eigenvalues and eigenvectors of a square Hermitian matrix A.
| [in] | A | Input matrix, row-major storage. |
| [in] | n | Number of rows. |
| std::vector< T > basix::math::solve | ( | md::mdspan< const T, md::dextents< std::size_t, 2 > > | A, |
| md::mdspan< const T, md::dextents< std::size_t, 2 > > | B ) |
Solve A X = B.
| [in] | A | The matrix. |
| [in] | B | Right-hand side matrix/vector. |
| bool basix::math::is_singular | ( | md::mdspan< const T, md::dextents< std::size_t, 2 > > | A | ) |
Check if A is a singular matrix.
| [in] | A | The matrix. |
| std::vector< std::size_t > basix::math::transpose_lu | ( | std::pair< std::vector< T >, std::array< std::size_t, 2 > > & | A | ) |
Compute the LU decomposition of the transpose of a square matrix A.
| [in,out] | A | The matrix. |
| void basix::math::dot | ( | const U & | A, |
| const V & | B, | ||
| W && | C, | ||
| typename std::decay_t< U >::value_type | alpha = 1, | ||
| typename std::decay_t< U >::value_type | beta = 0 ) |
Compute C = alpha A * B + beta C.
| [in] | A | Input matrix |
| [in] | B | Input matrix |
| [out] | C | Output matrix. Must be sized correctly before calling this function. |
| [in] | alpha | |
| [in] | beta |
| std::vector< T > basix::math::eye | ( | std::size_t | n | ) |
Build an identity matrix.
| [in] | n | The number of rows/columns. |
| void basix::math::orthogonalise | ( | md::mdspan< T, md::dextents< std::size_t, 2 > > | wcoeffs, |
| std::size_t | start = 0 ) |
Orthogonalise the rows of a matrix (in place).
| [in] | wcoeffs | The matrix. |
| [in] | start | The row to start from. The rows before this should already be orthogonal. |