diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2009-08-03 17:20:45 +0200 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2009-08-03 17:20:45 +0200 |
commit | 523cdedf58a95c02c73ede59fe9d22c5799a9df5 (patch) | |
tree | 1b065691c6d0521480ebd0acc8f207c8630895ec /Eigen/src/Core | |
parent | 912da9fade7a02086747d086e0634cab0d6ff4b6 (diff) |
make the dot product linear in the second variable, not the first variable
Diffstat (limited to 'Eigen/src/Core')
-rw-r--r-- | Eigen/src/Core/Dot.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Eigen/src/Core/Dot.h b/Eigen/src/Core/Dot.h index 9e84d72bb..631124f2b 100644 --- a/Eigen/src/Core/Dot.h +++ b/Eigen/src/Core/Dot.h @@ -86,7 +86,7 @@ struct ei_dot_novec_unroller<Derived1, Derived2, Start, 1> inline static Scalar run(const Derived1& v1, const Derived2& v2) { - return v1.coeff(Start) * ei_conj(v2.coeff(Start)); + return ei_conj(v1.coeff(Start)) * v2.coeff(Start); } }; @@ -155,9 +155,9 @@ struct ei_dot_impl<Derived1, Derived2, NoVectorization, NoUnrolling> { ei_assert(v1.size()>0 && "you are using a non initialized vector"); Scalar res; - res = v1.coeff(0) * ei_conj(v2.coeff(0)); + res = ei_conj(v1.coeff(0)) * v2.coeff(0); for(int i = 1; i < v1.size(); ++i) - res += v1.coeff(i) * ei_conj(v2.coeff(i)); + res += ei_conj(v1.coeff(i)) * v2.coeff(i); return res; } }; @@ -248,7 +248,7 @@ struct ei_dot_impl<Derived1, Derived2, LinearVectorization, CompleteUnrolling> * \only_for_vectors * * \note If the scalar type is complex numbers, then this function returns the hermitian - * (sesquilinear) dot product, linear in the first variable and conjugate-linear in the + * (sesquilinear) dot product, conjugate-linear in the first variable and linear in the * second variable. * * \sa squaredNorm(), norm() |