Rcpp Version 0.10.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros
Matrix< RTYPE > Class Template Reference

#include <Matrix.h>

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

Classes

struct  can_have_na
struct  r_type

Public Types

typedef MatrixRow< RTYPE > Row
typedef MatrixColumn< RTYPE > Column
typedef SubMatrix< RTYPE > Sub
typedef Vector< RTYPE > VECTOR
typedef VECTOR::iterator iterator
typedef VECTOR::const_iterator const_iterator
typedef VECTOR::converter_type converter_type
typedef VECTOR::stored_type stored_type
typedef VECTOR::Proxy Proxy
typedef VECTOR::const_Proxy const_Proxy
- Public Types inherited from Vector< RTYPE >
typedef traits::r_vector_proxy
< RTYPE >::type 
Proxy
typedef
traits::r_vector_const_proxy
< RTYPE >::type 
const_Proxy
typedef
traits::r_vector_name_proxy
< RTYPE >::type 
NameProxy
typedef traits::r_vector_proxy
< RTYPE >::type 
value_type
typedef
traits::r_vector_iterator
< RTYPE >::type 
iterator
typedef
traits::r_vector_const_iterator
< RTYPE >::type 
const_iterator
typedef traits::init_type
< RTYPE >::type 
init_type
typedef
traits::r_vector_element_converter
< RTYPE >::type 
converter_type
typedef traits::storage_type
< RTYPE >::type 
stored_type
typedef internal::RangeIndexer
< RTYPE, true, Vector
Indexer

Public Member Functions

 Matrix ()
 Matrix (SEXP x)
 Matrix (const int &n)
 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 Matrix &other)
template<bool NA, typename MAT >
 Matrix (const MatrixBase< RTYPE, NA, MAT > &other)
 Matrix (const SubMatrix< RTYPE > &)
Matrixoperator= (const Matrix &other)
Matrixoperator= (const SubMatrix< RTYPE > &)
int ncol () const
int nrow () const
int cols () const
int rows () const
Row row (int i)
Column column (int i)
const_iterator begin () const
const_iterator end () const
iterator begin ()
iterator end ()
template<typename U >
void fill_diag (const U &u)
Proxy operator[] (int i)
const_Proxy operator[] (int i) const
Proxy operator() (const size_t &i, const size_t &j)
const_Proxy operator() (const size_t &i, const size_t &j) const
Row operator() (int i, internal::NamedPlaceHolder)
Column operator() (internal::NamedPlaceHolder, int i)
Column operator() (internal::NamedPlaceHolder, int i) const
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)
- Public Member Functions inherited from Vector< RTYPE >
 Vector ()
 ~Vector ()
 Vector (const Vector &other)
 Vector (SEXP x)
 Vector (const RObject::SlotProxy &proxy)
 Vector (const RObject::AttributeProxy &proxy)
 Vector (const int &size, const stored_type &u)
 Vector (const std::string &st)
 Vector (const int &siz, stored_type(*gen)(void))
 Vector (const int &size)
 Vector (const Dimension &dims)
template<typename U >
 Vector (const Dimension &dims, const U &u)
template<bool NA, typename VEC >
 Vector (const VectorBase< RTYPE, NA, VEC > &other)
template<typename U >
 Vector (const int &size, const U &u)
template<bool NA, typename T >
 Vector (const sugar::SingleLogicalResult< NA, T > &obj)
template<typename U1 >
 Vector (const int &siz, stored_type(*gen)(U1), const U1 &u1)
template<typename U1 , typename U2 >
 Vector (const int &siz, stored_type(*gen)(U1, U2), const U1 &u1, const U2 &u2)
template<typename U1 , typename U2 , typename U3 >
 Vector (const int &siz, stored_type(*gen)(U1, U2, U3), const U1 &u1, const U2 &u2, const U3 &u3)
template<typename InputIterator >
 Vector (InputIterator first, InputIterator last)
