fix 168 : now TriangularView::solve returns by value making TriangularView::solveInPlace less important.

Also fix the very outdated documentation of this function.
This commit is contained in:
Gael Guennebaud
2011-02-01 17:21:20 +01:00
parent 59af20b390
commit 8915d5bd22
3 changed files with 65 additions and 30 deletions

View File

@@ -28,12 +28,18 @@
(XB).setRandom(); ref = (XB); \
(TRI).solveInPlace(XB); \
VERIFY_IS_APPROX((TRI).toDenseMatrix() * (XB), ref); \
(XB).setRandom(); ref = (XB); \
(XB) = (TRI).solve(XB); \
VERIFY_IS_APPROX((TRI).toDenseMatrix() * (XB), ref); \
}
#define VERIFY_TRSM_ONTHERIGHT(TRI,XB) { \
(XB).setRandom(); ref = (XB); \
(TRI).transpose().template solveInPlace<OnTheRight>(XB.transpose()); \
VERIFY_IS_APPROX((XB).transpose() * (TRI).transpose().toDenseMatrix(), ref.transpose()); \
(XB).setRandom(); ref = (XB); \
(XB).transpose() = (TRI).transpose().template solve<OnTheRight>(XB.transpose()); \
VERIFY_IS_APPROX((XB).transpose() * (TRI).transpose().toDenseMatrix(), ref.transpose()); \
}
template<typename Scalar,int Size, int Cols> void trsolve(int size=Size,int cols=Cols)