mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-27 07:29:52 +08:00
16 lines
283 B
C++
16 lines
283 B
C++
|
#include <Eigen/Core>
|
||
|
#include <iostream>
|
||
|
|
||
|
using namespace Eigen;
|
||
|
using namespace std;
|
||
|
|
||
|
int main(void)
|
||
|
{
|
||
|
int const N = 5;
|
||
|
MatrixXi A(N,N);
|
||
|
A.setRandom();
|
||
|
cout << "A =\n" << A << '\n' << endl;
|
||
|
cout << "A(:,1..3) =\n" << A.middleCols<3>(1) << endl;
|
||
|
return 0;
|
||
|
}
|