MatrDse< C, R > Struct Template Reference

List of all members.

Detailed Description

template<class C, class R = linalg::rep2d<C>>
struct MatrDse< C, R >

Interface for dense matrices. The class R is the container corresponding to the internal representation. The data are owned by the interface. The inplace arithmetic operations are members of this class. The external arithmetic operators +,-,*,/ are defined through template expression. The different operations of this class are implemented in the module MATRIX. The container R should provide the following definitions or methods:
  typename R::value_type;
  typename R::size_type;
  typename R::iterator;

  R(size_type i, size_type j, value_type* t);
  R(size_type i, size_type j, value_type* t, char c);
  R(size_type s, Alloc);
  R(size_type s, C *t);
  R(iterator b, iterator e);
  void R::reserve(size_type m, size_type m);
 
        value_type & operator() (size_type i, size_type j);
  const value_type & operator() (size_type i, size_type j) const;

  size_type nbrow() const;
  size_type nbcol() const;

The value_type is the type of the coefficients. The size_type is the type of the indices used to access the elements. The row_iterator is the type of the forward iterators on the elements of a row. The column_iterator is the type of the forward iterators on the elements of a column.The row_type is the type of the row views. The col_type is the type of the column views. The internal representation type R is rep_type.

Definition at line 70 of file MatrDse.h.

Public Types

typedef VectDse< C > vector_type
typedef VectDse< C > row_type
typedef VectDse< C > col_type
typedef R::size_type size_type
typedef C value_type
typedef C coeff_t
typedef R::row_iterator row_iterator
typedef R::col_iterator col_iterator
typedef R rep_type
typedef MatrDse< C, R > self_t
typedef binary_operator_prototype<
linalg::_submatrix_, self_t,
Range2d >::F 
submatrix_t

Public Member Functions

R & rep ()
const R & rep () const
 MatrDse ()
 MatrDse (const R &r)
 MatrDse (size_type m, size_type n)
 MatrDse (size_type m, size_type n, const value_type &c)
 Construct a m by n matrix with entries all equal to c.
 MatrDse (size_type m, size_type n, const char *str, ByRow)
 MatrDse (size_type m, size_type n, const char *str, ByCol=ByCol())
template<class T>
 MatrDse (size_type m, size_type n, const value_type *src, const T &t=ByCol())
 MatrDse (const self_t &M)
self_toperator= (const self_t &M)
template<class X>
self_toperator= (const X &M)
size_type nbrow () const
 return the number of rows
size_type nbcol () const
 return the number of columns
value_typeoperator() (size_type i, size_type j)
 return the (i,j) coefficient
const value_typeoperator() (size_type i, size_type j) const
 return the (i,j) coefficient
submatrix_t operator() (const Range &I, const Range &J)
 return the submatrix given by rows in range I, columns in range J
submatrix_t operator() (const Range2d &rg)
 return the submatrix given by the range rg
template<class X>
self_toperator+= (const X &x)
template<class X>
self_toperator-= (const X &x)
template<class X>
self_toperator *= (const X &x)
template<class X>
self_toperator/= (const X &x)
bool operator== (const self_t &v)
 Equality test.
bool operator!= (const self_t &v)
self_tswaprow (size_type i, size_type j)
 Rows and columns operations.
self_tswapcol (size_type i, size_type j)
self_taddrow (size_type i, size_type j, const value_type &c=1)
self_taddcol (size_type i, size_type j, const value_type &c=1)
self_tmultrow (size_type i, const value_type &c=1)
 multiply row i by the scalar c
self_tmultcol (size_type i, const value_type &c=1)
 multiply column i by the scalar c
self_ttranspose ()
 inplace transposition.
self_tresize (size_type i, size_type j)
 resize

Public Attributes

shared_object< R > data


Constructor & Destructor Documentation

template<class C, class R = linalg::rep2d<C>>
MatrDse< C, R >::MatrDse ( size_type  m,
size_type  n,
const value_type c 
)

Construct a m by n matrix with entries all equal to c.

Definition at line 95 of file MatrDse.h.

template<class C, class R = linalg::rep2d<C>>
MatrDse< C, R >::MatrDse ( size_type  m,
size_type  n,
const char *  str,
ByRow   
)

