[Solved] Bad Math with value multiplied by -1?

Although you believe your code is similar to this: #include <iostream> double f() { double x = 3; return x * -1; } int main() { std::cout << f() << std::endl; } The code you have actually takes the type of x from the result of a vector’s size() – this returns a std::size_t: #include … Read more

[Solved] Moving from sourceCpp to a package with RcppArmadillo

There are a few things that could be wrong. Primarily, you do need to modify the DESCRIPTION file to include LinkingTo: Rcpp, RcppArmadillo and ensure that #include <RcppArmadillo.h> is present in each .cpp file in the /src directory. You will also need to include two Makevars files. Makevars.win and Makevars with: PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) … Read more