bug #352:properly cast constants

This commit is contained in:
Igor Krivenko
2011-12-09 23:38:41 +01:00
parent d400a6245e
commit 36457178f9
17 changed files with 40 additions and 40 deletions

View File

@@ -310,7 +310,7 @@ template<typename Derived>
inline Scalar AlignedBox<Scalar,AmbientDim>::squaredExteriorDistance(const MatrixBase<Derived>& a_p) const
{
const typename internal::nested<Derived,2*AmbientDim>::type p(a_p.derived());
Scalar dist2 = 0.;
Scalar dist2(0);
Scalar aux;
for (Index k=0; k<dim(); ++k)
{
@@ -331,7 +331,7 @@ inline Scalar AlignedBox<Scalar,AmbientDim>::squaredExteriorDistance(const Matri
template<typename Scalar,int AmbientDim>
inline Scalar AlignedBox<Scalar,AmbientDim>::squaredExteriorDistance(const AlignedBox& b) const
{
Scalar dist2 = 0.;
Scalar dist2(0);
Scalar aux;
for (Index k=0; k<dim(); ++k)
{

View File

@@ -550,9 +550,9 @@ QuaternionBase<Derived>::toRotationMatrix(void) const
// it has to be inlined, and so the return by value is not an issue
Matrix3 res;
const Scalar tx = 2*this->x();
const Scalar ty = 2*this->y();
const Scalar tz = 2*this->z();
const Scalar tx = Scalar(2)*this->x();
const Scalar ty = Scalar(2)*this->y();
const Scalar tz = Scalar(2)*this->z();
const Scalar twx = tx*this->w();
const Scalar twy = ty*this->w();
const Scalar twz = tz*this->w();
@@ -563,15 +563,15 @@ QuaternionBase<Derived>::toRotationMatrix(void) const
const Scalar tyz = tz*this->y();
const Scalar tzz = tz*this->z();
res.coeffRef(0,0) = 1-(tyy+tzz);
res.coeffRef(0,0) = Scalar(1)-(tyy+tzz);
res.coeffRef(0,1) = txy-twz;
res.coeffRef(0,2) = txz+twy;
res.coeffRef(1,0) = txy+twz;
res.coeffRef(1,1) = 1-(txx+tzz);
res.coeffRef(1,1) = Scalar(1)-(txx+tzz);
res.coeffRef(1,2) = tyz-twx;
res.coeffRef(2,0) = txz-twy;
res.coeffRef(2,1) = tyz+twx;
res.coeffRef(2,2) = 1-(txx+tyy);
res.coeffRef(2,2) = Scalar(1)-(txx+tyy);
return res;
}