ublas: boost::numeric::ublas::c_matrix< T, N, M > Class Template Reference

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

## 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 T & | const_reference
typedef T & | reference
typedef const T * | const_pointer
typedef T * | pointer
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

## 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_matrix & | operator= (const c_matrix &m)
template<class C >
BOOST_UBLAS_INLINE c_matrix & | operator= (const matrix_container< C > &m)
BOOST_UBLAS_INLINE c_matrix & | assign_temporary (c_matrix &m)
template<class AE >
BOOST_UBLAS_INLINE c_matrix & | operator= (const matrix_expression< AE > &ae)
template<class AE >
BOOST_UBLAS_INLINE c_matrix & | assign (const matrix_expression< AE > &ae)
template<class AE >
BOOST_UBLAS_INLINE c_matrix & | operator+= (const matrix_expression< AE > &ae)
template<class C >
BOOST_UBLAS_INLINE c_matrix & | operator+= (const matrix_container< C > &m)
template<class AE >
BOOST_UBLAS_INLINE c_matrix & | plus_assign (const matrix_expression< AE > &ae)
template<class AE >
BOOST_UBLAS_INLINE c_matrix & | operator-= (const matrix_expression< AE > &ae)
template<class C >
BOOST_UBLAS_INLINE c_matrix & | operator-= (const matrix_container< C > &m)
template<class AE >
BOOST_UBLAS_INLINE c_matrix & | minus_assign (const matrix_expression< AE > &ae)
template<class AT >
BOOST_UBLAS_INLINE c_matrix & | operator*= (const AT &at)
template<class AT >
BOOST_UBLAS_INLINE c_matrix & | operator/= (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 ()
BOOST_UBLAS_INLINE const_reverse_iterator1 | rbegin1 () const
BOOST_UBLAS_INLINE const_reverse_iterator1 | rend1 () 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 | rend2 () const
BOOST_UBLAS_INLINE reverse_iterator2 | rbegin2 ()
BOOST_UBLAS_INLINE reverse_iterator2 | rend2 ()
template<class Archive >
void | serialize (Archive &ar, const unsigned int)

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

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