COSC-4P80-Assignment-2/lib/eigen-3.4.0/doc/snippets/Slicing_arrayexpr.cpp

5 lines
167 B
C++

ArrayXi ind(5); ind<<4,2,5,5,3;
MatrixXi A = MatrixXi::Random(4,6);
cout << "Initial matrix A:\n" << A << "\n\n";
cout << "A(all,ind-1):\n" << A(all,ind-1) << "\n\n";