Skip to content
Prev 2457 / 10988 Next

[Rcpp-devel] Wrapping uBlas Matrices into Rcpp Matrices

On Mon, Jun 6, 2011 at 6:55 AM, Romain Francois
<romain at r-enthusiasts.com> wrote:
I haven't looked much at the dense matrix structures in ublas but the
sparse matrix templated classes have many arguments with default
values.  The contents can be represented in different types of vector
structures for which the default is the ublas::unbounded_array<T>
structure.  However, you can use a std::vector<T> instead - they just
feel that their unbounded_array template, which is slightly less
general than a std::vector template, will be more efficient.

So the first step is either to wrap the different ublas vector
structures or to use typedef's to specialize the matrix templates to
use column major dense representations with storage through
std::vector objects.