Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::numeric::ublas::c_matrix< T, N, M > Class Template Reference

An array based matrix class which size is defined at type specification or object instanciation. More...

#include <matrix.hpp>

Inheritance diagram for boost::numeric::ublas::c_matrix< T, N, M >:
Collaboration diagram for boost::numeric::ublas::c_matrix< T, N, M >:

Classes

class  const_iterator1
 
class  const_iterator2
 
class  iterator1
 
class  iterator2
 

Public Types

typedef std::size_t size_type
 
typedef std::ptrdiff_t difference_type
 
typedef T value_type
 
typedef const Tconst_reference
 
typedef Treference
 
typedef const Tconst_pointer
 
typedef Tpointer
 
typedef const matrix_reference
< const self_type
const_closure_type
 
typedef matrix_reference
< self_type
closure_type
 
typedef c_vector< T, N *M > vector_temporary_type
 
typedef self_type matrix_temporary_type
 
typedef dense_tag storage_category
 
typedef row_major_tag orientation_category
 
typedef reverse_iterator_base1
< const_iterator1
const_reverse_iterator1
 
typedef reverse_iterator_base1
< iterator1
reverse_iterator1
 
typedef reverse_iterator_base2
< const_iterator2
const_reverse_iterator2
 
typedef reverse_iterator_base2
< iterator2
reverse_iterator2
 
typedef c_matrix< T, N, M > container_type
 
typedef matrix_tag type_category
 
typedef E expression_type
 

Public Member Functions

BOOST_UBLAS_INLINE c_matrix ()
 
BOOST_UBLAS_INLINE c_matrix (size_type size1, size_type size2)
 
BOOST_UBLAS_INLINE c_matrix (const c_matrix &m)
 
template<class AE >
BOOST_UBLAS_INLINE c_matrix (const matrix_expression< AE > &ae)
 
BOOST_UBLAS_INLINE size_type size1 () const
 
BOOST_UBLAS_INLINE size_type size2 () const
 
BOOST_UBLAS_INLINE const_pointer data () const
 
BOOST_UBLAS_INLINE pointer data ()
 
BOOST_UBLAS_INLINE void resize (size_type size1, size_type size2, bool preserve=true)
 
BOOST_UBLAS_INLINE const_reference operator() (size_type i, size_type j) const
 
BOOST_UBLAS_INLINE reference at_element (size_type i, size_type j)
 
BOOST_UBLAS_INLINE reference operator() (size_type i, size_type j)
 
BOOST_UBLAS_INLINE reference insert_element (size_type i, size_type j, const_reference t)
 
BOOST_UBLAS_INLINE void clear ()
 
BOOST_UBLAS_INLINE c_matrixoperator= (const c_matrix &m)
 
template<class C >
BOOST_UBLAS_INLINE c_matrixoperator= (const matrix_container< C > &m)
 
BOOST_UBLAS_INLINE c_matrixassign_temporary (c_matrix &m)
 
template<class AE >
BOOST_UBLAS_INLINE c_matrixoperator= (const matrix_expression< AE > &ae)
 
template<class AE >
BOOST_UBLAS_INLINE c_matrixassign (const matrix_expression< AE > &ae)
 
template<class AE >
BOOST_UBLAS_INLINE c_matrixoperator+= (const matrix_expression< AE > &ae)
 
template<class C >
BOOST_UBLAS_INLINE c_matrixoperator+= (const matrix_container< C > &m)
 
template<class AE >
BOOST_UBLAS_INLINE c_matrixplus_assign (const matrix_expression< AE > &ae)
 
template<class AE >
BOOST_UBLAS_INLINE c_matrixoperator-= (const matrix_expression< AE > &ae)
 
template<class C >
BOOST_UBLAS_INLINE c_matrixoperator-= (const matrix_container< C > &m)
 
template<class AE >
BOOST_UBLAS_INLINE c_matrixminus_assign (const matrix_expression< AE > &ae)
 
template<class AT >
BOOST_UBLAS_INLINE c_matrixoperator*= (const AT &at)
 
template<class AT >
BOOST_UBLAS_INLINE c_matrixoperator/= (const AT &at)
 
BOOST_UBLAS_INLINE void swap (c_matrix &m)
 
BOOST_UBLAS_INLINE const_iterator1 find1 (int, size_type i, size_type j) const
 
BOOST_UBLAS_INLINE iterator1 find1 (int, size_type i, size_type j)
 
BOOST_UBLAS_INLINE const_iterator2 find2 (int, size_type i, size_type j) const
 
BOOST_UBLAS_INLINE iterator2 find2 (int, size_type i, size_type j)
 
BOOST_UBLAS_INLINE const_iterator1 begin1 () const
 
BOOST_UBLAS_INLINE const_iterator1 cbegin1 () const
 