template<typename InputIterator >
 Vector (InputIterator first, InputIterator last, int n)
template<typename InputIterator , typename Func >
 Vector (InputIterator first, InputIterator last, Func func)
template<typename InputIterator , typename Func >
 Vector (InputIterator first, InputIterator last, Func func, int n)
Vectoroperator= (const Vector &other)
template<typename T >
Vectoroperator= (const T &x)
internal::ListInitialization
< iterator, init_type
operator= (init_type x)
R_len_t length () const
R_len_t size () const
size_t offset (const size_t &i, const size_t &j) const
size_t offset (const size_t &i) const
R_len_t offset (const std::string &name) const
template<typename U >
void fill (const U &u)
NamesProxy names () const
Proxy operator() (const size_t &i)
const_Proxy operator() (const size_t &i) const
NameProxy operator[] (const std::string &name)
NameProxy operator() (const std::string &name)
NameProxy operator[] (const std::string &name) const
NameProxy operator() (const std::string &name) const
Vectorsort ()
template<typename InputIterator >
void assign (InputIterator first, InputIterator last)
template<typename T >
void push_back (const T &object)
template<typename T >
void push_back (const T &object, const std::string &name)
template<typename T >
void push_front (const T &object)
template<typename T >
void push_front (const T &object, const std::string &name)
template<typename T >
iterator insert (iterator position, const T &object)
template<typename T >
iterator insert (int position, const T &object)
iterator erase (int position)
iterator erase (iterator position)
iterator erase (int first, int last)
iterator erase (iterator first, iterator last)
void update_vector ()
void set_sexp (SEXP x)
Indexer operator[] (const Range &range)
template<typename EXPR_VEC >
Vectoroperator+= (const VectorBase< RTYPE, true, EXPR_VEC > &rhs)
template<typename EXPR_VEC >
Vectoroperator+= (const VectorBase< RTYPE, false, EXPR_VEC > &rhs)
bool containsElementNamed (const char *target) const
template<>
 Vector (const sugar::SingleLogicalResult< NA, T > &obj)
template<>
Vector< REALSXP > & operator+= (const VectorBase< REALSXP, false, EXPR_VEC > &rhs)
template<>
Vector< REALSXP > & operator+= (const VectorBase< REALSXP, true, EXPR_VEC > &rhs)

Static Public Member Functions

template<typename U >
static Matrix diag (int size, const U &diag_value)
- Static Public Member Functions inherited from Vector< RTYPE >
static stored_type get_na ()
static bool is_na (stored_type x)
template<typename InputIterator >
static Vector import (InputIterator first, InputIterator last)
template<typename InputIterator , typename F >
static Vector import_transform (InputIterator first, InputIterator last, F f)
template<typename U >
static void replace_element (iterator it, SEXP names, int index, const U &u)
template<typename U >
static void replace_element__dispatch (traits::false_type, iterator it, SEXP names, int index, const U &u)
template<typename U >
static void replace_element__dispatch (traits::true_type, iterator it, SEXP names, int index, const U &u)
template<typename U >
static void replace_element__dispatch__isArgument (traits::false_type, iterator it, SEXP names, int index, const U &u)
template<typename U >
static void replace_element__dispatch__isArgument (traits::true_type, iterator it, SEXP names, int index, const U &u)
static Vector create ()

Private Member Functions

int offset (int i, int j) const
void update_matrix ()
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)
template<bool NA, typename MAT >
void import_matrix_expression (const MatrixBase< RTYPE, NA, MAT > &other, int nr, int nc)

Private Attributes

int nrows

Additional Inherited Members

- Protected Member Functions inherited from Vector< RTYPE >
int * dims () const
void init ()

Detailed Description

template<int RTYPE>
class Matrix< RTYPE >

Examples:
RcppGibbs/RcppGibbs.R.

Definition at line 28 of file Matrix.h.

Member Typedef Documentation

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

Definition at line 35 of file Matrix.h.

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

