shark::blas::triangular_matrix< T, Orientation, TriangularType > Class Template Reference

#include <shark/LinAlg/BLAS/triangular_matrix.hpp>

+ Inheritance diagram for shark::blas::triangular_matrix< T, Orientation, TriangularType >:

Classes

class  major1_iterator
 
class  major2_iterator
 

Public Types

typedef value_type const_reference
 
typedef value_type reference
 
typedef const T * const_pointer
 
typedef T * pointer
 
typedef index_type const * const_index_pointer
 
typedef index_type index_pointer
 
typedef packed_tag storage_category
 
typedef elementwise_tag evaluation_category
 
typedef packed< Orientation, TriangularType > orientation
 
typedef boost::mpl::if_< boost::is_same< Orientation, row_major >, dense_storage_iterator< value_type >, typename boost::mpl::if_c< TriangularType::is_upper, major1_iterator< value_type >, major2_iterator< value_type > >::type >::type row_iterator
 
typedef boost::mpl::if_< boost::is_same< Orientation, row_major >, typename boost::mpl::if_c< TriangularType::is_upper, major2_iterator< value_type >, major1_iterator< value_type > >::type, dense_storage_iterator< value_type > >::type column_iterator
 
typedef boost::mpl::if_< boost::is_same< Orientation, row_major >, dense_storage_iterator< value_type const >, typename boost::mpl::if_c< TriangularType::is_upper, major1_iterator< value_type const >, major2_iterator< value_type const > >::type >::type const_row_iterator
 
typedef boost::mpl::if_< boost::is_same< Orientation, row_major >, typename boost::mpl::if_c< TriangularType::is_upper, major2_iterator< value_type const >, major1_iterator< value_type const > >::type, dense_storage_iterator< value_type const > >::type const_column_iterator
 

Public Member Functions

 triangular_matrix ()
 Default triangular_matrix constructor. Make a dense matrix of size (0,0) More...
 
 triangular_matrix (size_type size)
 
 triangular_matrix (size_type size, scalar_type init)
 
 triangular_matrix (const triangular_matrix &m)
 
template<class E >
 triangular_matrix (matrix_expression< E > const &e)
 
size_type size1 () const
 Returns the number of rows of the matrix. More...
 
size_type size2 () const
 Returns the number of columns of the matrix. More...
 
const_pointer storage () const
 Returns the pointer to the beginning of the matrix storage. More...
 
pointer storage ()
 Returns the pointer to the beginning of the matrix storage. More...
 
size_type nnz () const
 Number of nonzero-elements stores in the matrix. More...
 
void resize (size_type size)
 
void resize (size_type size1, size_type size2)
 
void clear ()
 
const_reference operator() (index_type i, index_type j) const
 
void set_element (std::size_t i, std::size_t j, value_type t)
 
bool non_zero (std::size_t i, std::size_t j) const
 
triangular_matrixoperator= (triangular_matrix m)
 
template<class C >
triangular_matrixoperator= (const matrix_container< C > &m)
 
template<class E >
triangular_matrixoperator= (matrix_expression< E > const &e)
 
void swap (triangular_matrix &m)
 
const_row_iterator row_begin (index_type i) const
 
const_row_iterator row_end (index_type i) const
 
row_iterator row_begin (index_type i)
 
row_iterator row_end (index_type i)
 
const_column_iterator column_begin (index_type i) const
 
const_column_iterator column_end (index_type i) const
 
column_iterator column_begin (index_type i)
 
column_iterator column_end (index_type i)
 
template<class Archive >
void serialize (Archive &ar, const unsigned int)
 
- Public Member Functions inherited from shark::blas::matrix_container< triangular_matrix< T, Orientation, TriangularType > >
const container_type & operator() () const
 
container_type & operator() ()
 
- Public Member Functions inherited from shark::blas::matrix_expression< E >
const expression_type & operator() () const
 
expression_type & operator() ()
 

Friends

void swap (triangular_matrix &m1, triangular_matrix &m2)
 

Detailed Description

template<class T, class Orientation, class TriangularType>
class shark::blas::triangular_matrix< T, Orientation, TriangularType >

Definition at line 44 of file triangular_matrix.hpp.

Member Typedef Documentation

§ column_iterator

template<class T , class Orientation , class TriangularType >
typedef boost::mpl::if_< boost::is_same<Orientation,row_major>, typename boost::mpl::if_c< TriangularType::is_upper, major2_iterator<value_type>, major1_iterator<value_type> >::type, dense_storage_iterator<value_type> >::type shark::blas::triangular_matrix< T, Orientation, TriangularType >::column_iterator

Definition at line 413 of file triangular_matrix.hpp.

§ const_column_iterator

template<class T , class Orientation , class TriangularType >
typedef boost::mpl::if_< boost::is_same<Orientation,row_major>, typename boost::mpl::if_c< TriangularType::is_upper, major2_iterator<value_type const>, major1_iterator<value_type const> >::type, dense_storage_iterator<value_type const> >::type shark::blas::triangular_matrix< T, Orientation, TriangularType >::const_column_iterator

