fix a couple of compilation issue due to the removal of MultiplierBase

This commit is contained in:
Gael Guennebaud 2009-08-04 13:16:40 +02:00
parent 2089a263f8
commit f3a6bc48c4
4 changed files with 20 additions and 19 deletions

View File

@ -75,13 +75,13 @@ template<typename MatrixType,int _Direction> class Homogeneous
: m_matrix(matrix) : m_matrix(matrix)
{} {}
inline int rows() const { return m_matrix.rows() + (Direction==Vertical ? 1 : 0); } inline int rows() const { return m_matrix.rows() + (int(Direction)==Vertical ? 1 : 0); }
inline int cols() const { return m_matrix.cols() + (Direction==Horizontal ? 1 : 0); } inline int cols() const { return m_matrix.cols() + (int(Direction)==Horizontal ? 1 : 0); }
inline Scalar coeff(int row, int col) const inline Scalar coeff(int row, int col) const
{ {
if( (Direction==Vertical && row==m_matrix.rows()) if( (int(Direction)==Vertical && row==m_matrix.rows())
|| (Direction==Horizontal && col==m_matrix.cols())) || (int(Direction)==Horizontal && col==m_matrix.cols()))
return 1; return 1;
return m_matrix.coeff(row, col); return m_matrix.coeff(row, col);
} }
@ -90,7 +90,7 @@ template<typename MatrixType,int _Direction> class Homogeneous
inline const ei_homogeneous_right_product_impl<Homogeneous,Rhs> inline const ei_homogeneous_right_product_impl<Homogeneous,Rhs>
operator* (const MatrixBase<Rhs>& rhs) const operator* (const MatrixBase<Rhs>& rhs) const
{ {
ei_assert(Direction==Horizontal); ei_assert(int(Direction)==Horizontal);
return ei_homogeneous_right_product_impl<Homogeneous,Rhs>(m_matrix,rhs.derived()); return ei_homogeneous_right_product_impl<Homogeneous,Rhs>(m_matrix,rhs.derived());
} }
@ -98,7 +98,7 @@ template<typename MatrixType,int _Direction> class Homogeneous
inline const ei_homogeneous_left_product_impl<Homogeneous,Lhs> inline const ei_homogeneous_left_product_impl<Homogeneous,Lhs>
operator* (const MatrixBase<Lhs>& lhs, const Homogeneous& rhs) operator* (const MatrixBase<Lhs>& lhs, const Homogeneous& rhs)
{ {
ei_assert(Direction==Vertical); ei_assert(int(Direction)==Vertical);
return ei_homogeneous_left_product_impl<Homogeneous,Lhs>(lhs.derived(),rhs.m_matrix); return ei_homogeneous_left_product_impl<Homogeneous,Lhs>(lhs.derived(),rhs.m_matrix);
} }
@ -107,7 +107,7 @@ template<typename MatrixType,int _Direction> class Homogeneous
typename Transform<Scalar,Dim,Mode>::AffinePartNested> typename Transform<Scalar,Dim,Mode>::AffinePartNested>
operator* (const Transform<Scalar,Dim,Mode>& tr, const Homogeneous& rhs) operator* (const Transform<Scalar,Dim,Mode>& tr, const Homogeneous& rhs)
{ {
ei_assert(Direction==Vertical); ei_assert(int(Direction)==Vertical);
return ei_homogeneous_left_product_impl<Homogeneous,typename Transform<Scalar,Dim,Mode>::AffinePartNested > return ei_homogeneous_left_product_impl<Homogeneous,typename Transform<Scalar,Dim,Mode>::AffinePartNested >
(tr.affine(),rhs.m_matrix); (tr.affine(),rhs.m_matrix);
} }
@ -117,7 +117,7 @@ template<typename MatrixType,int _Direction> class Homogeneous
typename Transform<Scalar,Dim,Projective>::MatrixType> typename Transform<Scalar,Dim,Projective>::MatrixType>
operator* (const Transform<Scalar,Dim,Projective>& tr, const Homogeneous& rhs) operator* (const Transform<Scalar,Dim,Projective>& tr, const Homogeneous& rhs)
{ {
ei_assert(Direction==Vertical); ei_assert(int(Direction)==Vertical);
return ei_homogeneous_left_product_impl<Homogeneous,typename Transform<Scalar,Dim,Projective>::MatrixType> return ei_homogeneous_left_product_impl<Homogeneous,typename Transform<Scalar,Dim,Projective>::MatrixType>
(tr.matrix(),rhs.m_matrix); (tr.matrix(),rhs.m_matrix);
} }

