#include <iostream>
#include "Eigen/Dense"
#include "eigen_consts.H"
#include "eigen_test.H"


using namespace std;
using namespace Eigen;

int main()
{
	MatrixXf A(3,4);
	A << 1,2,3,4,5,6,7,8,9,10,11,12;
	cout << A << endl;

	PermutationMatrix<4, 4> permX(4);
	permX.setIdentity();
	// Your permutation
	cout << permX.indices()<< endl;
	permX.indices() << 1,0,2,3;
	// Permutate rows
	// A = permX * A;
	A = (A * permX).rightCols(2);
	cout << A << endl;

	return 0;
}

相关文章:

  • 2021-06-22
  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
  • 2021-08-28
  • 2021-09-03
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-18
  • 2021-06-15
  • 2022-03-06
  • 2022-12-23
  • 2021-12-28
  • 2022-12-23
  • 2021-04-25
相关资源
相似解决方案