* Fix a couple of issues related to the recent cache friendly products

* Improve the efficiency of matrix*vector in unaligned cases
* Trivial fixes in the destructors of MatrixStorage
* Removed the matrixNorm in test/product.cpp (twice faster and
  that assumed the matrix product was ok while checking that !!)
This commit is contained in:
Gael Guennebaud
2008-07-19 00:09:01 +00:00
parent 62ec1dd616
commit 22a816ade8
9 changed files with 85 additions and 92 deletions

View File

@@ -23,12 +23,14 @@
// Eigen. If not, see <http://www.gnu.org/licenses/>.
#include "main.h"
#include <Eigen/Array>
#include <Eigen/QR>
template<typename Derived1, typename Derived2>
bool areNotApprox(const MatrixBase<Derived1>& m1, const MatrixBase<Derived2>& m2, typename Derived1::RealScalar epsilon = precision<typename Derived1::RealScalar>())
{
return !((m1-m2).matrixNorm() < epsilon * std::max(m1.matrixNorm(), m2.matrixNorm()));
return !((m1-m2).cwise().abs2().maxCoeff() < epsilon * epsilon
* std::max(m1.cwise().abs2().maxCoeff(), m2.cwise().abs2().maxCoeff()));
}
template<typename MatrixType> void product(const MatrixType& m)