Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.

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...

Inherits matrix_container< c_matrix< T, N, M > >.

List of all members.


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 T & const_reference
typedef T & reference
typedef const T * const_pointer
typedef T * pointer
typedef const matrix_reference
< const self_type
typedef matrix_reference
< self_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
typedef reverse_iterator_base1
< iterator1
typedef reverse_iterator_base2
< const_iterator2
typedef reverse_iterator_base2
< iterator2

Public Member Functions

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 rank, size_type i, size_type j) const
BOOST_UBLAS_INLINE iterator1 find1 (int rank, size_type i, size_type j)
BOOST_UBLAS_INLINE const_iterator2 find2 (int rank, size_type i, size_type j) const
BOOST_UBLAS_INLINE iterator2 find2 (int rank, size_type i, size_type j)
BOOST_UBLAS_INLINE const_iterator1 begin1 () const
BOOST_UBLAS_INLINE const_iterator1 end1 () const
BOOST_UBLAS_INLINE iterator1 begin1 ()
BOOST_UBLAS_INLINE iterator1 end1 ()
BOOST_UBLAS_INLINE const_iterator2 begin2 () const
BOOST_UBLAS_INLINE const_iterator2 end2 () const
BOOST_UBLAS_INLINE iterator2 begin2 ()
BOOST_UBLAS_INLINE iterator2 end2 ()
rbegin1 () const
rend1 () const
rbegin1 ()
rend1 ()
rbegin2 () const
rend2 () const
rbegin2 ()
rend2 ()
template<class Archive >
void serialize (Archive &ar, const unsigned int)


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 >

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:
T the type of object stored in the matrix (like double, float, complex, etc...)
N the default maximum number of rows
M the default maximum number of columns

Generated on Sun Jul 4 20:31:06 2010 for ublas by  doxygen 1.6.1