COSC-4P80-Assignment-2/lib/eigen-3.4.0/doc/examples/DenseBase_template_int_midd...

16 lines
283 B
C++
Raw Permalink Normal View History

2024-10-21 16:42:03 -04:00
#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;
}