BOOST_UBLAS_INLINE const_iterator1 end1 () const
 
BOOST_UBLAS_INLINE const_iterator1 cend1 () const
 
BOOST_UBLAS_INLINE iterator1 begin1 ()
 
BOOST_UBLAS_INLINE iterator1 end1 ()
 
BOOST_UBLAS_INLINE const_iterator2 begin2 () const
 
BOOST_UBLAS_INLINE const_iterator2 cbegin2 () const
 
BOOST_UBLAS_INLINE const_iterator2 end2 () const
 
BOOST_UBLAS_INLINE const_iterator2 cend2 () const
 
BOOST_UBLAS_INLINE iterator2 begin2 ()
 
BOOST_UBLAS_INLINE iterator2 end2 ()
 
BOOST_UBLAS_INLINE
const_reverse_iterator1 
rbegin1 () const
 
BOOST_UBLAS_INLINE
const_reverse_iterator1 
crbegin1 () const
 
BOOST_UBLAS_INLINE
const_reverse_iterator1 
rend1 () const
 
BOOST_UBLAS_INLINE
const_reverse_iterator1 
crend1 () const
 
BOOST_UBLAS_INLINE
reverse_iterator1 
rbegin1 ()
 
BOOST_UBLAS_INLINE
reverse_iterator1 
rend1 ()
 
BOOST_UBLAS_INLINE
const_reverse_iterator2 
rbegin2 () const
 
BOOST_UBLAS_INLINE
const_reverse_iterator2 
crbegin2 () const
 
BOOST_UBLAS_INLINE
const_reverse_iterator2 
rend2 () const
 
BOOST_UBLAS_INLINE
const_reverse_iterator2 
crend2 () const
 
BOOST_UBLAS_INLINE
reverse_iterator2 
rbegin2 ()
 
BOOST_UBLAS_INLINE
reverse_iterator2 
rend2 ()
 
template<class Archive >
void serialize (Archive &ar, const unsigned int)
 
BOOST_UBLAS_INLINE const
container_type
operator() () const
 
BOOST_UBLAS_INLINE container_typeoperator() ()
 

Static Public Attributes

static const unsigned complexity
 

Friends

BOOST_UBLAS_INLINE friend void swap (c_matrix &m1, c_matrix &m2)
 

Detailed Description

template<class T, std::size_t N, std::size_t M>
class boost::numeric::ublas::c_matrix< T, N, M >

An array based matrix class which size is defined at type specification or object instanciation.

This matrix is directly based on a predefined C-style arry of data, thus providing the fastest implementation possible. The constraint is that dimensions of the matrix must be specified at the instanciation or the type specification.

For instance,

typedef c_matrix<double,4,4> my_4by4_matrix

defines a 4 by 4 double-precision matrix. You can also instantiate it directly with

c_matrix<int,8,5> my_fast_matrix

. This will make a 8 by 5 integer matrix. The price to pay for this speed is that you cannot resize it to a size larger than the one defined in the template parameters. In the previous example, a size of 4 by 5 or 3 by 2 is acceptable, but a new size of 9 by 5 or even 10 by 10 will raise a bad_size() exception.

Template Parameters
Tthe type of object stored in the matrix (like double, float, complex, etc...)
Nthe default maximum number of rows
Mthe default maximum number of columns

Member Typedef Documentation

template<class T , std::size_t N, std::size_t M>
typedef matrix_reference<self_type> boost::numeric::ublas::c_matrix< T, N, M >::closure_type
template<class T , std::size_t N, std::size_t M>
typedef const matrix_reference<const self_type> boost::numeric::ublas::c_matrix< T, N, M >::const_closure_type
template<class T , std::size_t N, std::size_t M>
typedef const T* boost::numeric::ublas::c_matrix< T, N, M >::const_pointer
template<class T , std::size_t N, std::size_t M>
typedef const T& boost::numeric::ublas::c_matrix< T, N, M >::const_reference
template<class T , std::size_t N, std::size_t M>
typedef reverse_iterator_base1<const_iterator1> boost::numeric::ublas::c_matrix< T, N, M >::const_reverse_iterator1
template<class T , std::size_t N, std::size_t M>
typedef reverse_iterator_base2<const_iterator2> boost::numeric::ublas::c_matrix< T, N, M >::const_reverse_iterator2
template<class T , std::size_t N, std::size_t M>
typedef std::ptrdiff_t boost::numeric::ublas::c_matrix< T, N, M >::difference_type
template<class E>
typedef E boost::numeric::ublas::matrix_expression< E >::expression_type
inherited
template<class T , std::size_t N, std::size_t M>
typedef self_type boost::numeric::ublas::c_matrix< T, N, M >::matrix_temporary_type
template<class T , std::size_t N, std::size_t M>
typedef row_major_tag boost::numeric::ublas::c_matrix< T, N, M >::orientation_category
template<class T , std::size_t N, std::size_t M>
typedef T* boost::numeric::ublas::c_matrix< T, N, M >::pointer
template<class T , std::size_t N, std::size_t M>
typedef T& boost::numeric::ublas::c_matrix< T, N, M >::reference
template<class T , std::size_t N, std::size_t M>
typedef reverse_iterator_base1<iterator1> boost::numeric::ublas::c_matrix< T, N, M >::reverse_iterator1
template<class T , std::size_t N, std::size_t M>
typedef reverse_iterator_base2<iterator2> boost::numeric::ublas::c_matrix< T, N, M >::reverse_iterator2
template<class T , std::size_t N, std::size_t M>
typedef std::size_t boost::numeric::ublas::c_matrix< T, N, M >::size_type
template<class T , std::size_t N, std::size_t M>
typedef dense_tag boost::numeric::ublas::c_matrix< T, N, M >::storage_category
template<class T , std::size_t N, std::size_t M>
typedef T boost::numeric::ublas::c_matrix< T, N, M >::value_type
template<class T , std::size_t N, std::size_t M>
typedef c_vector<T, N * M> boost::numeric::ublas::c_matrix< T, N, M >::vector_temporary_type

