I. Overview
These two days to think up to do the work of the neural network, the need to complete the neural network algorithm in C + +.
In front of the first problem is that the neural network algorithm used in a large number of matrix operations, but C + + is not like MATLAB, the matrix operations have a good support, originally prepared to write a C + + matrix operation of the code, Google a bit, and found a few good C + + matrix operations Library, I chose Eigen, the C + + matrix operations Library.
Eigen has a very rich range of features:
L support all sizes of matrix operations, from a small fixed matrix operation to any large dense matrix operation, even the sparse matrix operation it is also supported.
L support all current standard data types, in addition to our commonly used integral type, floating point type, it also supports complex types and custom types, etc., 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 special modules, such as: Non-linear optimization, polynomial solution, FFT, etc., 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 High-speed operation, based on inter SSE 2/3/4 instruction set to do operational optimization
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 has reached 3.3.2.
The latest version of Eigen's download link is available on the homepage, or you can download it directly using the link below:
http://bitbucket.org/eigen/eigen/get/3.2.2.tar.bz2
After downloading the file name Eigen-eigen-1f059a5ac4ac, unzip, and change the file name to Eigen3, I took this whole document to D:\Program files.
2.2 Installation
Since Eigen is made up of only a few 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 folder, the folder below is the Eigen source code, that is, we need to add the header file directory.
In the Eigen3/unsupported folder under the Eigen folder, is eigen some of the extension features of the code, if necessary, you can also add this header file directory.
Here I am using Vs2012 to do the test, after creating an empty project, configure the project properties, here I only add the path of the core code of Eigen.
third, testing
<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>
Duanxx Design abroad:c++ Matrix Operations Library Eigen Overview