Armadillo (C++ library)
http://en.wikipedia.org/wiki/Armadillo_(C%2B%2B_library)
From Wikipedia, the free encyclopedia
Armadillo C++ Library
Stable release 4.300 / May 2, 2014; 3 months ago
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 an 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 both open source and proprietary software. The project is supported by the NICTA research centre in Australia and is hosted by SourceForge.
Contents [hide]
1 Example
2 See also
3 References
4 External links
Example[edit]
Here is a trivial example demonstrating Armadillo functionality:
Armadillo is a C++ template library for linear algebra. It is built upon LAPACK and BLAS. It offers a simple API that is similar to that of Matlab.
1. Download the source code of Armadillo from here. Unzip the source code of Armadillo to a directory.
2. Create an environment variable named ARMADILLO_ROOT
with a value of the Armadillo directory.
3. Armadillo requires LAPACK and BLAS libraries for any non-trivial matrix operation. To enable it to use these libraries, open$(ARMADILLO_ROOT)/include/armadillo_bits/config.hpp
and uncomment the defines ofARMA_USE_LAPACK
and ARMA_USE_BLAS
.
4. To use Armadillo in your Visual C++ project, add $(ARMADILLO_ROOT)/include
as an Include directory.
5. Since Armadillo source code uses LAPACK and BLAS, your project needs to link with these libraries. Armadillo ships with pre-built 32-bit .lib
and .dll
files for LAPACK and BLAS. Add $(ARMADILLO_ROOT)/examples/lib_win32
as Library directory to your project. Add blas_win32_MT.lib
and lapack_win32_MT.lib
as additional dependencies to your project.
6. Include the armadillo
header file in your source code. Use the Armadillo classes and methods in your code. Remember to use the namespace arma::
Your code should compile to an EXE file without any further problems.
7. Copy the blas_win32_MT.dll
and lapack_win32_MT.dll
files from$(ARMADILLO_ROOT)/examples/lib_win32
to the directory that contains your EXE file. Your program should execute successfully now.
Tried with: Armadillo 3.920.2 and Visual Studio 2010
联系客服