Constructor & Destructor Documentation

template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE boost::numeric::ublas::c_matrix< T, N, M >::c_matrix ( )
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE boost::numeric::ublas::c_matrix< T, N, M >::c_matrix ( size_type  size1,
size_type  size2 
)
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE boost::numeric::ublas::c_matrix< T, N, M >::c_matrix ( const c_matrix< T, N, M > &  m)
inline
template<class T , std::size_t N, std::size_t M>
template<class AE >
BOOST_UBLAS_INLINE boost::numeric::ublas::c_matrix< T, N, M >::c_matrix ( const matrix_expression< AE > &  ae)
inline

Member Function Documentation

template<class T , std::size_t N, std::size_t M>
template<class AE >
BOOST_UBLAS_INLINE c_matrix& boost::numeric::ublas::c_matrix< T, N, M >::assign ( const matrix_expression< AE > &  ae)
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE reference boost::numeric::ublas::c_matrix< T, N, M >::at_element ( size_type  i,
size_type  j 
)
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE const_iterator1 boost::numeric::ublas::c_matrix< T, N, M >::begin1 ( ) const
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE iterator1 boost::numeric::ublas::c_matrix< T, N, M >::begin1 ( )
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE const_iterator2 boost::numeric::ublas::c_matrix< T, N, M >::begin2 ( ) const
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE iterator2 boost::numeric::ublas::c_matrix< T, N, M >::begin2 ( )
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE const_iterator1 boost::numeric::ublas::c_matrix< T, N, M >::cbegin1 ( ) const
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE const_iterator2 boost::numeric::ublas::c_matrix< T, N, M >::cbegin2 ( ) const
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE const_iterator1 boost::numeric::ublas::c_matrix< T, N, M >::cend1 ( ) const
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE const_iterator2 boost::numeric::ublas::c_matrix< T, N, M >::cend2 ( ) const
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE void boost::numeric::ublas::c_matrix< T, N, M >::clear ( void  )
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE const_reverse_iterator1 boost::numeric::ublas::c_matrix< T, N, M >::crbegin1 ( ) const
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE const_reverse_iterator2 boost::numeric::ublas::c_matrix< T, N, M >::crbegin2 ( ) const
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE const_reverse_iterator1 boost::numeric::ublas::c_matrix< T, N, M >::crend1 ( ) const
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE const_reverse_iterator2 boost::numeric::ublas::c_matrix< T, N, M >::crend2 ( ) const
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE const_pointer boost::numeric::ublas::c_matrix< T, N, M >::data ( ) const
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE pointer boost::numeric::ublas::c_matrix< T, N, M >::data ( )
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE const_iterator1 boost::numeric::ublas::c_matrix< T, N, M >::end1 ( ) const
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE iterator1 boost::numeric::ublas::c_matrix< T, N, M >::end1 ( )
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE const_iterator2 boost::numeric::ublas::c_matrix< T, N, M >::end2 ( ) const
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE iterator2 boost::numeric::ublas::c_matrix< T, N, M >::end2 ( )
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE const_iterator1 boost::numeric::ublas::c_matrix< T, N, M >::find1 ( int  ,
size_type  i,
size_type  j 
) const
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE iterator1 boost::numeric::ublas::c_matrix< T, N, M >::find1 ( int  ,
size_type  i,
size_type  j 
)
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE const_iterator2 boost::numeric::ublas::c_matrix< T, N, M >::find2 ( int  ,
size_type  i,
size_type  j 
) const
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE iterator2 boost::numeric::ublas::c_matrix< T, N, M >::find2 ( int  ,
size_type  i,
size_type  j 
)
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE reference boost::numeric::ublas::c_matrix< T, N, M >::insert_element ( size_type  i,
size_type  j,
const_reference  t 
)
inline
template<class T , std::size_t N, std::size_t M>
template<class AE >
BOOST_UBLAS_INLINE c_matrix& boost::numeric::ublas::c_matrix< T, N, M >::minus_assign ( const matrix_expression< AE > &  ae)
inline
BOOST_UBLAS_INLINE const container_type& boost::numeric::ublas::matrix_container< c_matrix< T, N, M > >::operator() ( ) const
inlineinherited
BOOST_UBLAS_INLINE container_type& boost::numeric::ublas::matrix_container< c_matrix< T, N, M > >::operator() ( )
inlineinherited
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE const_reference boost::numeric::ublas::c_matrix< T, N, M >::operator() ( size_type  i,
size_type  j 
) const
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE reference boost::numeric::ublas::c_matrix< T, N, M >::operator() ( size_type  i,
size_type  j 
)
inline
template<class T , std::size_t N, std::size_t M>
template<class AT >
BOOST_UBLAS_INLINE c_matrix& boost::numeric::ublas::c_matrix< T, N, M >::operator*= ( const AT &  at)
inline

