mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
* ReturnByValue:
-- simpplify by removing the 2nd template parameter -- rename Functor to Derived, as now it's a usual CRTP * Homogeneous: -- in products, honor the Max sizes etc.
This commit is contained in:
@@ -206,11 +206,20 @@ VectorwiseOp<ExpressionType,Direction>::hnormalized() const
|
||||
Direction==Horizontal ? _expression().cols()-1 : 1).nestByValue();
|
||||
}
|
||||
|
||||
template<typename MatrixType,typename Lhs>
|
||||
struct ei_traits<ei_homogeneous_left_product_impl<Homogeneous<MatrixType,Vertical>,Lhs> >
|
||||
{
|
||||
typedef Matrix<typename ei_traits<MatrixType>::Scalar,
|
||||
Lhs::RowsAtCompileTime,
|
||||
MatrixType::ColsAtCompileTime,
|
||||
MatrixType::PlainMatrixType::Options,
|
||||
Lhs::MaxRowsAtCompileTime,
|
||||
MatrixType::MaxColsAtCompileTime> ReturnMatrixType;
|
||||
};
|
||||
|
||||
template<typename MatrixType,typename Lhs>
|
||||
struct ei_homogeneous_left_product_impl<Homogeneous<MatrixType,Vertical>,Lhs>
|
||||
: public ReturnByValue<ei_homogeneous_left_product_impl<Homogeneous<MatrixType,Vertical>,Lhs>,
|
||||
Matrix<typename ei_traits<MatrixType>::Scalar,
|
||||
Lhs::RowsAtCompileTime,MatrixType::ColsAtCompileTime> >
|
||||
: public ReturnByValue<ei_homogeneous_left_product_impl<Homogeneous<MatrixType,Vertical>,Lhs> >
|
||||
{
|
||||
typedef typename ei_cleantype<typename Lhs::Nested>::type LhsNested;
|
||||
ei_homogeneous_left_product_impl(const Lhs& lhs, const MatrixType& rhs)
|
||||
@@ -235,11 +244,20 @@ struct ei_homogeneous_left_product_impl<Homogeneous<MatrixType,Vertical>,Lhs>
|
||||
const typename MatrixType::Nested m_rhs;
|
||||
};
|
||||
|
||||
template<typename MatrixType,typename Rhs>
|
||||
struct ei_traits<ei_homogeneous_right_product_impl<Homogeneous<MatrixType,Horizontal>,Rhs> >
|
||||
{
|
||||
typedef Matrix<typename ei_traits<MatrixType>::Scalar,
|
||||
MatrixType::RowsAtCompileTime,
|
||||
Rhs::ColsAtCompileTime,
|
||||
MatrixType::PlainMatrixType::Options,
|
||||
MatrixType::MaxRowsAtCompileTime,
|
||||
Rhs::MaxColsAtCompileTime> ReturnMatrixType;
|
||||
};
|
||||
|
||||
template<typename MatrixType,typename Rhs>
|
||||
struct ei_homogeneous_right_product_impl<Homogeneous<MatrixType,Horizontal>,Rhs>
|
||||
: public ReturnByValue<ei_homogeneous_right_product_impl<Homogeneous<MatrixType,Horizontal>,Rhs>,
|
||||
Matrix<typename ei_traits<MatrixType>::Scalar,
|
||||
MatrixType::RowsAtCompileTime, Rhs::ColsAtCompileTime> >
|
||||
: public ReturnByValue<ei_homogeneous_right_product_impl<Homogeneous<MatrixType,Horizontal>,Rhs> >
|
||||
{
|
||||
typedef typename ei_cleantype<typename Rhs::Nested>::type RhsNested;
|
||||
ei_homogeneous_right_product_impl(const MatrixType& lhs, const Rhs& rhs)
|
||||
|
||||
@@ -247,14 +247,14 @@ public:
|
||||
ei_transform_construct_from_matrix<OtherMatrixType,Mode,Dim,HDim>::run(this, other.matrix());
|
||||
}
|
||||
|
||||
template<typename OtherDerived,typename OtherEvalType>
|
||||
Transform(const ReturnByValue<OtherDerived,OtherEvalType>& other)
|
||||
template<typename OtherDerived>
|
||||
Transform(const ReturnByValue<OtherDerived>& other)
|
||||
{
|
||||
other.evalTo(*this);
|
||||
}
|
||||
|
||||
template<typename OtherDerived,typename OtherEvalType>
|
||||
Transform& operator=(const ReturnByValue<OtherDerived,OtherEvalType>& other)
|
||||
template<typename OtherDerived>
|
||||
Transform& operator=(const ReturnByValue<OtherDerived>& other)
|
||||
{
|
||||
other.evalTo(*this);
|
||||
return *this;
|
||||
|
||||
Reference in New Issue
Block a user