bugfix in inner-product specialization,

compilation fix in stable norm,
optimize apply householder
This commit is contained in:
Gael Guennebaud
2009-08-15 13:12:50 +02:00
parent 7b60713e87
commit 13a8956188
3 changed files with 10 additions and 8 deletions

View File

@@ -156,7 +156,7 @@ class GeneralProduct<Lhs, Rhs, InnerProduct>
template<typename Dest> void scaleAndAddTo(Dest& dst, Scalar alpha) const
{
ei_assert(dst.rows()==1 && dst.cols()==1);
dst.coeffRef(0,0) += alpha * (m_lhs.cwise()*m_rhs).sum();
dst.coeffRef(0,0) += alpha * (m_lhs.transpose().cwise()*m_rhs).sum();
}
};

View File

@@ -115,17 +115,17 @@ MatrixBase<Derived>::blueNorm() const
ei_assert(false && "the algorithm cannot be guaranteed on this computer");
}
iexp = -((1-iemin)/2);
b1 = Scalar(std::pow(double(ibeta),iexp)); // lower boundary of midrange
b1 = RealScalar(std::pow(double(ibeta),iexp)); // lower boundary of midrange
iexp = (iemax + 1 - it)/2;
b2 = Scalar(std::pow(double(ibeta),iexp)); // upper boundary of midrange
b2 = RealScalar(std::pow(double(ibeta),iexp)); // upper boundary of midrange
iexp = (2-iemin)/2;
s1m = Scalar(std::pow(double(ibeta),iexp)); // scaling factor for lower range
s1m = RealScalar(std::pow(double(ibeta),iexp)); // scaling factor for lower range
iexp = - ((iemax+it)/2);
s2m = Scalar(std::pow(double(ibeta),iexp)); // scaling factor for upper range
s2m = RealScalar(std::pow(double(ibeta),iexp)); // scaling factor for upper range
overfl = rbig*s2m; // overfow boundary for abig
eps = Scalar(std::pow(double(ibeta), 1-it));
eps = RealScalar(std::pow(double(ibeta), 1-it));
relerr = ei_sqrt(eps); // tolerance for neglecting asml
abig = 1.0/eps - 1.0;
if (RealScalar(nbig)>abig) nmax = int(abig); // largest safe n