Definition at line 40 of file Matrix.h.

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

Definition at line 44 of file Matrix.h.

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

Definition at line 41 of file Matrix.h.

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

Definition at line 39 of file Matrix.h.

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

Definition at line 43 of file Matrix.h.

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

Definition at line 34 of file Matrix.h.

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

Definition at line 42 of file Matrix.h.

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

Definition at line 36 of file Matrix.h.

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

Definition at line 38 of file Matrix.h.

Constructor & Destructor Documentation

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

Definition at line 46 of file Matrix.h.

template<int RTYPE>
Matrix< RTYPE >::Matrix ( SEXP  x)

Definition at line 28 of file Matrix.h.

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

Definition at line 52 of file Matrix.h.

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

Definition at line 31 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 
)

Definition at line 37 of file Matrix.h.

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

Definition at line 44 of file Matrix.h.

References Matrix< RTYPE >::nrows.

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

Definition at line 55 of file Matrix.h.

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

Definition at line 59 of file Matrix.h.

References Matrix< RTYPE >::ncol(), and Matrix< RTYPE >::nrows.

Here is the call graph for this function:

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>
const_iterator Matrix< RTYPE >::begin ( ) const
inline

Reimplemented from Vector< RTYPE >.

Definition at line 83 of file Matrix.h.

References Vector< RTYPE >::begin().

Referenced by fastLm().

Here is the call graph for this function:

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

Reimplemented from Vector< RTYPE >.

Definition at line 85 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 73 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 81 of file Matrix.h.

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

Definition at line 80 of file Matrix.h.

References Matrix< RTYPE >::fill_diag().

Here is the call graph for this function:

template<int RTYPE>
const_iterator Matrix< RTYPE >::end ( ) const
inline

Reimplemented from Vector< RTYPE >.

Definition at line 84 of file Matrix.h.

References Vector< RTYPE >::end().

Here is the call graph for this function:

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

Reimplemented from Vector< RTYPE >.

Definition at line 86 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)

Definition at line 74 of file Matrix.h.

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

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

Definition at line 137 of file Matrix.h.

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

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 
)
private

Definition at line 151 of file Matrix.h.

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

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 
)
private

Definition at line 164 of file Matrix.h.

References i, and j.

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

Definition at line 67 of file Matrix.h.

References Vector< RTYPE >::dims().

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

Here is the call graph for this function:

template<int RTYPE>
int Matrix< RTYPE >::nrow ( ) const
inline

Definition at line 70 of file Matrix.h.

References Matrix< RTYPE >::nrows.

Referenced by fastLm(), and MatrixRow< RTYPE >::MatrixRow().

template<int RTYPE>
int Matrix< RTYPE >::offset ( int  i,
int  j 
) const
inlineprivate

Definition at line 108 of file Matrix.h.

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

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

Reimplemented from Vector< RTYPE >.

Definition at line 97 of file Matrix.h.

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

Reimplemented from Vector< RTYPE >.

Definition at line 102 of file Matrix.h.

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

Definition at line 107 of file Matrix.h.

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

Definition at line 112 of file Matrix.h.

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

Definition at line 117 of file Matrix.h.

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

Definition at line 122 of file Matrix.h.

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

Definition at line 126 of file Matrix.h.

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

Definition at line 131 of file Matrix.h.

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

Definition at line 64 of file Matrix.h.

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

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

Definition at line 70 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< RTYPE >::Proxy Matrix< RTYPE >::operator[] ( int  i)
inline

Reimplemented from Vector< RTYPE >.

Definition at line 87 of file Matrix.h.

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

Reimplemented from Vector< RTYPE >.

Definition at line 92 of file Matrix.h.

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

Definition at line 80 of file Matrix.h.

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

Definition at line 76 of file Matrix.h.

References Matrix< RTYPE >::nrows.

template<int RTYPE>
void Matrix< RTYPE >::update_matrix ( )
inlineprivate

Definition at line 110 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: