eigen/doc/snippets/MatrixBase_marked.cpp
Gael Guennebaud c10f069b6b * Merge Extract and Part to the Part expression.
Renamed "MatrixBase::extract() const" to "MatrixBase::part() const"
* Renamed static functions identity, zero, ones, random with an upper case
  first letter: Identity, Zero, Ones and Random.
2008-07-21 00:34:46 +00:00

10 lines
402 B
C++

Matrix3d m = Matrix3d::Zero();
m.part<Eigen::Upper>().setOnes();
cout << "Here is the matrix m:" << endl << m << endl;
Matrix3d n = Matrix3d::Ones();
n.part<Eigen::Lower>() *= 2;
cout << "Here is the matrix n:" << endl << n << endl;
cout << "And now here is m.inverse()*n, taking advantage of the fact that"
" m is upper-triangular:" << endl
<< m.marked<Eigen::Upper>().inverseProduct(n);