[Rcpp-devel] RcppArmadillo, solve always requires zgels?
Baptiste Auguie
baptiste.auguie at gmail.com
Sun May 31 10:47:33 CEST 2015
Dear list,
My cda package (https://github.com/baptiste/cda) solves a linear system
Ax=b with Armadillo; win-builder and CRAN complain about a missing "zgels_"
when trying to build on windows or mac, as it's not part of the subset of
LAPACK provided by R libraries (I asked about this in 2011). I have
included a copy of this file (zgels.f) from Netlib for the past few years
just to make the problem go away, but I've recently realised that zgels is
not supposed to be called! It builds fine on Linux, or any machine with a
full LAPACK installed, but I'm now wondering if solve() always calls zgels
(that would be inefficient for my use-case).
The matrix A is square: the system is not under/overdetermined, and I
believe Armadillo should select LU factorisation rather than (slower) QR.
Here's the error I get from win-builder when I remove zgels.f from my cda
package,
cd.o:cd.cpp:(.text$_ZN4arma6auxlib8solve_udISt7complexIdENS_3MatIS3_EEEEbRNS4_IT_EES8_RKNS_4BaseIS6_T0_EE[bool
arma::auxlib::solve_ud<std::complex<double>, arma::Mat<std::complex<double>
> >(arma::Mat<std::complex<double> >&, arma::Mat<std::complex<double> >&,
arma::Base<std::complex<double>, arma::Mat<std::complex<double> > >
const&)]+0x3a5): undefined reference to `zgels_'
So it thinks it should call solve_ud, which is meant for under-determined
systems. Why would that be?
I tried to find the relevant piece in the template code, this looks
relevant but I don't understand it:
https://github.com/RcppCore/RcppArmadillo/blob/master/inst/include/armadillo_bits/glue_solve_meat.hpp#L26
Best regards,
baptiste
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20150531/c06e500b/attachment.html>
More information about the Rcpp-devel
mailing list