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.

11 lines
545 B

  1. Matrix3d m = Matrix3d::Zero();
  2. m.triangularView<StormEigen::Upper>().setOnes();
  3. cout << "Here is the matrix m:\n" << m << endl;
  4. Matrix3d n = Matrix3d::Ones();
  5. n.triangularView<StormEigen::Lower>() *= 2;
  6. cout << "Here is the matrix n:\n" << n << endl;
  7. cout << "And now here is m.inverse()*n, taking advantage of the fact that"
  8. " m is upper-triangular:\n"
  9. << m.triangularView<StormEigen::Upper>().solve(n) << endl;
  10. cout << "And this is n*m.inverse():\n"
  11. << m.triangularView<StormEigen::Upper>().solve<StormEigen::OnTheRight>(n);