cib icon indicating copy to clipboard operation
cib copied to clipboard

Add example for Armadillo numerical processing library

Open rajsite opened this issue 5 years ago • 0 comments

This project is really interesting!

I was able to get Armadillo to compile: http://arma.sourceforge.net/ Using the github pages branch locally, taking the armadillo download, and repackaging it as a zip:

// cib:{"fetch":"armadillo-9.200.7.zip", "system_includes":["include"], "unzip_compiler":true}

#define ARMA_DONT_USE_LAPACK
#define ARMA_DONT_USE_BLAS
#define ARMA_DONT_USE_NEWARP
#define ARMA_DONT_USE_ARPACK
#define ARMA_DONT_USE_SUPERLU
#define ARMA_DONT_USE_HDF5
#define ARMA_DONT_USE_OPENMP

#include <armadillo>
#include <stdio.h>

using namespace std;
using namespace arma;

int main() {
    mat A = randu<mat>(4,5);
    mat B = randu<mat>(4,5);
    printf("%f\n", A[0]);
    return 0;
}

I had to use the printf instead of the examples cout << A*B.t() << endl; because of https://github.com/tbfleming/cib/issues/17

Having this available in the browser could be really useful!

rajsite avatar Feb 24 '19 10:02 rajsite