glucat 0.13.0
glucat::matrix Namespace Reference

Classes

struct  eig_genus
 Structure containing classification of eigenvalues. More...

Typedefs

using eig_case_t
 Classification of eigenvalues of a matrix.

Functions

template<typename LHS_T, typename RHS_T>
auto kron (const LHS_T &lhs, const RHS_T &rhs) -> const RHS_T
 Kronecker tensor product of matrices - as per Matlab kron.
template<typename LHS_T, typename RHS_T>
auto mono_kron (const LHS_T &lhs, const RHS_T &rhs) -> const RHS_T
 Sparse Kronecker tensor product of monomial matrices.
template<typename LHS_T, typename RHS_T>
auto nork (const LHS_T &lhs, const RHS_T &rhs, const bool mono=true) -> const RHS_T
 Left inverse of Kronecker product.
template<typename LHS_T, typename RHS_T>
auto signed_perm_nork (const LHS_T &lhs, const RHS_T &rhs) -> const RHS_T
 Left inverse of Kronecker product where lhs is a signed permutation matrix.
template<typename Matrix_T>
auto nnz (const Matrix_T &m) -> typename Matrix_T::size_type
 Number of non-zeros.
template<typename Matrix_T>
auto isinf (const Matrix_T &m) -> bool
 Infinite.
template<typename Matrix_T>
auto isnan (const Matrix_T &m) -> bool
 Not a Number.
template<typename Matrix_T>
auto unit (const typename Matrix_T::size_type n) -> const Matrix_T
 Unit matrix - as per Matlab eye.
template<typename LHS_T, typename RHS_T>
auto mono_prod (const ublas::matrix_expression< LHS_T > &lhs, const ublas::matrix_expression< RHS_T > &rhs) -> const typename RHS_T::expression_type
 Product of monomial matrices.
template<typename LHS_T, typename RHS_T>
auto sparse_prod (const ublas::matrix_expression< LHS_T > &lhs, const ublas::matrix_expression< RHS_T > &rhs) -> const typename RHS_T::expression_type
 Product of sparse matrices.
template<typename LHS_T, typename RHS_T>
auto prod (const ublas::matrix_expression< LHS_T > &lhs, const ublas::matrix_expression< RHS_T > &rhs) -> const typename RHS_T::expression_type
 Product of matrices.
template<typename Scalar_T, typename LHS_T, typename RHS_T>
auto inner (const LHS_T &lhs, const RHS_T &rhs) -> Scalar_T
 Inner product: sum(x(i,j)*y(i,j))/x.nrows()
template<typename Matrix_T>
auto norm_frob2 (const Matrix_T &val) -> typename Matrix_T::value_type
 Square of Frobenius norm.
template<typename Matrix_T>
auto trace (const Matrix_T &val) -> typename Matrix_T::value_type
 Matrix trace.
template<typename Matrix_T>
auto eigenvalues (const Matrix_T &val) -> std::vector< std::complex< double > >
 Eigenvalues of a matrix.
template<typename Matrix_T>
auto classify_eigenvalues (const Matrix_T &val) -> eig_genus< Matrix_T >
 Classify the eigenvalues of a matrix.
template<typename LHS_T, typename RHS_T>
void nork_range (RHS_T &result, const typename LHS_T::const_iterator2 lhs_it2, const RHS_T &rhs, const typename RHS_T::size_type res_s1, const typename RHS_T::size_type res_s2)
 Utility routine for nork: calculate result for a range of indices.
template<typename Matrix_T>
static auto to_blaze (const Matrix_T &val) -> blaze::DynamicMatrix< double, blaze::rowMajor >
 Convert matrix to Blaze format.

Typedef Documentation

◆ eig_case_t

Initial value:
enum {
safe_eigs,
neg_real_eigs,
both_eigs}

Classification of eigenvalues of a matrix.

Definition at line 133 of file matrix.h.

Function Documentation

◆ classify_eigenvalues()

template<typename Matrix_T>
auto glucat::matrix::classify_eigenvalues ( const Matrix_T & val) -> eig_genus<Matrix_T>

◆ eigenvalues()

template<typename Matrix_T>
auto glucat::matrix::eigenvalues ( const Matrix_T & val) -> std::vector< std::complex<double> >

Eigenvalues of a matrix.

Definition at line 464 of file matrix_imp.h.

References to_blaze().

Referenced by classify_eigenvalues().

◆ inner()

template<typename Scalar_T, typename LHS_T, typename RHS_T>
auto glucat::matrix::inner ( const LHS_T & lhs,
const RHS_T & rhs ) -> Scalar_T

Inner product: sum(x(i,j)*y(i,j))/x.nrows()

Inner product: sum(lhs(i,j)*rhs(i,j))/lhs.nrows()

Definition at line 368 of file matrix_imp.h.

Referenced by glucat::framed_multi< Scalar_T, LO, HI, Tune_P >::framed_multi().

◆ isinf()

