glucat  0.8.2
Classes | Enumerations | Functions
glucat::matrix Namespace Reference

Classes

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

Enumerations

enum  eig_case_t { safe_eig_case, negative_eig_case, both_eig_case }
 Classification of eigenvalues of a matrix. More...
 

Functions

template<typename LHS_T , typename RHS_T >
const RHS_T kron (const LHS_T &lhs, const RHS_T &rhs)
 Kronecker tensor product of matrices - as per Matlab kron. More...
 
template<typename LHS_T , typename RHS_T >
const RHS_T mono_kron (const LHS_T &lhs, const RHS_T &rhs)
 Sparse Kronecker tensor product of monomial matrices. More...
 
template<typename LHS_T , typename RHS_T >
const RHS_T nork (const LHS_T &lhs, const RHS_T &rhs, const bool mono=true)
 Left inverse of Kronecker product. More...
 
template<typename LHS_T , typename RHS_T >
const RHS_T signed_perm_nork (const LHS_T &lhs, const RHS_T &rhs)
 Left inverse of Kronecker product where lhs is a signed permutation matrix. More...
 
template<typename Matrix_T >
Matrix_T::size_type nnz (const Matrix_T &m)
 Number of non-zeros. More...
 
template<typename Matrix_T >
bool isnan (const Matrix_T &m)
 Not a Number. More...
 
template<typename Matrix_T >
const Matrix_T unit (const typename Matrix_T::size_type n)
 Unit matrix - as per Matlab eye. More...
 
template<typename LHS_T , typename RHS_T >
const RHS_T::expression_type mono_prod (const ublas::matrix_expression< LHS_T > &lhs, const ublas::matrix_expression< RHS_T > &rhs)
 Product of monomial matrices. More...
 
template<typename LHS_T , typename RHS_T >
const RHS_T::expression_type sparse_prod (const ublas::matrix_expression< LHS_T > &lhs, const ublas::matrix_expression< RHS_T > &rhs)
 Product of sparse matrices. More...
 
template<typename LHS_T , typename RHS_T >
const RHS_T::expression_type prod (const ublas::matrix_expression< LHS_T > &lhs, const ublas::matrix_expression< RHS_T > &rhs)
 Product of matrices. More...
 
template<typename Scalar_T , typename LHS_T , typename RHS_T >
Scalar_T inner (const LHS_T &lhs, const RHS_T &rhs)
 Inner product: sum(x(i,j)*y(i,j))/x.nrows() More...
 
template<typename Matrix_T >
Matrix_T::value_type norm_frob2 (const Matrix_T &val)
 Square of Frobenius norm. More...
 
template<typename Matrix_T >
Matrix_T::value_type trace (const Matrix_T &val)
 Matrix trace. More...
 
template<typename Matrix_T >
ublas::vector< std::complex< double > > eigenvalues (const Matrix_T &val)
 Eigenvalues of a matrix. More...
 
template<typename Matrix_T >
eig_genus< Matrix_T > classify_eigenvalues (const Matrix_T &val)
 Classify the eigenvalues of a matrix. More...
 
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. More...
 
template<typename Matrix_T >
static ublas::matrix< double, ublas::column_major > to_lapack (const Matrix_T &val)
 Convert matrix to LAPACK format. More...
 

Enumeration Type Documentation

◆ eig_case_t

Classification of eigenvalues of a matrix.

Enumerator
safe_eig_case 
negative_eig_case 
both_eig_case 

Definition at line 127 of file matrix.h.

Function Documentation

◆ classify_eigenvalues()

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

◆ eigenvalues()

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

Eigenvalues of a matrix.

Definition at line 493 of file matrix_imp.h.

References to_lapack().

Referenced by classify_eigenvalues().

◆ inner()

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

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 391 of file matrix_imp.h.

◆ isnan()

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

Not a Number.

Definition at line 292 of file matrix_imp.h.

Referenced by glucat::matrix_log(), and glucat::operator/().

◆ kron()

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

Kronecker tensor product of matrices - as per Matlab kron.

Definition at line 73 of file matrix_imp.h.

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

◆ mono_kron()

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

Sparse Kronecker tensor product of monomial matrices.

Definition at line 116 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 >
const RHS_T::expression_type glucat::matrix::mono_prod ( const ublas::matrix_expression< LHS_T > &  lhs,
const ublas::matrix_expression< RHS_T > &  rhs 
)

◆ nnz()

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

Number of non-zeros.

Definition at line 269 of file matrix_imp.h.

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

◆ nork()

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

Left inverse of Kronecker product.

Definition at line 188 of file matrix_imp.h.

References 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 155 of file matrix_imp.h.

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

◆ norm_frob2()

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

Square of Frobenius norm.

Definition at line 413 of file matrix_imp.h.

Referenced by nork().

◆ prod()

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

Product of matrices.

Definition at line 373 of file matrix_imp.h.

◆ signed_perm_nork()

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

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

Definition at line 237 of file matrix_imp.h.

Referenced by glucat::fast().

◆ sparse_prod()

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

Product of sparse matrices.

Definition at line 362 of file matrix_imp.h.

◆ to_lapack()

template<typename Matrix_T >
static ublas::matrix<double, ublas::column_major> glucat::matrix::to_lapack ( const Matrix_T &  val)
static

Convert matrix to LAPACK format.

Definition at line 461 of file matrix_imp.h.

Referenced by eigenvalues().

◆ trace()

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

Matrix trace.

Definition at line 437 of file matrix_imp.h.

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

◆ unit()

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

Unit matrix - as per Matlab eye.

Definition at line 317 of file matrix_imp.h.