blob: 5484424673261816628d73454c225092074eed69 [file] [log] [blame]
Austin Schuh189376f2018-12-20 22:11:15 +11001Matrix3d m = Matrix3d::Zero();
2m.triangularView<Eigen::Upper>().setOnes();
3cout << "Here is the matrix m:\n" << m << endl;
4Matrix3d n = Matrix3d::Ones();
5n.triangularView<Eigen::Lower>() *= 2;
6cout << "Here is the matrix n:\n" << n << endl;
7cout << "And now here is m.inverse()*n, taking advantage of the fact that"
8 " m is upper-triangular:\n"
9 << m.triangularView<Eigen::Upper>().solve(n) << endl;
10cout << "And this is n*m.inverse():\n"
11 << m.triangularView<Eigen::Upper>().solve<Eigen::OnTheRight>(n);