Rcpp Version 0.9.10
Matrix< RTYPE > Class Template Reference

#include <Matrix.h>

Inheritance diagram for Matrix< RTYPE >:
Collaboration diagram for Matrix< RTYPE >:

List of all members.

Classes

struct  can_have_na
struct  r_type

Public Types

typedef Vector< RTYPE > VECTOR
typedef VECTOR::iterator iterator
typedef VECTOR::converter_type converter_type
typedef VECTOR::stored_type stored_type
typedef VECTOR::Proxy Proxy
typedef MatrixRow< RTYPE > Row
typedef MatrixColumn< RTYPE > Column
typedef SubMatrix< RTYPE > Sub

Public Member Functions

 Matrix ()
 Matrix (SEXP x)
 Matrix (const Dimension &dims)
 Matrix (const int &nrows_, const int &ncols)
template<typename Iterator >
 Matrix (const int &nrows_, const int &ncols, Iterator start)
 Matrix (const int &n)
 Matrix (const Matrix &other)
Matrixoperator= (const Matrix &other)
template<bool NA, typename MAT >
 Matrix (const MatrixBase< RTYPE, NA, MAT > &other)
 Matrix (const SubMatrix< RTYPE > &)
Matrixoperator= (const SubMatrix< RTYPE > &)
template<typename U >
void fill_diag (const U &u)
Proxy operator[] (int i)
Proxy operator[] (int i) const
Proxy operator() (const size_t &i, const size_t &j)
Proxy operator() (const size_t &i, const size_t &j) const
Row operator() (int i, internal::NamedPlaceHolder)
Column operator() (internal::NamedPlaceHolder, int i)
Sub operator() (const Range &row_range, const Range &col_range)
Sub operator() (internal::NamedPlaceHolder, const Range &col_range)
Sub operator() (const Range &row_range, internal::NamedPlaceHolder)
int ncol () const
int nrow () const
int cols () const
int rows () const
Row row (int i)
Column column (int i)
iterator begin () const
iterator end () const

Static Public Member Functions

template<typename U >
static Matrix diag (int size, const U &diag_value)

Private Member Functions

template<bool NA, typename MAT >
void import_matrix_expression (const MatrixBase< RTYPE, NA, MAT > &other, int nr, int nc)
int offset (int i, int j) const
virtual void update ()
template<typename U >
void fill_diag__dispatch (traits::false_type, const U &u)
template<typename U >
void fill_diag__dispatch (traits::true_type, const U &u)

Private Attributes

int nrows

Detailed Description

template<int RTYPE>
class Matrix< RTYPE >

Examples:

RcppGibbs/RcppGibbs.R.

Definition at line 26 of file Matrix.h.


Member Typedef Documentation

template<int RTYPE>
typedef MatrixColumn<RTYPE> Matrix< RTYPE >::Column

Definition at line 139 of file Matrix.h.

template<int RTYPE>
typedef VECTOR::converter_type Matrix< RTYPE >::converter_type

Reimplemented from Vector< RTYPE >.

Definition at line 33 of file Matrix.h.

template<int RTYPE>
typedef VECTOR::iterator Matrix< RTYPE >::iterator

Reimplemented from Vector< RTYPE >.

Definition at line 32 of file Matrix.h.

template<int RTYPE>
typedef VECTOR::Proxy Matrix< RTYPE >::Proxy

Reimplemented from Vector< RTYPE >.

Definition at line 35 of file Matrix.h.

template<int RTYPE>
typedef MatrixRow<RTYPE> Matrix< RTYPE >::Row

Definition at line 138 of file Matrix.h.

template<int RTYPE>
typedef VECTOR::stored_type Matrix< RTYPE >::stored_type

Reimplemented from Vector< RTYPE >.

Definition at line 34 of file Matrix.h.

template<int RTYPE>
typedef SubMatrix<RTYPE> Matrix< RTYPE >::Sub

Definition at line 140 of file Matrix.h.

template<int RTYPE>
typedef Vector<RTYPE> Matrix< RTYPE >::VECTOR

Definition at line 31 of file Matrix.h.


Constructor & Destructor Documentation

template<int RTYPE>
Matrix< RTYPE >::Matrix ( ) [inline]

Definition at line 37 of file Matrix.h.

template<int RTYPE>
Matrix< RTYPE >::Matrix ( SEXP  x) [inline]

Definition at line 39 of file Matrix.h.

