Mathematical functions.
More...
|
template<typename U , typename V > |
xt::xtensor< typename U::value_type, 2 > | outer (const U &u, const V &v) |
|
template<typename U , typename V > |
xt::xtensor_fixed< typename U::value_type, xt::xshape< 3 > > | cross (const U &u, const V &v) |
|
template<typename U , typename V > |
xt::xtensor< typename U::value_type, 2 > | dot (const U &A, const V &B) |
|
std::pair< xt::xtensor< double, 1 >, xt::xtensor< double, 2, xt::layout_type::column_major > > | eigh (const xt::xtensor< double, 2 > &A) |
|
xt::xarray< double, xt::layout_type::column_major > | solve (const xt::xtensor< double, 2 > &A, const xt::xarray< double > &B) |
|
bool | is_singular (const xt::xtensor< double, 2 > &A) |
|
Mathematical functions.
- Note
- The functions in this namespace are designed to be called multiple times at runtime, so their performance is critical.
◆ cross()
template<typename U , typename V >
xt::xtensor_fixed<typename U::value_type, xt::xshape<3> > basix::math::cross |
( |
const U & |
u, |
|
|
const V & |
v |
|
) |
| |
Compute the cross product u x v
- Parameters
-
u | The first vector. It must has size 3. |
v | The second vector. It must has size 3. |
- Returns
- The cross product
u x v
. The type will be the same as u
.
◆ dot()
template<typename U , typename V >
xt::xtensor<typename U::value_type, 2> basix::math::dot |
( |
const U & |
A, |
|
|
const V & |
B |
|
) |
| |
Compute C = A * B
- Parameters
-
[in] | A | Input matrix |
[in] | B | Input matrix return A * B |
◆ eigh()
std::pair< xt::xtensor< double, 1 >, xt::xtensor< double, 2, xt::layout_type::column_major > > basix::math::eigh |
( |
const xt::xtensor< double, 2 > & |
A | ) |
|
Compute the eigenvalues and eigenvectors of a square Hermitian matrix A
- Parameters
-
- Returns
- Eigenvalues and eigenvectors
◆ is_singular()
bool basix::math::is_singular |
( |
const xt::xtensor< double, 2 > & |
A | ) |
|
Check if A is a singular matrix
- Parameters
-
- Returns
- A bool indicating if the matrix is singular
◆ outer()
template<typename U , typename V >
xt::xtensor<typename U::value_type, 2> basix::math::outer |
( |
const U & |
u, |
|
|
const V & |
v |
|
) |
| |
Compute the outer product of vectors u and v
- Parameters
-
u | The first vector. It must has size 3. |
v | The second vector. It must has size 3. |
- Returns
- The outer product. The type will be the same as
u
.
◆ solve()
xt::xarray< double, xt::layout_type::column_major > basix::math::solve |
( |
const xt::xtensor< double, 2 > & |
A, |
|
|
const xt::xarray< double > & |
B |
|
) |
| |
Solve A X = B
- Parameters
-
[in] | A | The matrix |
[in] | B | Right-hand side matrix/vector |
- Returns
- A^{-1} B