You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
390 B

  1. #include <Eigen/Dense>
  2. #include <iostream>
  3. using namespace std;
  4. int main()
  5. {
  6. Eigen::MatrixXf m(3,3);
  7. m << 1,2,3,
  8. 4,5,6,
  9. 7,8,9;
  10. cout << "Here is the matrix m:" << endl << m << endl;
  11. cout << "2nd Row: " << m.row(1) << endl;
  12. m.col(2) += 3 * m.col(0);
  13. cout << "After adding 3 times the first column into the third column, the matrix m is:\n";
  14. cout << m << endl;
  15. }