Construct a m by n matrix from a string containing the coefficients of the matrix separated by spaces. These coefficients are read row by row.

Definition at line 103 of file MatrDse.h.

template<class C, class R = linalg::rep2d<C>>
MatrDse< C, R >::MatrDse ( size_type  m,
size_type  n,
const char *  str,
ByCol  = ByCol() 
)

Same as above but the coefficients are read column by column.

Definition at line 109 of file MatrDse.h.

template<class C, class R = linalg::rep2d<C>>
template<class T>
MatrDse< C, R >::MatrDse ( size_type  m,
size_type  n,
const value_type src,
const T &  t = ByCol() 
)

initialize the matrix from the coefficient data pointed by src the coefficients are assumed to be stored in row major mode the same function exists in column major mode (ByRow or ByCol)

Definition at line 117 of file MatrDse.h.


Member Function Documentation

template<class C, class R = linalg::rep2d<C>>
size_type MatrDse< C, R >::nbrow (  )  const

return the number of rows

Definition at line 133 of file MatrDse.h.

Referenced by TopSbdBdg2d< O, X, I >::assign(), bezier::sbd2d< X, I, bezier::bzislv< X > >::assign(), and Eigenvct().

template<class C, class R = linalg::rep2d<C>>
size_type MatrDse< C, R >::nbcol (  )  const

return the number of columns

Definition at line 138 of file MatrDse.h.

Referenced by TopSbdBdg2d< O, X, I >::assign(), bezier::sbd2d< X, I, bezier::bzislv< X > >::assign(), and Eigenvct().

template<class C, class R = linalg::rep2d<C>>
value_type& MatrDse< C, R >::operator() ( size_type  i,
size_type  j 
)

return the (i,j) coefficient

Definition at line 143 of file MatrDse.h.

template<class C, class R = linalg::rep2d<C>>
const value_type& MatrDse< C, R >::operator() ( size_type  i,
size_type  j 
) const

return the (i,j) coefficient

Definition at line 146 of file MatrDse.h.

template<class C, class R = linalg::rep2d<C>>
submatrix_t MatrDse< C, R >::operator() ( const Range I,
const Range J 
)

return the submatrix given by rows in range I, columns in range J

Definition at line 150 of file MatrDse.h.

template<class C, class R = linalg::rep2d<C>>
submatrix_t MatrDse< C, R >::operator() ( const Range2d rg  ) 

return the submatrix given by the range rg

Definition at line 153 of file MatrDse.h.

template<class C, class R = linalg::rep2d<C>>
bool MatrDse< C, R >::operator== ( const self_t v  ) 

Equality test.

Definition at line 167 of file MatrDse.h.

template<class C, class R = linalg::rep2d<C>>
self_t& MatrDse< C, R >::swaprow ( size_type  i,
size_type  j 
)

Rows and columns operations.

Definition at line 174 of file MatrDse.h.

Referenced by MatrDse< Seq< OCTREE::NODE_TYPE > >::swaprow().

template<class C, class R = linalg::rep2d<C>>
self_t& MatrDse< C, R >::multrow ( size_type  i,
const value_type c = 1 
)

multiply row i by the scalar c

Definition at line 191 of file MatrDse.h.

Referenced by MatrDse< Seq< OCTREE::NODE_TYPE > >::multrow().

template<class C, class R = linalg::rep2d<C>>
self_t& MatrDse< C, R >::multcol ( size_type  i,
const value_type c = 1 
)

multiply column i by the scalar c

Definition at line 196 of file MatrDse.h.

Referenced by MatrDse< Seq< OCTREE::NODE_TYPE > >::multcol().

template<class C, class R = linalg::rep2d<C>>
self_t& MatrDse< C, R >::transpose (  ) 

inplace transposition.

Definition at line 204 of file MatrDse.h.

Referenced by Transpose(), and MatrDse< Seq< OCTREE::NODE_TYPE > >::transpose().

template<class C, class R = linalg::rep2d<C>>
self_t& MatrDse< C, R >::resize ( size_type  i,
size_type  j 
)

resize

Definition at line 209 of file MatrDse.h.


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

SYNAPS DOCUMENTATION
logo