반응형
Install |
VS 2010 Example |
그림과 같이 설치 경로 지정
#include <eigen/dense> using Eigen::MatrixXd; void ClassName::TestFunc() { MatrixXd m(2,2); m(0,0) = 3; m(1,0) = 2.5; m(0,1) = -1; m(1,1) = m(1,0) + m(0,1); std::cout << m << std::endl; m = m*m.inverse(); std::cout << m << std::endl; return 0; }
#include <Eigen/Dense> #include <iostream> using namespace std; using namespace Eigen; int main() { Array22f m; m << 1,2, 3,4; Array44f a = Array44f::Constant(0.6); cout << "Here is the array a:" << endl << a << endl << endl; a.block<2,2>(1,1) = m; cout << "Here is now a with m copied into its central 2x2 block:" << endl << a << endl << endl; a.block(0,0,2,3) = a.block(2,1,2,3); cout << "Here is now a with bottom-right 2x3 block copied into top-left 2x2 block:" << endl << a << endl << endl; }
Here is the array a: 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 Here is now a with m copied into its central 2x2 block: 0.6 0.6 0.6 0.6 0.6 1 2 0.6 0.6 3 4 0.6 0.6 0.6 0.6 0.6 Here is now a with bottom-right 2x3 block copied into top-left 2x2 block: 3 4 0.6 0.6 0.6 0.6 0.6 0.6 0.6 3 4 0.6 0.6 0.6 0.6 0.6
반응형
'Programming > MFC-C++' 카테고리의 다른 글
람다 표현식(Lambda expression) (0) | 2015.05.13 |
---|---|
Cmd 명령 실행, 제어, Pipe, SpawnAndRedirect (0) | 2015.05.13 |
Matlab fitgeotrans function convert C++ (0) | 2015.05.08 |
채팅 프로그램을 위한 라이브러리 Socket.IO C++ (0) | 2015.04.16 |
[MFC] 비트맵 투명 관련 Draw (0) | 2015.03.18 |