Note: this is documentation for an old release. View the latest documentation at docs.fenicsproject.org/basix/v0.9.0/cpp/namespacebasix_1_1math.html

Basix 0.4.0

Home     Installation     Demos     C++ docs     Python docs

Functions
basix::math Namespace Reference

Mathematical functions. More...

Functions

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)
 

Detailed Description

Mathematical functions.

Note
The functions in this namespace are designed to be called multiple times at runtime, so their performance is critical.

Function Documentation

◆ 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
uThe first vector. It must has size 3.
vThe 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]AInput matrix
[in]BInput 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
[in]AInput matrix
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
[in]AThe matrix
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
uThe first vector. It must has size 3.
vThe 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]AThe matrix
[in]BRight-hand side matrix/vector
Returns
A^{-1} B