MCPcopy Create free account
hub / github.com/RcppCore/Rcpp / no_init_matrix

Class no_init_matrix

inst/include/Rcpp/vector/no_init.h:51–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49} ;
50
51class no_init_matrix {
52public:
53 no_init_matrix(int nr_, int nc_): nr(nr_), nc(nc_) {}
54
55 inline int nrow() const {
56 return nr;
57 }
58
59 inline int ncol() const {
60 return nc;
61 }
62
63 template <int RTYPE, template <class> class StoragePolicy >
64 operator Matrix<RTYPE, StoragePolicy>() const {
65 // Explicitly protect temporary matrix to avoid false positive
66 // with rchk (#892)
67 Shield<SEXP> x(Rf_allocMatrix(RTYPE, nr, nc));
68 Matrix<RTYPE, PreserveStorage> ret(x);
69 return ret;
70 }
71
72private:
73 int nr;
74 int nc;
75} ;
76
77inline no_init_vector no_init(R_xlen_t size) {
78 return no_init_vector(size);

Callers 1

no_initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected