Project details for Armadillo library

Screenshot Armadillo library 0.4.0

by cu24gjf - January 28, 2009, 14:23:50 CET [ Project Homepage BibTeX Download ]

view (25 today), download ( 5 today ), 5 subscriptions

OverallWhole StarWhole StarWhole StarWhole StarEmpty Star
FeaturesWhole StarWhole StarWhole StarWhole Star1/2 Star
UsabilityWhole StarWhole StarWhole StarWhole Star1/2 Star
DocumentationWhole StarWhole StarWhole Star1/2 StarEmpty Star
(based on 3 votes)

C++ linear algebra library aiming towards a good balance between speed and ease of use. Optional interfaces to LAPACK and ATLAS. Uses recursive templates and template meta-programming to combine several operations into one and reduce the need for temporaries.

Changes to previous version:

Initial Announcement on

BibTeX Entry: Download
URL: Project Homepage
Supported Operating Systems: Linux, Macosx
Data Formats: None
Tags: Atlas, Lapack, Linear Algebra
Archive: download here

Other available revisons

Version Changelog Date
  • faster handling of band matrices by solve() and chol()
  • faster incremental construction of sparse matrices via element access operators
  • faster diagonal views in sparse matrices
  • faster handling of sparse matrices by repmat()
  • faster loading of CSV files
  • faster gmm_diag class, for Gaussian mixture models with diagonal covariance matrices
  • speedups via expanded use of OpenMP by many element-wise functions
  • expanded kron() to handle sparse matrices
  • expanded index_min() and index_max() to handle cubes
  • expanded SpMat to save/load sparse matrices in coord format
  • expanded .save() to allow appending new datasets to existing HDF5 files
  • expanded .save()/.load() to allow specification of datasets within HDF5 files
  • expanded .each_slice() to optionally use OpenMP for multi-threaded execution
  • expanded clamp() to handle cubes
  • added submatrix & subcube iterators
  • added normpdf(), normcdf(), mvnrnd()
  • added chi2rnd(), wishrnd(), iwishrnd()
  • added gmm_full class, for Gaussian mixture models with full covariance matrices
  • added affmul() to simplify application of affine transformations
  • added intersect() for finding common elements in two vectors/matrices
February 20, 2018, 03:26:16
  • more accurate sparse eigen decomposition by eigs_sym() and eigs_gen()
  • more robust handling of non-square matrices by lu()
  • expanded qz() to optionally specify ordering of the Schur form
  • expanded .each_slice() in the Cube class to support matrix multiplication
  • expanded several functions to handle sparse matrices
  • added expmat_sym(), logmat_sympd(), sqrtmat_sympd() for handling symmetric matrices
  • added polyfit() and polyval() for polynomial fitting
  • fix for aliasing issue in convolution functions conv() and conv2()
  • fix for memory leak in the field class when compiling in C++11/C++14 mode
March 8, 2017, 10:11:25
  • eigs_sym(), eigs_gen() and svds() now use a built-in reimplementation of ARPACK; contributed by Yixuan Qiu
  • faster handling of compound expressions by vectorise()
  • added .index_min() and .index_max()
  • added erf(), erfc(), lgamma()
  • added .head_slices() and .tail_slices() to subcube views
  • expanded ind2sub() to handle vectors of indices
  • expanded sub2ind() to handle matrix of subscripts
  • expanded expmat(), logmat() and sqrtmat() to optionally return a bool indicating success
  • spsolve() now requires SuperLU 5.2
July 10, 2016, 15:44:07
  • added trapz() for numerical integration
  • added logmat() for calcuating the matrix logarithm
  • added approx_equal() for determining approximate equality
  • added regspace() for generating vectors with regularly spaced elements
  • added logspace() for generating vectors with logarithmically spaced elements
  • expanded .save() and .load() with hdf5_binary_trans file type, to save/load data with columns transposed to rows
  • fixes for trunc_log() and trunc_exp()
April 24, 2016, 05:08:11
  • expanded sum(), mean(), min(), max() to handle cubes
  • expanded Cube class to handle arbitrarily sized empty cubes
  • added shift() for circular shifts of elements
  • added sqrtmat() for finding the square root of a matrix
  • fix for gmm_diag when using Mahalanobis distance
March 16, 2016, 05:18:36
  • added stand-alone kmeans() function for clustering data
  • added trunc(), ind2sub() and sub2ind()
  • added conv2() for 2D convolution
  • extended conv() to optionally provide central convolution
  • expanded each_col(), each_row() and each_slice() to handle C++11 lambda functions
  • faster handling of multiply-and-accumulate by accu() when using Intel MKL, ATLAS or OpenBLAS
  • fixes for corner cases in gmm_diag class
January 27, 2016, 12:11:29
  • expanded solve() to find approximate solutions for rank-deficient systems
  • faster handling of non-contiguous submatrix views in compound expressions
  • added .for_each() to Mat, Row, Col, Cube and field classes
  • added rcond() for estimating the reciprocal condition number
  • fixes for the sparse solver
December 7, 2015, 05:27:27
  • expanded diagmat() to handle non-square matrices and arbitrary diagonals
  • expanded trace() to handle non-square matrices
  • correction for datum::Z_0 constant
  • bug fixes for sparse eigen decomposition
November 15, 2015, 06:54:50
  • faster norm() and normalise() when using Intel MKL, ATLAS or OpenBLAS
  • faster handling of compound expressions by join_rows() and join_cols()
  • added Schur decomposition: schur()
  • added .each_slice() for repeated matrix operations on each slice of a cube
  • expanded join_slices() to handle joining cubes with matrices
  • expanded .each_col() and .each_row() to handle out-of-place operations
  • stricter handling of matrix objects by hist() and histc()
  • Cube class now delays allocation of .slice() related structures until needed
October 3, 2015, 07:12:38
  • added null() for finding the orthonormal basis of null space
  • added find_unique() for finding indices of unique values
  • added diff() for calculating differences between consecutive elements
  • added cumprod() for calculating cumulative product
  • expanded interp1() to handle repeated locations
  • expanded unique() to handle complex numbers
  • expanded object constructors to handle size() based specification of dimensions
  • faster handling of submatrix rows
  • faster clamp()
  • faster flipud()
  • faster row-wise cumsum()
  • fixes for handling sparse matrices
  • fix for k-means clustering in gmm_diag class
September 5, 2015, 04:52:44
  • added generalised Schur decomposition: qz()
  • added .has_inf() and .has_nan()
  • expanded interp1() to handle out-of-domain locations
  • expanded sparse matrix class with .set_imag() and .set_real()
  • expanded imag(), real() and conj() to handle sparse matrices
  • expanded diagmat(), reshape() and resize() to handle sparse matrices
  • faster sparse sum()
  • faster row-wise sum(), mean(), min(), max()
  • updated physical constants to NIST 2014 CODATA values
  • fixes for handling sparse submatrix views
August 7, 2015, 03:09:40
  • added interp1() for 1D interpolation
  • added orth() for finding the orthonormal basis of range space
  • added .is_sorted() for checking whether a vector or matrix has sorted elements
  • updated physical constants to NIST 2010 CODATA values
  • expanded element initialisation to handle nested initialiser lists (C++11)
  • workarounds for bugs in GCC, Intel and MSVC C++ compilers
  • Armadillo can make use of GPUs by linking with NVIDIA NVBLAS (a GPU-accelerated implementation of BLAS), or by linking with AMD ACML (which can use GPUs via OpenCL)
June 25, 2015, 02:50:49
  • added spsolve() for solving sparse systems of linear equations
  • added svds() for singular value decomposition of sparse matrices
  • added nonzeros() for extracting non-zero values from matrices
  • added handling of diagonal views by sparse matrices
  • expanded repmat() to handle sparse matrices
  • expanded join_rows() and join_cols() to handle sparse matrices
  • sort_index() and stable_sort_index() have been placed in the delayed operations framework for increased efficiency
  • use of 64 bit integers is automatically enabled when using C++11
  • workaround for a bug in recent releases of Apple Xcode
  • workaround for a bug in LAPACK 3.5
April 13, 2015, 05:05:36
  • added .head_rows() and .tail_rows() to submatrix views
  • added .head_cols() and .tail_cols() to submatrix views
  • added randg() for generating random values from gamma distributions
  • expanded eigs_sym() to optionally calculate eigenvalues with smallest/largest algebraic values
  • fixes for handling of sparse matrices
February 25, 2015, 05:11:06
  • added .head() and .tail() to submatrix views
  • faster matrix transposes within compound expressions
  • faster accu() and norm() when compiling with -O3 -ffast-math -march=native (gcc and clang)
  • improved documentation
January 5, 2015, 01:22:25
  • added matrix exponential function: expmat()
  • faster .log_p() and .avg_log_p() functions in the Gaussian mixture model class
  • faster handling of in-place addition/subtraction of expressions with an outer product
  • workaround for a bug in GCC 4.4
December 5, 2014, 03:24:54
  • faster handling of complex vectors by norm()
  • expanded chol() to optionally specify output matrix as upper or lower triangular
  • better handling of non-finite values when saving matrices as text files
November 4, 2014, 02:37:37
  • faster handling of matrix transposes within compound expressions
  • expanded symmatu()/symmatl() to optionally disable taking the complex conjugate of elements
  • expanded sort_index() to handle complex vectors
  • expanded the gaussian mixture modelling class with functions to generate random samples
September 21, 2014, 06:47:34
  • faster handling of aliasing by submatrix views
  • faster handling of subvectors by dot()
  • added clamp() for clamping values to be between lower and upper limits
  • expanded batch insertion constructors for sparse matrices to add values at repeated locations
  • added gmm_diag class for statistical modelling using Gaussian Mixture Models; includes multi-threaded implementation of k-means and Expectation-Maximisation algorithms
August 20, 2014, 10:15:37
  • expanded sparse eigen-decomposition functions eigs_sym() and eigs_gen() to use an optional tolerance parameter
  • expanded dense eigen-decomposition function eig_sym() to automatically fall back to standard decomposition method if divide-and-conquer fails
  • expanded interactions between cube tubes and vectors
  • fix for saving cubes in HDF5 format
July 12, 2014, 06:03:01
  • faster find()
  • faster transpose of sparse matrices
  • faster inverse of matrices marked as diagonal
  • more efficient handling of aliasing during matrix multiplication
  • added find_finite() and find_nonfinite() for finding indices of finite and non-finite elements
  • expressions X=inv(A) * B * C and X=A.i() * B * C are automatically converted to X=solve(A,B * C)
  • cmake-based installer enables use of C++11 random number generator when using gcc 4.9+ in C++11 mode
May 5, 2014, 02:43:05
  • added normalise() for normalising vectors to unit p-norm
  • extended the field class to handle 3D layout
  • extended eigs_sym() and eigs_gen() to obtain eigenvalues of various forms (eg. largest or smallest magnitude)
  • automatic SIMD vectorisation of elementary expressions (eg. matrix addition) when using Clang 3.4+ with -O3 optimisation
  • faster handling of sparse submatrix views
  • workaround for a bug in LAPACK 3.4
February 28, 2014, 07:53:24
  • added MEX connector for interfacing Octave/Matlab with Armadillo matrices (contributed by George Yammine)
  • faster divide-and-conquer decompositions are now used by default for svd(), svd_econ(), pinv(), eig_sym(), princomp(), rank()
  • added eigen decomposition for pair of matrices: eig_pair()
  • added simpler forms of eig_gen()
  • added condition number of matrices: cond()
  • expanded find() to handle cubes (3rd order tensors)
  • expanded subcube views to access elements specified in a vector
  • template argument for running_stat_vec expanded to accept vector types
  • more robust fast inverse of 4x4 matrices
  • added eigen decompositions of sparse matrices: eigs_sym() and eigs_gen()
January 6, 2014, 03:59:23
  • added divide-and-conquer variant of svd_econ(), for faster SVD
  • added divide-and-conquer variant of pinv(), for faster pseudo-inverse
  • added element-wise variants of min() and max()
  • added size() based specifications of submatrix view sizes
  • added randi() for generating matrices with random integer values
  • added inplace_trans() for memory efficient in-place transposes (contributed by Alexandre Drouin)
  • added more intuitive specification of sort direction in sort() and sort_index()
  • added more intuitive specification of method in det(), .i(), inv() and solve()
  • added more precise timer for the wall_clock class when using C++11
December 10, 2013, 05:12:39
  • faster multiplication of a matrix with a transpose of itself
  • faster round(), exp2() and log2() when using C++11
  • added signum function: sign()
  • added move constructors when using C++11
  • added 2D fast Fourier transform: fft2()
  • added .tube() for easier extraction of vectors and subcubes from cubes
  • added vectorise() for reshaping matrices into vectors
  • added all() and any() for indicating presence of elements satisfying a relational condition
  • minor fix for inplace reshape()
  • minor corrections for compilation issues under GCC 4.8+ and MSVC
November 1, 2013, 03:19:07
  • added automatic SSE2 vectorisation of elementary expressions (eg. matrix addition) when using GCC 4.7+ with -O3 optimisation
  • added detection of the OpenBLAS library during installation, which provides multi-threaded (parallelised) matrix multiplication
  • added support for saving & loading of cubes in HDF5 format
  • much faster median()
  • faster handling of compound expressions with transposes of complex vectors or submatrix rows
  • faster as_scalar() for compound expressions
  • minor fix for linking with MKL on Ubuntu systems
June 4, 2013, 15:59:18
  • added fast Fourier transform
  • added handling of .imbue() and .transform() by submatrices and subcubes
  • added batch insertion constructors for sparse matrices
  • minor fix for multiplication of complex sparse matrices
  • better detection of recent Intel MKL versions during installation
April 22, 2013, 05:24:18
  • Armadillo is now licensed using the Mozilla Public License 2.0
  • added .imbue() for filling a matrix/cube with values provided by a functor or C++11 lambda expression
  • added .swap() for quickly swapping contents with another matrix
  • added .transform() for transforming a matrix/cube using a functor or C++11 lambda expression
  • added round() for rounding matrix elements towards nearest integer
  • faster find(), for finding indices of elements according to a relational expression
  • fixes for handling non-square matrices by qr() and qr_econ()
  • minor fixes for handling empty matrices
  • reduction of pedantic compiler warnings under gcc 4.8
March 5, 2013, 04:41:51
  • faster determinant for diagonal and triangular matrices
  • faster trace()
  • fix for handling sparse matrices by dot()
  • fixes for interactions between sparse and dense matrices
  • more fine-grained handling of 64 bit integers
February 1, 2013, 08:36:22
  • faster handling of compound expressions with submatrices and subcubes
  • added support for loading matrices as text files with NaN and Inf elements
  • added stable_sort_index(), which preserves the relative order of elements with equivalent values
  • added handling of sparse matrices by mean(), var(), norm(), abs(), square(), sqrt()
  • added saving and loading of sparse matrices in arma_binary format
December 7, 2012, 06:13:25
  • added preliminary support for sparse matrices
  • added economical QR decomposition: qr_econ()
  • added .each_col() & .each_row(), for vector operations repeated on each column/row
  • faster randn()
  • faster singular value decomposition via divide-and-conquer algorithm
September 6, 2012, 10:33:19
  • faster eigen decomposition via "divide and conquer" algorithm
  • faster transpose of vectors and compound expressions
  • faster handling of diagonal views
  • faster handling of tiny fixed size vectors (≤ 4 elements)
  • added unique(), for finding unique elements of a matrix
May 21, 2012, 06:11:27
  • added shorthand for matrix inverse
  • faster repmat()
  • fixes for handling diagonal matrices
  • fixes for compilation errors
  • fixes for potential aliasing issues
April 25, 2012, 04:26:17
  • added non-contiguous submatrix views
  • faster handling of submatrix views with one column or row
  • faster generation of random numbers
  • faster element access in fixed size matrices
  • better detection of compound vector expressions by various functions
March 28, 2012, 18:02:57
  • added shorter forms of transposes
  • added optional use of 64 bit indices, allowing matrices to have more than 4 billion elements
  • added experimental support for C++11 initialiser lists
  • faster pinv()
  • faster inplace transpose
  • fix for speed issue in as_scalar()
  • bugfixes for handling expressions with aliasing and submatrices
  • refactored code to eliminate warnings when using the Clang C++ compiler
November 16, 2011, 09:29:31
  • added economical singular value decomposition
  • faster multiplication of small matrices
  • faster transpose
  • faster handling of submatrices by norm()
  • fixes for handling of complex numbers by cov(), cor(), running_stat_vec
  • fix for handling of conjugate transpose by as_scalar()
  • fix for handling of aliasing by diagmat()
  • fix for handling of empty matrices by symmatu()/symmatl()
June 26, 2011, 07:07:53
  • faster inverse of symmetric matrices
  • faster element access for fixed size matrices
  • faster multiplication of tiny matrices (eg. 4x4)
  • faster compound expressions containing submatrices
  • added handling of arbitrarily sized empty matrices (eg. 5x0)
  • added syl(), for solving Sylvester's equation
  • added submatrices of submatrices
  • added .count() to running_stat and running_stat_vec
  • most functions with matrix inputs no longer throw exceptions for empty matrices
May 28, 2011, 05:10:22
  • Added interpretation of arbitrary "flat" subcubes as matrices
  • Added floor() and ceil()
  • Faster min(), max(), mean(), sort(), prod()
  • Faster solve() for compound expressions
  • Fixed size matrices and vectors can use auxiliary (external) memory
  • Bugfix for compilation using GCC's C++0x mode
  • Bugfix for matrix handling by subcubes
  • Bugfix for a corner case with NaNs in min() and max()
  • Updated installation to detect recent versions of Intel's MKL
March 10, 2011, 15:29:43
  • Extended submatrix views, including access to elements whose indices are specified in a separate vector
  • Added handling of raw binary files by save/load functions
  • Added cumsum()
  • Added interpretation of matrices as triangular via trimatu()/trimatl()
  • Faster solve() and inv() via explicit handling of triangular matrices
  • The stream for logging of errors and warnings can now be changed
January 7, 2011, 00:30:21
  • added matrix norms
  • added overview technical report
  • speedups and bugfixes in LU decomposition
  • fixes for compilation issues under the Intel C++ compiler
  • minimisation of pedantic compiler warnings
November 11, 2010, 11:56:53
  • Many speedups due to internal architecture improvements
  • Added template-based size specification of matrices
  • Added insertion/deletion of rows & columns
  • Added insertion/deletion of cube slices
  • Added set_imag() & set_real()
  • Added in-place operations on diagonals
  • Fixes for a few corner cases
September 22, 2010, 01:20:11
  • Added detection of MKL & ACML (high speed LAPACK) during installation
  • Added MSVC project files for compiling examples
  • Added conversions to/from std::vector
  • Added convolution operation
  • Added toeplitz()
  • Added matrix initialisation via the << operator
  • More flexible reshape()
  • More consistent success indication by decomposition functions
  • Faster compilation by omitting Boost where possible
  • Various speedups and bug fixes
August 5, 2010, 13:16:54
  • Added STL-style iterators
  • Added join_rows()/join_cols() for appending matrices
  • Added partial clone of Matlab/Octave's find()
  • Added cross product: cross()
  • Added PCA: princomp_cov()
  • Various bug fixes and speedups
April 29, 2010, 04:34:50
  • extended and overhauled expression evaluation framework, for faster handling of compound expressions
  • improvements in the documentation, including a conversion table between Matlab and Armadillo syntax
February 8, 2010, 04:06:17
  • Added pinv(), rank(), kron(), prod(), eps(), shuffle()
  • Added ‘running_stat_vec’ class, for on-the-fly statistics of vectors
  • Improvements and bugfixes in handling of submatrix views
  • Speedups for some compound expressions
  • Initial support for dodgy compilers
December 14, 2009, 09:07:38

Changes since version 0.6.12:

  • Added the Cube class (aka "3D matrix" or a set of matrices with contiguous memory)
  • Added creation of matrix instances using auxiliary memory
  • Added a clone of Matlab's repmat() function
  • Bugfixes for det() and lu()

Changes since version 0.6.11:

  • Code cleanup for better conformance to the C++ standard
  • Added raw_print()
  • Added a collection of physical constants
  • Miscellaneous documentation and installation improvements
October 7, 2009, 10:28:10

Changes since version 0.6.11:

  • Code cleanup for better conformance to the C++ standard
  • Added raw_print()
  • Added a collection of physical constants
  • Miscellaneous documentation and installation improvements

Changes since version 0.6.7:

  • Eigen decomposition of generic (non-symmetric) matrices
  • Bug fix for solve() when using complex numbers
  • More elaborate class destructors for better debugging of user code
  • Miscellaneous documentation and installation improvements
July 7, 2009, 03:59:34

Changes since version 0.6.11:

  • Code cleanup for better conformance to the C++ standard
  • Added raw_print()
  • Added a collection of physical constants
  • Miscellaneous documentation and installation improvements

Changes since version 0.6.7:

  • Eigen decomposition of generic (non-symmetric) matrices
  • Bug fix for solve() when using complex numbers
  • More elaborate class destructors for better debugging of user code
  • Miscellaneous documentation and installation improvements
May 20, 2009, 05:58:14

Changes since version 0.6.2:

Added functionality:

  • Performance tweaks, which can result in speedups of 30% for small matrices
  • Added running_stat class for on-the-fly statistics
  • Colour PPM images can now be loaded as fields of matrices
  • Renamed main classes for better code readability
  • Better installation on 64 bit systems

Bug fixes:

  • template detection of combined multiply and addition operations
April 16, 2009, 07:54:55

Changes since version 0.5.0:

Added functionality: - solve(), for solving systems of linear equations
- svd(), singular value decomposition
- expressions can now have mixed matrix types
- complex number versions of statistics functions
- reworked operators, providing more flexibility

Bug fixes:
- sign of scalar produced by det()
- handling of single row and column submats by statistics functions

March 29, 2009, 06:05:14

Added functionality: - Cholesky and QR decompositions - element-wise division - comparison operators - more elegant restriction of template parameters

Bug fixes: - handling of diagonal matrices created from vectors - compilation of examples under MacOS X

Other changes: - faster matrix inverse - license change to LGPL v3+ - updated and re-arranged documentation

March 9, 2009, 14:35:54

Initial Announcement on

January 28, 2009, 14:21:30


No one has posted any comments yet. Perhaps you'd like to be the first?

Leave a comment

You must be logged in to post comments.