template<typename Matrix_T>
auto glucat::matrix::isinf ( const Matrix_T & m) -> bool

Infinite.

Definition at line 270 of file matrix_imp.h.

References glucat::numeric_traits< Scalar_T >::isInf().

◆ isnan()

template<typename Matrix_T>
auto glucat::matrix::isnan ( const Matrix_T & m) -> bool

Not a Number.

Definition at line 287 of file matrix_imp.h.

References glucat::numeric_traits< Scalar_T >::isNaN().

Referenced by glucat::operator/().

◆ kron()

template<typename LHS_T, typename RHS_T>
auto glucat::matrix::kron ( const LHS_T & lhs,
const RHS_T & rhs ) -> const RHS_T

Kronecker tensor product of matrices - as per Matlab kron.

Definition at line 78 of file matrix_imp.h.

Referenced by glucat::framed_multi< Scalar_T, LO, HI, Tune_P >::fast().

◆ mono_kron()

template<typename LHS_T, typename RHS_T>
auto glucat::matrix::mono_kron ( const LHS_T & lhs,
const RHS_T & rhs ) -> const RHS_T

Sparse Kronecker tensor product of monomial matrices.

Definition at line 114 of file matrix_imp.h.

Referenced by glucat::gen::generator_table< Matrix_T >::gen_from_pm1_qm1().

◆ mono_prod()

template<typename LHS_T, typename RHS_T>
auto glucat::matrix::mono_prod ( const ublas::matrix_expression< LHS_T > & lhs,
const ublas::matrix_expression< RHS_T > & rhs ) -> const typename RHS_T::expression_type

◆ nnz()

template<typename Matrix_T>
auto glucat::matrix::nnz ( const Matrix_T & m) -> typename Matrix_T::size_type

Number of non-zeros.

Definition at line 253 of file matrix_imp.h.

Referenced by glucat::framed_multi< Scalar_T, LO, HI, Tune_P >::framed_multi().

◆ nork()

template<typename LHS_T, typename RHS_T>
auto glucat::matrix::nork ( const LHS_T & lhs,
const RHS_T & rhs,
const bool mono = true ) -> const RHS_T

Left inverse of Kronecker product.

Definition at line 177 of file matrix_imp.h.

References nork_range(), and norm_frob2().

◆ nork_range()

template<typename LHS_T, typename RHS_T>
void glucat::matrix::nork_range ( RHS_T & result,
const typename LHS_T::const_iterator2 lhs_it2,
const RHS_T & rhs,
const typename RHS_T::size_type res_s1,
const typename RHS_T::size_type res_s2 )

Utility routine for nork: calculate result for a range of indices.

Definition at line 147 of file matrix_imp.h.

References glucat::numeric_traits< Scalar_T >::to_scalar_t().

Referenced by nork(), and signed_perm_nork().

◆ norm_frob2()

template<typename Matrix_T>
auto glucat::matrix::norm_frob2 ( const Matrix_T & val) -> typename Matrix_T::value_type

Square of Frobenius norm.

Definition at line 390 of file matrix_imp.h.

References glucat::numeric_traits< Scalar_T >::isNaN(), and glucat::numeric_traits< Scalar_T >::NaN().

Referenced by nork().

◆ prod()

template<typename LHS_T, typename RHS_T>
auto glucat::matrix::prod ( const ublas::matrix_expression< LHS_T > & lhs,
const ublas::matrix_expression< RHS_T > & rhs ) -> const typename RHS_T::expression_type
inline

Product of matrices.

Definition at line 356 of file matrix_imp.h.

◆ signed_perm_nork()

template<typename LHS_T, typename RHS_T>
auto glucat::matrix::signed_perm_nork ( const LHS_T & lhs,
const RHS_T & rhs ) -> const RHS_T

Left inverse of Kronecker product where lhs is a signed permutation matrix.

Definition at line 223 of file matrix_imp.h.

References nork_range().

Referenced by glucat::fast().

◆ sparse_prod()

template<typename LHS_T, typename RHS_T>
auto glucat::matrix::sparse_prod ( const ublas::matrix_expression< LHS_T > & lhs,
const ublas::matrix_expression< RHS_T > & rhs ) -> const typename RHS_T::expression_type
inline

Product of sparse matrices.

Definition at line 345 of file matrix_imp.h.

◆ to_blaze()

template<typename Matrix_T>
auto glucat::matrix::to_blaze ( const Matrix_T & val) -> blaze::DynamicMatrix<double,blaze::rowMajor>
static

Convert matrix to Blaze format.

Definition at line 435 of file matrix_imp.h.

Referenced by eigenvalues().

◆ trace()

template<typename Matrix_T>
auto glucat::matrix::trace ( const Matrix_T & val) -> typename Matrix_T::value_type

◆ unit()

template<typename Matrix_T>
auto glucat::matrix::unit ( const typename Matrix_T::size_type n) -> const Matrix_T
inline