View File

@ -68,17 +68,18 @@ class RotationBase
/** \returns the concatenation of the rotation \c *this with a generic expression \a e /** \returns the concatenation of the rotation \c *this with a generic expression \a e
* \a e can be: * \a e can be:
* - a DimxDim linear transformation matrix (including an axis aligned scaling) * - a DimxDim linear transformation matrix
* - a DimxDim diagonal matrix (axis aligned scaling)
* - a vector of size Dim * - a vector of size Dim
*/ */
template<typename OtherDerived> template<typename OtherDerived>
inline typename ei_rotation_base_generic_product_selector<Derived,OtherDerived,OtherDerived::IsVectorAtCompileTime>::ReturnType inline typename ei_rotation_base_generic_product_selector<Derived,OtherDerived,OtherDerived::IsVectorAtCompileTime>::ReturnType
operator*(const MatrixBase<OtherDerived>& e) const operator*(const AnyMatrixBase<OtherDerived>& e) const
{ return ei_rotation_base_generic_product_selector<Derived,OtherDerived>::run(derived(), e.derived()); } { return ei_rotation_base_generic_product_selector<Derived,OtherDerived>::run(derived(), e.derived()); }
/** \returns the concatenation of a linear transformation \a l with the rotation \a r */ /** \returns the concatenation of a linear transformation \a l with the rotation \a r */
template<typename OtherDerived> friend template<typename OtherDerived> friend
inline RotationMatrixType operator*(const MultiplierBase<OtherDerived>& l, const Derived& r) inline RotationMatrixType operator*(const AnyMatrixBase<OtherDerived>& l, const Derived& r)
{ return l.derived() * r.toRotationMatrix(); } { return l.derived() * r.toRotationMatrix(); }
/** \returns the concatenation of the rotation \c *this with a transformation \a t */ /** \returns the concatenation of the rotation \c *this with a transformation \a t */

View File

