diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2008-08-11 02:25:40 +0000 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2008-08-11 02:25:40 +0000 |
commit | 17ec407ccd860eb44e6d2593bf9b17adf417bd37 (patch) | |
tree | 2629ed8b45ee0b98bb90017366cfc79a0d4d55a8 /Eigen/src/Core/Dot.h | |
parent | 55e8d670ce206ea91aed5520688442ee6fed0fd2 (diff) |
* add Regression module, from eigen1, improved, with doc and unit-test.
* fix .normalized() so that Random().normalized() works; since the return
type became complicated to write down i just let it return an actual
vector, perhaps not optimal.
* add Sparse/CMakeLists.txt. I suppose that it was intentional that it
didn't have CMakeLists, but in <=2.0 releases I'll just manually remove
Sparse.
Diffstat (limited to 'Eigen/src/Core/Dot.h')
-rw-r--r-- | Eigen/src/Core/Dot.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Eigen/src/Core/Dot.h b/Eigen/src/Core/Dot.h index 9bdff50b3..c0caf8c06 100644 --- a/Eigen/src/Core/Dot.h +++ b/Eigen/src/Core/Dot.h @@ -292,10 +292,13 @@ inline typename NumTraits<typename ei_traits<Derived>::Scalar>::Real MatrixBase< * \sa norm(), normalize() */ template<typename Derived> -inline const typename MatrixBase<Derived>::ScalarQuotient1ReturnType +inline const typename MatrixBase<Derived>::EvalType MatrixBase<Derived>::normalized() const { - return *this / norm(); + typedef typename ei_nested<Derived>::type Nested; + typedef typename ei_unref<Nested>::type _Nested; + _Nested n(derived()); + return n / n.norm(); } /** Normalizes the vector, i.e. divides it by its own norm. |