Skip to content

Instantly share code, notes, and snippets.

@rundel
Created May 31, 2013 19:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rundel/5687320 to your computer and use it in GitHub Desktop.
Save rundel/5687320 to your computer and use it in GitHub Desktop.
Standalone arma example
#include <RcppArmadilloConfig.h>
#undef ARMA_DEFAULT_OSTREAM
#define ARMA_DEFAULT_OSTREAM std::cout
#include <armadillo>
int main()
{
arma::mat M;
M.load("tmp.dat");
arma::mat L;
if(arma::chol(L,M))
{
std::cout << "Worked!\n";
} else {
std::cout << "Failed!\n";
}
}
g++ -DNDEBUG -I"/home/rundel/R/library/RcppArmadillo/include" -fpic -O2 -pipe -g -c chol_test.cpp -o chol_test.o
g++ -o chol_test chol_test.o -llapack -lblas -lgfortran -lm -lquadmath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment