mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-30 07:44:10 +08:00
Move MatrixBase::operaotr*(UniformScaling) as a free function in Scaling.h, and fix return type.
This commit is contained in:
parent
64fcfd314f
commit
deb8306e60
@ -403,7 +403,6 @@ template<typename Derived> class MatrixBase
|
|||||||
|
|
||||||
inline Matrix<Scalar,3,1> eulerAngles(Index a0, Index a1, Index a2) const;
|
inline Matrix<Scalar,3,1> eulerAngles(Index a0, Index a1, Index a2) const;
|
||||||
|
|
||||||
inline ScalarMultipleReturnType operator*(const UniformScaling<Scalar>& s) const;
|
|
||||||
// put this as separate enum value to work around possible GCC 4.3 bug (?)
|
// put this as separate enum value to work around possible GCC 4.3 bug (?)
|
||||||
enum { HomogeneousReturnTypeDirection = ColsAtCompileTime==1&&RowsAtCompileTime==1 ? ((internal::traits<Derived>::Flags&RowMajorBit)==RowMajorBit ? Horizontal : Vertical)
|
enum { HomogeneousReturnTypeDirection = ColsAtCompileTime==1&&RowsAtCompileTime==1 ? ((internal::traits<Derived>::Flags&RowMajorBit)==RowMajorBit ? Horizontal : Vertical)
|
||||||
: ColsAtCompileTime==1 ? Vertical : Horizontal };
|
: ColsAtCompileTime==1 ? Vertical : Horizontal };
|
||||||
@ -416,8 +415,7 @@ template<typename Derived> class MatrixBase
|
|||||||
typedef Block<const Derived,
|
typedef Block<const Derived,
|
||||||
internal::traits<Derived>::ColsAtCompileTime==1 ? SizeMinusOne : 1,
|
internal::traits<Derived>::ColsAtCompileTime==1 ? SizeMinusOne : 1,
|
||||||
internal::traits<Derived>::ColsAtCompileTime==1 ? 1 : SizeMinusOne> ConstStartMinusOne;
|
internal::traits<Derived>::ColsAtCompileTime==1 ? 1 : SizeMinusOne> ConstStartMinusOne;
|
||||||
typedef CwiseUnaryOp<internal::scalar_quotient1_op<typename internal::traits<Derived>::Scalar>,
|
typedef EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(ConstStartMinusOne,Scalar,quotient) HNormalizedReturnType;
|
||||||
const ConstStartMinusOne > HNormalizedReturnType;
|
|
||||||
|
|
||||||
inline const HNormalizedReturnType hnormalized() const;
|
inline const HNormalizedReturnType hnormalized() const;
|
||||||
|
|
||||||
|
@ -107,12 +107,15 @@ public:
|
|||||||
/** \addtogroup Geometry_Module */
|
/** \addtogroup Geometry_Module */
|
||||||
//@{
|
//@{
|
||||||
|
|
||||||
/** Concatenates a linear transformation matrix and a uniform scaling */
|
/** Concatenates a linear transformation matrix and a uniform scaling
|
||||||
|
* \relates UniformScaling
|
||||||
|
*/
|
||||||
// NOTE this operator is defiend in MatrixBase and not as a friend function
|
// NOTE this operator is defiend in MatrixBase and not as a friend function
|
||||||
// of UniformScaling to fix an internal crash of Intel's ICC
|
// of UniformScaling to fix an internal crash of Intel's ICC
|
||||||
template<typename Derived> typename MatrixBase<Derived>::ScalarMultipleReturnType
|
template<typename Derived,typename Scalar>
|
||||||
MatrixBase<Derived>::operator*(const UniformScaling<Scalar>& s) const
|
EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(Derived,Scalar,product)
|
||||||
{ return derived() * s.factor(); }
|
operator*(const MatrixBase<Derived>& matrix, const UniformScaling<Scalar>& s)
|
||||||
|
{ return matrix.derived() * s.factor(); }
|
||||||
|
|
||||||
/** Constructs a uniform scaling from scale factor \a s */
|
/** Constructs a uniform scaling from scale factor \a s */
|
||||||
static inline UniformScaling<float> Scaling(float s) { return UniformScaling<float>(s); }
|
static inline UniformScaling<float> Scaling(float s) { return UniformScaling<float>(s); }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user