Skip to content

[Rcpp-devel] RcppArmadillo, solve always requires zgels?

1 message · Baptiste Auguie

#
Hi,

I attach a minimal sourceCpp file:

Rcpp::sourceCpp('testzgels.cpp')

provides extra debugging info, and shows my complete lack of understanding
of c++ templates. It would appear that upon compilation, all cases (nrow ==
ncol, nrow > ncol, nrow < ncol) are considered (of course: the matrix A has
no size information for the compiler). The size check is only performed
when calling the function, and dispatches to the correct LAPACK routine
(gels vs gesv).

Now, unfortunately this example does not help me solve a more specialised
case, where **I know** only square matrices will be passed. I do not need
the various possible routines, which in fact won't be all available within
R's subset of LAPACK.
zgels is assumed to be required (by CRAN and win-builder), presumably
because the templates cater for all possible cases and the code-checking
just looks up the list of symbol names, although in actuality it would
never be used. Does that make sense? How could I specialise the code to
restrict solve to square systems?

Thanks,

baptiste
On 1 June 2015 at 10:13, Dirk Eddelbuettel <edd at debian.org> wrote:

            
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20150601/c65586f2/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testzgels.cpp
Type: text/x-c++src
Size: 608 bytes
Desc: not available
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20150601/c65586f2/attachment-0001.cpp>