References Vector< RTYPE >::dims(), Matrix< RTYPE >::nrows, Rcpp::r_cast(), x, and y.

Here is the call graph for this function:

template<int RTYPE>
Matrix< RTYPE >::Matrix ( const Dimension &  dims) [inline]

Definition at line 46 of file Matrix.h.

References Vector< RTYPE >::init().

Here is the call graph for this function:

template<int RTYPE>
Matrix< RTYPE >::Matrix ( const int &  nrows_,
const int &  ncols 
) [inline]

Definition at line 52 of file Matrix.h.

template<int RTYPE>
template<typename Iterator >
Matrix< RTYPE >::Matrix ( const int &  nrows_,
const int &  ncols,
Iterator  start 
) [inline]

Definition at line 58 of file Matrix.h.

References Matrix< RTYPE >::nrows.

template<int RTYPE>
Matrix< RTYPE >::Matrix ( const int &  n) [inline]

Definition at line 65 of file Matrix.h.

template<int RTYPE>
Matrix< RTYPE >::Matrix ( const Matrix< RTYPE > &  other) [inline]

Definition at line 67 of file Matrix.h.

References x.

template<int RTYPE>
template<bool NA, typename MAT >
Matrix< RTYPE >::Matrix ( const MatrixBase< RTYPE, NA, MAT > &  other) [inline]

Definition at line 82 of file Matrix.h.

References Matrix< RTYPE >::nrows.

template<int RTYPE>
Matrix< RTYPE >::Matrix ( const SubMatrix< RTYPE > &  sub)

Definition at line 57 of file SubMatrix.h.

References Vector< RTYPE >::begin(), SubMatrix< RTYPE >::column_iterator(), i, j, SubMatrix< RTYPE >::ncol(), and Matrix< RTYPE >::nrows.

Here is the call graph for this function:


Member Function Documentation

template<int RTYPE>
iterator Matrix< RTYPE >::begin ( ) const [inline]

Reimplemented from Vector< RTYPE >.

Definition at line 216 of file Matrix.h.

References Vector< RTYPE >::begin().

Here is the call graph for this function:

template<int RTYPE>
int Matrix< RTYPE >::cols ( ) const [inline]

Definition at line 206 of file Matrix.h.

References Vector< RTYPE >::dims().

Here is the call graph for this function:

template<int RTYPE>
Column Matrix< RTYPE >::column ( int  i) [inline]

Definition at line 214 of file Matrix.h.

template<int RTYPE>
template<typename U >
static Matrix Matrix< RTYPE >::diag ( int  size,
const U &  diag_value 
) [inline, static]

Definition at line 112 of file Matrix.h.

References Matrix< RTYPE >::fill_diag().

Here is the call graph for this function:

template<int RTYPE>
iterator Matrix< RTYPE >::end ( ) const [inline]

Reimplemented from Vector< RTYPE >.

Definition at line 217 of file Matrix.h.

References Vector< RTYPE >::end().

Here is the call graph for this function:

template<int RTYPE>
template<typename U >
void Matrix< RTYPE >::fill_diag ( const U &  u) [inline]

Definition at line 107 of file Matrix.h.

References Matrix< RTYPE >::fill_diag__dispatch().

Referenced by Matrix< RTYPE >::diag().

Here is the call graph for this function:

template<int RTYPE>
template<typename U >
void Matrix< RTYPE >::fill_diag__dispatch ( traits::false_type  ,
const U &  u 
) [inline, private]

Definition at line 175 of file Matrix.h.

References Vector< RTYPE >::begin(), i, n, Matrix< RTYPE >::ncol(), Matrix< RTYPE >::offset(), and PROTECT().

Referenced by Matrix< RTYPE >::fill_diag().

Here is the call graph for this function:

template<int RTYPE>
template<typename U >
void Matrix< RTYPE >::fill_diag__dispatch ( traits::true_type  ,
const U &  u 
) [inline, private]

Definition at line 188 of file Matrix.h.

References Vector< RTYPE >::begin(), i, n, Matrix< RTYPE >::ncol(), and Matrix< RTYPE >::offset().

Here is the call graph for this function:

template<int RTYPE>
template<bool NA, typename MAT >
void Matrix< RTYPE >::import_matrix_expression ( const MatrixBase< RTYPE, NA, MAT > &  other,
int  nr,
int  nc 
) [inline, private]

Definition at line 95 of file Matrix.h.

