Armadillo (C++ library)

Armadillo C++ Library
Stable release
7.500.0 / October 17, 2016 (2016-10-17)
Written in C++
Operating system Cross-platform
Available in English
Type Software library
License open source (MPL)
Website arma.sourceforge.net

Armadillo is a linear algebra software library for the C++ programming language. It aims to provide efficient and streamlined base calculations, while at the same time having a straightforward and easy-to-use interface. Its intended target users are scientists and engineers.

It supports integer, floating point (single and double precision), complex numbers, and a subset of trigonometric and statistics functions. Various matrix decompositions are provided through optional integration with Linear Algebra PACKage (LAPACK) and Automatically Tuned Linear Algebra Software (ATLAS) libraries.[1][2] High-performance LAPACK replacement libraries such as Math Kernel Library (MKL) and AMD Core Math Library (ACML) can also be used.

The library employs a delayed-evaluation approach (during compile time) to combine several operations into one and reduce (or eliminate) the need for temporaries. Where applicable, the order of operations is optimised. Delayed evaluation and optimisation are achieved through template metaprogramming.

Armadillo is related to the Boost Basic Linear Algebra Subprograms (uBLAS) library, which also uses template metaprogramming. However, Armadillo builds upon ATLAS and LAPACK libraries, thereby providing machine-dependent optimisations and functions not present in uBLAS.

It is open-source software distributed under the Mozilla Public License, making it applicable for the development of both open source and proprietary software. The project is supported by the NICTA research centre in Australia and is hosted by SourceForge.

Example

Here is a trivial example demonstrating Armadillo functionality:

#include <iostream>
#include <armadillo>

int main()
{
  arma::vec b;
  b << 2.0 << 5.0 << 2.0;

  // arma::endr represents the end of a row in a matrix
  arma::mat A;
  A << 1.0 << 2.0 << arma::endr
    << 2.0 << 3.0 << arma::endr
    << 1.0 << 3.0 << arma::endr;

  std::cout << "Least squares solution:\n";
  std::cout << solve(A,b) << '\n';

  return 0;
}

See also

References

  1. Conrad Sanderson and Ryan Curtin (2016). "Armadillo: a template-based C++ library for linear algebra". Journal of Open Source Software. 1: 26.
  2. Ryan Curtin; et al. (2013). "MLPACK: A Scalable C++ Machine Learning Library". Journal of Machine Learning Research (JMLR). 14 (Mar): 801–805.

External links

This article is issued from Wikipedia - version of the 10/18/2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.