References boost::xpressive::at.

template<class T , std::size_t N, std::size_t M>
template<class AE >
BOOST_UBLAS_INLINE c_matrix& boost::numeric::ublas::c_matrix< T, N, M >::operator+= ( const matrix_expression< AE > &  ae)
inline
template<class T , std::size_t N, std::size_t M>
template<class C >
BOOST_UBLAS_INLINE c_matrix& boost::numeric::ublas::c_matrix< T, N, M >::operator+= ( const matrix_container< C > &  m)
inline
template<class T , std::size_t N, std::size_t M>
template<class AE >
BOOST_UBLAS_INLINE c_matrix& boost::numeric::ublas::c_matrix< T, N, M >::operator-= ( const matrix_expression< AE > &  ae)
inline
template<class T , std::size_t N, std::size_t M>
template<class C >
BOOST_UBLAS_INLINE c_matrix& boost::numeric::ublas::c_matrix< T, N, M >::operator-= ( const matrix_container< C > &  m)
inline
template<class T , std::size_t N, std::size_t M>
template<class AT >
BOOST_UBLAS_INLINE c_matrix& boost::numeric::ublas::c_matrix< T, N, M >::operator/= ( const AT &  at)
inline

References boost::xpressive::at.

template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE c_matrix& boost::numeric::ublas::c_matrix< T, N, M >::operator= ( const c_matrix< T, N, M > &  m)
inline
template<class T , std::size_t N, std::size_t M>
template<class AE >
BOOST_UBLAS_INLINE c_matrix& boost::numeric::ublas::c_matrix< T, N, M >::operator= ( const matrix_expression< AE > &  ae)
inline
template<class T , std::size_t N, std::size_t M>
template<class AE >
BOOST_UBLAS_INLINE c_matrix& boost::numeric::ublas::c_matrix< T, N, M >::plus_assign ( const matrix_expression< AE > &  ae)
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE const_reverse_iterator1 boost::numeric::ublas::c_matrix< T, N, M >::rbegin1 ( ) const
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE reverse_iterator1 boost::numeric::ublas::c_matrix< T, N, M >::rbegin1 ( )
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE const_reverse_iterator2 boost::numeric::ublas::c_matrix< T, N, M >::rbegin2 ( ) const
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE reverse_iterator2 boost::numeric::ublas::c_matrix< T, N, M >::rbegin2 ( )
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE const_reverse_iterator1 boost::numeric::ublas::c_matrix< T, N, M >::rend1 ( ) const
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE reverse_iterator1 boost::numeric::ublas::c_matrix< T, N, M >::rend1 ( )
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE const_reverse_iterator2 boost::numeric::ublas::c_matrix< T, N, M >::rend2 ( ) const
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE reverse_iterator2 boost::numeric::ublas::c_matrix< T, N, M >::rend2 ( )
inline
template<class T , std::size_t N, std::size_t M>
template<class Archive >
void boost::numeric::ublas::c_matrix< T, N, M >::serialize ( Archive &  ar,
const unsigned  int 
)
inline
template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE void boost::numeric::ublas::c_matrix< T, N, M >::swap ( c_matrix< T, N, M > &  m)
inline

Friends And Related Function Documentation

template<class T , std::size_t N, std::size_t M>
BOOST_UBLAS_INLINE friend void swap ( c_matrix< T, N, M > &  m1,
c_matrix< T, N, M > &  m2 
)
friend

Member Data Documentation

const unsigned boost::numeric::ublas::matrix_container< c_matrix< T, N, M > >::complexity
staticinherited

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