Armadillo

Description

Armadillo is a high quality C++ linear algebra library, aiming towards a good balance between speed and ease of use; the syntax (API) is deliberately similar to Matlab.

Home Page

http://arma.sourceforge.net

Documentation

http://arma.sourceforge.net/docs.html

Usage

Use

# module avail Armadillo

to see which versions of Armadillo are available. Use

# module load Armadillo/version

to get access to Armadillo.

Example

Code example.cpp

#include <iostream>
#include <armadillo>

using namespace std;
using namespace arma;

int main(int argc, char** argv)
  {
  mat A = randu<mat>(4,5);
  mat B = randu<mat>(4,5);
  
  cout << A*B.t() << endl;
  
  return 0;
  }

Compile example.cpp

# modules load Armadillo/4.650.0
# g++ example.cpp -o example -O2 -larmadillo