I. Summary
These two days to think up to do the work of neural network, requires the completion of C + + neural network algorithm.
In front of the first problem is that the neural network algorithm used in a large number of matrix operations. However, C + + does not have a very good support for matrix operations like MATLAB. Originally prepared to write a C + + matrix operation of the code, Google a bit later. Found a few good C + + matrix operations Library, I chose to eigen this C + + matrix operations Library.
Eigen has a lot of features:
L supports matrix operations of all sizes, fixed from very small size matrices. To random large dense matrix operations, and even sparse matrix operations it also supports.
L support all current standard data types. In addition to the integer, floating-point type we often use. It also supports plural types and their own definition types at the same time, see: Http://eigen.tuxfamily.org/dox/TopicCustomizingEigen.html#CustomScalarType
L support a large number of matrix decomposition and matrix space transformation operations, see:
Http://eigen.tuxfamily.org/dox/group__TopicLinearAlgebraDecompositions.html
Http://eigen.tuxfamily.org/dox/group__TutorialGeometry.html
L support a large number of dedicated modules. For example: nonlinear optimization, polynomial solution, FFT and so on, but these special modules are not in the Eigen source code, need to download separately. See:
Http://eigen.tuxfamily.org/dox/unsupported/index.html
L Fast operation, based on inter SSE 2/3/4 instruction set.
Second, download and install2.1 Downloads
Eigen's homepage is: http://eigen.tuxfamily.org/index.php?title=Main_Page
At the time of writing this article, Eigen's version number has reached 3.3.2.
Download links to the latest version of the Eigen on the homepage, or simply use the links below to download:
http://bitbucket.org/eigen/eigen/get/3.2.2.tar.bz2
The file name after download is called EIGEN-EIGEN-1F059A5AC4AC. Unzip, and change the file name to Eigen3, I took this entire document to D:\Program files.
2.2 Installation
Because Eigen is composed of some header files, it is not necessary to compile the eigen, it can be used directly, and platform-independent.
Here is the main concern is the Eigen3/eigen directory, this directory below is the Eigen source code, that is, we need to join the header file directory.
In the Eigen directory below the eigen3/unsupported directory. It is the code of some extension function of eigen, if necessary, can also join this header file directory.
Here I'm using Vs2012 to do a test. After you create a new empty project, configure the project properties. Here I just added the path to the core code of Eigen.
Third, Test
<span style= "FONT-SIZE:18PX;" > #include <iostream> #include <eigen/dense>using eigen::matrixxd; int main () { matrixxdm (2,2); M (0,0) = 3; M (1,0) = 2.5; M (0,1) =-1; M (() = m (1,0) + m (0,1); std::cout<< m << Std::endl;} </span>
Copyright notice: This article Bo Master original article. Blog, not reproduced without consent.
Duanxx Design abroad:c++ Matrix Operations Library Eigen Overview