@ -310,7 +310,7 @@ public:
// note: this function is defined here because some compilers cannot find the respective declaration // note: this function is defined here because some compilers cannot find the respective declaration
template<typename OtherDerived> template<typename OtherDerived>
inline const typename ei_transform_right_product_impl<OtherDerived,Mode,_Dim,_Dim+1>::ResultType inline const typename ei_transform_right_product_impl<OtherDerived,Mode,_Dim,_Dim+1>::ResultType
operator * (const MultiplierBase<OtherDerived> &other) const operator * (const AnyMatrixBase<OtherDerived> &other) const
{ return ei_transform_right_product_impl<OtherDerived,Mode,Dim,HDim>::run(*this,other.derived()); } { return ei_transform_right_product_impl<OtherDerived,Mode,Dim,HDim>::run(*this,other.derived()); }
/** \returns the product expression of a transformation matrix \a a times a transform \a b /** \returns the product expression of a transformation matrix \a a times a transform \a b
@ -322,11 +322,11 @@ public:
*/ */
template<typename OtherDerived> friend template<typename OtherDerived> friend
inline const typename ei_transform_left_product_impl<OtherDerived,Mode,_Dim,_Dim+1>::ResultType inline const typename ei_transform_left_product_impl<OtherDerived,Mode,_Dim,_Dim+1>::ResultType
operator * (const MultiplierBase<OtherDerived> &a, const Transform &b) operator * (const AnyMatrixBase<OtherDerived> &a, const Transform &b)
{ return ei_transform_left_product_impl<OtherDerived,Mode,Dim,HDim>::run(a.derived(),b); } { return ei_transform_left_product_impl<OtherDerived,Mode,Dim,HDim>::run(a.derived(),b); }
template<typename OtherDerived> template<typename OtherDerived>
inline Transform& operator*=(const MultiplierBase<OtherDerived>& other) { return *this = *this * other; } inline Transform& operator*=(const AnyMatrixBase<OtherDerived>& other) { return *this = *this * other; }
/** Contatenates two transformations */ /** Contatenates two transformations */
inline const Transform operator * (const Transform& other) const inline const Transform operator * (const Transform& other) const
@ -977,7 +977,7 @@ struct ei_transform_construct_from_matrix<Other, AffineCompact,Dim,HDim, HDim,HD
}; };
/********************************************************* /*********************************************************
*** Specializations of operator* with a MultiplierBase *** *** Specializations of operator* with a AnyMatrixBase ***
*********************************************************/ *********************************************************/
// ei_general_product_return_type is a generalization of ProductReturnType, for all types (including e.g. DiagonalBase...), // ei_general_product_return_type is a generalization of ProductReturnType, for all types (including e.g. DiagonalBase...),
@ -989,7 +989,7 @@ template<typename Lhs, typename D2> struct ei_general_product_return_type<Lhs, M
{ typedef D2 Type; }; { typedef D2 Type; };
template<typename D1, typename Rhs> struct ei_general_product_return_type<MatrixBase<D1>, Rhs > template<typename D1, typename Rhs> struct ei_general_product_return_type<MatrixBase<D1>, Rhs >
{ typedef D1 Type; }; { typedef D1 Type; };
// Projective * set of homogeneous column vectors // Projective * set of homogeneous column vectors

View File

@ -93,7 +93,7 @@ public:
/** Concatenates a translation and a linear transformation */ /** Concatenates a translation and a linear transformation */
template<typename OtherDerived> template<typename OtherDerived>
inline AffineTransformType operator* (const MultiplierBase<OtherDerived>& linear) const; inline AffineTransformType operator* (const AnyMatrixBase<OtherDerived>& linear) const;
/** Concatenates a translation and a rotation */ /** Concatenates a translation and a rotation */
template<typename Derived> template<typename Derived>
@ -103,7 +103,7 @@ public:
/** \returns the concatenation of a linear transformation \a l with the translation \a t */ /** \returns the concatenation of a linear transformation \a l with the translation \a t */
// its a nightmare to define a templated friend function outside its declaration // its a nightmare to define a templated friend function outside its declaration
template<typename OtherDerived> friend template<typename OtherDerived> friend
inline AffineTransformType operator*(const MultiplierBase<OtherDerived>& linear, const Translation& t) inline AffineTransformType operator*(const AnyMatrixBase<OtherDerived>& linear, const Translation& t)
{ {
AffineTransformType res; AffineTransformType res;
res.matrix().setZero(); res.matrix().setZero();
@ -182,7 +182,7 @@ Translation<Scalar,Dim>::operator* (const UniformScaling<Scalar>& other) const
template<typename Scalar, int Dim> template<typename Scalar, int Dim>
template<typename OtherDerived> template<typename OtherDerived>
inline typename Translation<Scalar,Dim>::AffineTransformType inline typename Translation<Scalar,Dim>::AffineTransformType
Translation<Scalar,Dim>::operator* (const MultiplierBase<OtherDerived>& linear) const Translation<Scalar,Dim>::operator* (const AnyMatrixBase<OtherDerived>& linear) const
{ {
AffineTransformType res; AffineTransformType res;
res.matrix().setZero(); res.matrix().setZero();