References Vector< RTYPE >::begin(), i, and j.

Here is the call graph for this function:

template<int RTYPE>
int Matrix< RTYPE >::ncol ( ) const [inline]

Definition at line 200 of file Matrix.h.

References Vector< RTYPE >::dims().

Referenced by Matrix< RTYPE >::fill_diag__dispatch(), MatrixColumn< RTYPE >::MatrixColumn(), Matrix< RTYPE >::operator()(), and MatrixRow< RTYPE >::size().

Here is the call graph for this function:

template<int RTYPE>
int Matrix< RTYPE >::nrow ( ) const [inline]
template<int RTYPE>
int Matrix< RTYPE >::offset ( int  i,
int  j 
) const [inline, private]

Definition at line 165 of file Matrix.h.

References j, and Matrix< RTYPE >::nrows.

Referenced by Matrix< RTYPE >::fill_diag__dispatch(), and Matrix< RTYPE >::operator()().

template<int RTYPE>
Sub Matrix< RTYPE >::operator() ( const Range &  row_range,
internal::NamedPlaceHolder   
) [inline]

Definition at line 158 of file Matrix.h.

References Matrix< RTYPE >::ncol().

Here is the call graph for this function:

template<int RTYPE>
Proxy Matrix< RTYPE >::operator() ( const size_t &  i,
const size_t &  j 
) [inline]

Reimplemented from Vector< RTYPE >.

Definition at line 126 of file Matrix.h.

References Matrix< RTYPE >::offset().

Here is the call graph for this function:

template<int RTYPE>
Proxy Matrix< RTYPE >::operator() ( const size_t &  i,
const size_t &  j 
) const [inline]

Reimplemented from Vector< RTYPE >.

Definition at line 132 of file Matrix.h.

References Matrix< RTYPE >::offset().

Here is the call graph for this function:

template<int RTYPE>
Row Matrix< RTYPE >::operator() ( int  i,
internal::NamedPlaceHolder   
) [inline]

Definition at line 142 of file Matrix.h.

template<int RTYPE>
Column Matrix< RTYPE >::operator() ( internal::NamedPlaceHolder  ,
int  i 
) [inline]

Definition at line 146 of file Matrix.h.

template<int RTYPE>
Sub Matrix< RTYPE >::operator() ( internal::NamedPlaceHolder  ,
const Range &  col_range 
) [inline]

Definition at line 154 of file Matrix.h.

References Matrix< RTYPE >::nrow().

Here is the call graph for this function:

template<int RTYPE>
Sub Matrix< RTYPE >::operator() ( const Range &  row_range,
const Range &  col_range 
) [inline]

Definition at line 150 of file Matrix.h.

template<int RTYPE>
Matrix< RTYPE > & Matrix< RTYPE >::operator= ( const SubMatrix< RTYPE > &  sub)

Definition at line 71 of file SubMatrix.h.

References SubMatrix< RTYPE >::column_iterator(), i, j, SubMatrix< RTYPE >::ncol(), and SubMatrix< RTYPE >::nrow().

Here is the call graph for this function:

template<int RTYPE>
Matrix& Matrix< RTYPE >::operator= ( const Matrix< RTYPE > &  other) [inline]

Definition at line 73 of file Matrix.h.

References Matrix< RTYPE >::nrows, and x.

template<int RTYPE>
Proxy Matrix< RTYPE >::operator[] ( int  i) const [inline]

Reimplemented from Vector< RTYPE >.

Definition at line 122 of file Matrix.h.

template<int RTYPE>
Proxy Matrix< RTYPE >::operator[] ( int  i) [inline]

Reimplemented from Vector< RTYPE >.

Definition at line 118 of file Matrix.h.

template<int RTYPE>
Row Matrix< RTYPE >::row ( int  i) [inline]

Definition at line 213 of file Matrix.h.

template<int RTYPE>
int Matrix< RTYPE >::rows ( ) const [inline]

Definition at line 209 of file Matrix.h.

References Matrix< RTYPE >::nrows.

template<int RTYPE>
virtual void Matrix< RTYPE >::update ( ) [inline, private, virtual]

Reimplemented from Vector< RTYPE >.

Definition at line 169 of file Matrix.h.

References DEMANGLE, RCPP_DEBUG_1, and Vector< RTYPE >::update_vector().

Here is the call graph for this function:


Member Data Documentation

template<int RTYPE>
int Matrix< RTYPE >::nrows [private]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Defines