Skip to content
Back to formatted view

Raw Message

Message-ID: <19950.62311.305041.354932@max.nulle.part>
Date: 2011-06-08T03:58:31Z
From: Dirk Eddelbuettel
Subject: [Rcpp-devel] redimension help
In-Reply-To: <19950.61008.918431.648088@max.nulle.part>

David,

One last thing: you are trying something difficult with large
multi-dimensional objects.

I really recommend that you try to become more familiar with a more STL-ish
way of doing things. Try something simpler on std::vector<> et al -- how you
can change dimension, expand, remove, ... without _ever_ having to worry
about manual memory allocation via new / delete (or, worse, malloc /
free). That is a good thing.  If you really know the size of objects, try
reserve() or size().

Our Rcpp objects are pretty similar in some aspects, but because they really
shadow the underlying R objects (those SEXPs) they are still different.  It
takes some getting used, and I have no better recommendation than to read
more documentation and working code -- there are 20+ packages on CRAN using
Rcpp.  You may find something close to your needs for closer study.

Hope this helps, Dirk

-- 
Gauss once played himself in a zero-sum game and won $50.
                      -- #11 at http://www.gaussfacts.com