Definition at line 432 of file triangular_matrix.hpp.

§ const_index_pointer

template<class T , class Orientation , class TriangularType >
typedef index_type const* shark::blas::triangular_matrix< T, Orientation, TriangularType >::const_index_pointer

Definition at line 58 of file triangular_matrix.hpp.

§ const_pointer

template<class T , class Orientation , class TriangularType >
typedef const T* shark::blas::triangular_matrix< T, Orientation, TriangularType >::const_pointer

Definition at line 54 of file triangular_matrix.hpp.

§ const_reference

template<class T , class Orientation , class TriangularType >
typedef value_type shark::blas::triangular_matrix< T, Orientation, TriangularType >::const_reference

Definition at line 52 of file triangular_matrix.hpp.

§ const_row_iterator

template<class T , class Orientation , class TriangularType >
typedef boost::mpl::if_< boost::is_same<Orientation,row_major>, dense_storage_iterator<value_type const>, typename boost::mpl::if_c< TriangularType::is_upper, major1_iterator<value_type const>, major2_iterator<value_type const> >::type >::type shark::blas::triangular_matrix< T, Orientation, TriangularType >::const_row_iterator

Definition at line 423 of file triangular_matrix.hpp.

§ evaluation_category

template<class T , class Orientation , class TriangularType >
typedef elementwise_tag shark::blas::triangular_matrix< T, Orientation, TriangularType >::evaluation_category

Definition at line 64 of file triangular_matrix.hpp.

§ index_pointer

template<class T , class Orientation , class TriangularType >
typedef index_type shark::blas::triangular_matrix< T, Orientation, TriangularType >::index_pointer

Definition at line 59 of file triangular_matrix.hpp.

§ orientation

template<class T , class Orientation , class TriangularType >
typedef packed<Orientation,TriangularType> shark::blas::triangular_matrix< T, Orientation, TriangularType >::orientation

Definition at line 65 of file triangular_matrix.hpp.

§ pointer

template<class T , class Orientation , class TriangularType >
typedef T* shark::blas::triangular_matrix< T, Orientation, TriangularType >::pointer

Definition at line 55 of file triangular_matrix.hpp.

§ reference

template<class T , class Orientation , class TriangularType >
typedef value_type shark::blas::triangular_matrix< T, Orientation, TriangularType >::reference

Definition at line 53 of file triangular_matrix.hpp.

§ row_iterator

template<class T , class Orientation , class TriangularType >
typedef boost::mpl::if_< boost::is_same<Orientation,row_major>, dense_storage_iterator<value_type>, typename boost::mpl::if_c< TriangularType::is_upper, major1_iterator<value_type>, major2_iterator<value_type> >::type >::type shark::blas::triangular_matrix< T, Orientation, TriangularType >::row_iterator

Definition at line 404 of file triangular_matrix.hpp.

§ storage_category

template<class T , class Orientation , class TriangularType >
typedef packed_tag shark::blas::triangular_matrix< T, Orientation, TriangularType >::storage_category

Definition at line 63 of file triangular_matrix.hpp.

Constructor & Destructor Documentation

§ triangular_matrix() [1/5]

template<class T , class Orientation , class TriangularType >
shark::blas::triangular_matrix< T, Orientation, TriangularType >::triangular_matrix ( )
inline

Default triangular_matrix constructor. Make a dense matrix of size (0,0)

Definition at line 70 of file triangular_matrix.hpp.

§ triangular_matrix() [2/5]

template<class T , class Orientation , class TriangularType >
shark::blas::triangular_matrix< T, Orientation, TriangularType >::triangular_matrix ( size_type  size)
inline

Packed matrix constructor with defined size

Parameters
sizenumber of rows and columns

Definition at line 75 of file triangular_matrix.hpp.

§ triangular_matrix() [3/5]

template<class T , class Orientation , class TriangularType >
shark::blas::triangular_matrix< T, Orientation, TriangularType >::triangular_matrix ( size_type  size,
scalar_type  init 
)
inline

Packed matrix constructor with defined size and an initial value for all triangular matrix elements

Parameters
sizenumber of rows and columns
initinitial value of the non-zero elements

Definition at line 81 of file triangular_matrix.hpp.

§ triangular_matrix() [4/5]

template<class T , class Orientation , class TriangularType >
shark::blas::triangular_matrix< T, Orientation, TriangularType >::triangular_matrix ( const triangular_matrix< T, Orientation, TriangularType > &  m)
inline

Copy-constructor of a dense matrix

Parameters
mis a dense matrix

Definition at line 86 of file triangular_matrix.hpp.

§ triangular_matrix() [5/5]

template<class T , class Orientation , class TriangularType >
template<class E >
shark::blas::triangular_matrix< T, Orientation, TriangularType >::triangular_matrix ( matrix_expression< E > const &  e)
inline

Copy-constructor of a dense matrix from a matrix expression

Parameters
eis a matrix expression which has to be triangular

Definition at line 92 of file triangular_matrix.hpp.

References shark::blas::assign().

Member Function Documentation

§ clear()

template<class T , class Orientation , class TriangularType >
void shark::blas::triangular_matrix< T, Orientation, TriangularType >::clear ( )
inline

