1#ifndef _GLUCAT_MATRIX_H
2#define _GLUCAT_MATRIX_H
35#include <boost/numeric/ublas/fwd.hpp>
42 namespace ublas = boost::numeric::ublas;
47 template<
typename LHS_T,
typename RHS_T >
49 kron(
const LHS_T& lhs,
const RHS_T& rhs) ->
const
53 template<
typename LHS_T,
typename RHS_T >
55 mono_kron(
const LHS_T& lhs,
const RHS_T& rhs) ->
const
59 template<
typename LHS_T,
typename RHS_T >
61 nork(
const LHS_T& lhs,
const RHS_T& rhs,
const bool mono =
true) ->
const
65 template<
typename LHS_T,
typename RHS_T >
71 template<
typename Matrix_T >
73 nnz(
const Matrix_T& m) ->
typename Matrix_T::size_type;
76 template<
typename Matrix_T >
78 isinf(
const Matrix_T& m) -> bool;
81 template<
typename Matrix_T >
83 isnan(
const Matrix_T& m) -> bool;
86 template<
typename Matrix_T >
88 unit(
const typename Matrix_T::size_type n) ->
const
92 template<
typename LHS_T,
typename RHS_T >
94 mono_prod(
const ublas::matrix_expression<LHS_T>& lhs,
95 const ublas::matrix_expression<RHS_T>& rhs) ->
const
96 typename RHS_T::expression_type;
99 template<
typename LHS_T,
typename RHS_T >
101 sparse_prod(
const ublas::matrix_expression<LHS_T>& lhs,
102 const ublas::matrix_expression<RHS_T>& rhs) ->
const
103 typename RHS_T::expression_type;
106 template<
typename LHS_T,
typename RHS_T >
108 prod(
const ublas::matrix_expression<LHS_T>& lhs,
109 const ublas::matrix_expression<RHS_T>& rhs) ->
const
110 typename RHS_T::expression_type;
113 template<
typename Scalar_T,
typename LHS_T,
typename RHS_T >
115 inner(
const LHS_T& lhs,
const RHS_T& rhs) -> Scalar_T;
118 template<
typename Matrix_T >
120 norm_frob2(
const Matrix_T& val) ->
typename Matrix_T::value_type;
123 template<
typename Matrix_T >
125 trace(
const Matrix_T& val) ->
typename Matrix_T::value_type;
128 template<
typename Matrix_T >
130 eigenvalues(
const Matrix_T& val) -> std::vector< std::complex<double> >;
139 template<
typename Matrix_T >
152 template<
typename Matrix_T >
auto nork(const LHS_T &lhs, const RHS_T &rhs, const bool mono=true) -> const RHS_T
Left inverse of Kronecker product.
auto inner(const LHS_T &lhs, const RHS_T &rhs) -> Scalar_T
Inner product: sum(x(i,j)*y(i,j))/x.nrows()
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.
auto trace(const Matrix_T &val) -> typename Matrix_T::value_type
Matrix trace.
enum { safe_eigs, neg_real_eigs, both_eigs} eig_case_t
Classification of eigenvalues of a matrix.
auto isinf(const Matrix_T &m) -> bool
Infinite.
auto nnz(const Matrix_T &m) -> typename Matrix_T::size_type
Number of non-zeros.
auto mono_kron(const LHS_T &lhs, const RHS_T &rhs) -> const RHS_T
Sparse Kronecker tensor product of monomial matrices.
auto eigenvalues(const Matrix_T &val) -> std::vector< std::complex< double > >
Eigenvalues of a matrix.
auto norm_frob2(const Matrix_T &val) -> typename Matrix_T::value_type
Square of Frobenius norm.
auto classify_eigenvalues(const Matrix_T &val) -> eig_genus< Matrix_T >
Classify the eigenvalues of a matrix.
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.
auto kron(const LHS_T &lhs, const RHS_T &rhs) -> const RHS_T
Kronecker tensor product of matrices - as per Matlab kron.
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.
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.
auto unit(const typename Matrix_T::size_type n) -> const Matrix_T
Unit matrix - as per Matlab eye.
auto isnan(const Matrix_T &m) -> bool
Not a Number.
Structure containing classification of eigenvalues.
bool m_is_singular
Is the matrix singular?
typename Matrix_T::value_type Scalar_T
Scalar_T m_safe_arg
Argument such that exp(pi-m_safe_arg) lies between arguments of eigenvalues.
eig_case_t m_eig_case
What kind of eigenvalues does the matrix contain?