Definition at line 155 of file triangular_matrix.hpp.

§ column_begin() [1/2]

§ column_begin() [2/2]

§ column_end() [1/2]

§ column_end() [2/2]

§ nnz()

template<class T , class Orientation , class TriangularType >
size_type shark::blas::triangular_matrix< T, Orientation, TriangularType >::nnz ( ) const
inline

Number of nonzero-elements stores in the matrix.

Definition at line 132 of file triangular_matrix.hpp.

§ non_zero()

template<class T , class Orientation , class TriangularType >
bool shark::blas::triangular_matrix< T, Orientation, TriangularType >::non_zero ( std::size_t  i,
std::size_t  j 
) const
inline

Definition at line 172 of file triangular_matrix.hpp.

§ operator()()

template<class T , class Orientation , class TriangularType >
const_reference shark::blas::triangular_matrix< T, Orientation, TriangularType >::operator() ( index_type  i,
index_type  j 
) const
inline

§ operator=() [1/3]

template<class T , class Orientation , class TriangularType >
triangular_matrix& shark::blas::triangular_matrix< T, Orientation, TriangularType >::operator= ( triangular_matrix< T, Orientation, TriangularType >  m)
inline
Note
"pass by value" the key idea to enable move semantics

Definition at line 177 of file triangular_matrix.hpp.

References shark::blas::triangular_matrix< T, Orientation, TriangularType >::swap().

§ operator=() [2/3]

§ operator=() [3/3]

template<class T , class Orientation , class TriangularType >
template<class E >
triangular_matrix& shark::blas::triangular_matrix< T, Orientation, TriangularType >::operator= ( matrix_expression< E > const &  e)
inline

§ resize() [1/2]

template<class T , class Orientation , class TriangularType >
void shark::blas::triangular_matrix< T, Orientation, TriangularType >::resize ( size_type  size)
inline

Resize a matrix to new dimensions. If resizing is performed, the data is not preserved.

Parameters
sizethe new number of rows and columns

Definition at line 144 of file triangular_matrix.hpp.

References shark::size().

Referenced by shark::blas::triangular_matrix< T, Orientation, TriangularType >::operator=(), and shark::blas::triangular_matrix< T, Orientation, TriangularType >::resize().

§ resize() [2/2]

template<class T , class Orientation , class TriangularType >
void shark::blas::triangular_matrix< T, Orientation, TriangularType >::resize ( size_type  size1,
size_type  size2 
)
inline

§ row_begin() [1/2]

§ row_begin() [2/2]

§ row_end() [1/2]

§ row_end() [2/2]

§ serialize()

template<class T , class Orientation , class TriangularType >
template<class Archive >
void shark::blas::triangular_matrix< T, Orientation, TriangularType >::serialize ( Archive &  ar,
const unsigned  int 
)
inline

Definition at line 504 of file triangular_matrix.hpp.

§ set_element()

template<class T , class Orientation , class TriangularType >
void shark::blas::triangular_matrix< T, Orientation, TriangularType >::set_element ( std::size_t  i,
std::size_t  j,
value_type  t 
)
inline

§ size1()

§ size2()

template<class T , class Orientation , class TriangularType >
size_type shark::blas::triangular_matrix< T, Orientation, TriangularType >::size2 ( ) const
inline

§ storage() [1/2]

template<class T , class Orientation , class TriangularType >
const_pointer shark::blas::triangular_matrix< T, Orientation, TriangularType >::storage ( ) const
inline

Returns the pointer to the beginning of the matrix storage.

Grants low-level access to the matrix internals. Element order depends on whether the matrix is row_major or column_major and upper or lower triangular

Definition at line 115 of file triangular_matrix.hpp.

Referenced by shark::blas::triangular_matrix< T, Orientation, TriangularType >::column_begin(), shark::blas::triangular_matrix< T, Orientation, TriangularType >::column_end(), shark::blas::triangular_matrix< T, Orientation, TriangularType >::row_begin(), and shark::blas::triangular_matrix< T, Orientation, TriangularType >::row_end().

§ storage() [2/2]

template<class T , class Orientation , class TriangularType >
pointer shark::blas::triangular_matrix< T, Orientation, TriangularType >::storage ( )
inline

Returns the pointer to the beginning of the matrix storage.

Grants low-level access to the matrix internals. Element order depends on whether the matrix is row_major or column_major. to access element (i,j) use storage()[i*stride1()+j*stride2()].

Definition at line 125 of file triangular_matrix.hpp.

§ swap()

template<class T , class Orientation , class TriangularType >
void shark::blas::triangular_matrix< T, Orientation, TriangularType >::swap ( triangular_matrix< T, Orientation, TriangularType > &  m)
inline

Friends And Related Function Documentation

§ swap

template<class T , class Orientation , class TriangularType >
void swap ( triangular_matrix< T, Orientation, TriangularType > &  m1,
triangular_matrix< T, Orientation, TriangularType > &  m2 
)
friend

Definition at line 200 of file triangular_matrix.hpp.


The documentation for this class was generated from the following file: