mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-04 03:00:39 +08:00
Replicate now makes use of the cost model to evaluate its nested expression
(transplanted from 311c5b87a3cba60dd83273212228b5ce800d398c )
This commit is contained in:
parent
057254381d
commit
360a79d6f8
@ -48,7 +48,10 @@ struct traits<Replicate<MatrixType,RowFactor,ColFactor> >
|
|||||||
typedef typename MatrixType::Scalar Scalar;
|
typedef typename MatrixType::Scalar Scalar;
|
||||||
typedef typename traits<MatrixType>::StorageKind StorageKind;
|
typedef typename traits<MatrixType>::StorageKind StorageKind;
|
||||||
typedef typename traits<MatrixType>::XprKind XprKind;
|
typedef typename traits<MatrixType>::XprKind XprKind;
|
||||||
typedef typename nested<MatrixType>::type MatrixTypeNested;
|
enum {
|
||||||
|
Factor = (RowFactor==Dynamic || ColFactor==Dynamic) ? Dynamic : RowFactor*ColFactor
|
||||||
|
};
|
||||||
|
typedef typename nested<MatrixType,Factor>::type MatrixTypeNested;
|
||||||
typedef typename remove_reference<MatrixTypeNested>::type _MatrixTypeNested;
|
typedef typename remove_reference<MatrixTypeNested>::type _MatrixTypeNested;
|
||||||
enum {
|
enum {
|
||||||
RowsAtCompileTime = RowFactor==Dynamic || int(MatrixType::RowsAtCompileTime)==Dynamic
|
RowsAtCompileTime = RowFactor==Dynamic || int(MatrixType::RowsAtCompileTime)==Dynamic
|
||||||
@ -72,6 +75,8 @@ struct traits<Replicate<MatrixType,RowFactor,ColFactor> >
|
|||||||
template<typename MatrixType,int RowFactor,int ColFactor> class Replicate
|
template<typename MatrixType,int RowFactor,int ColFactor> class Replicate
|
||||||
: public internal::dense_xpr_base< Replicate<MatrixType,RowFactor,ColFactor> >::type
|
: public internal::dense_xpr_base< Replicate<MatrixType,RowFactor,ColFactor> >::type
|
||||||
{
|
{
|
||||||
|
typedef typename internal::traits<Replicate>::MatrixTypeNested MatrixTypeNested;
|
||||||
|
typedef typename internal::traits<Replicate>::_MatrixTypeNested _MatrixTypeNested;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
typedef typename internal::dense_xpr_base<Replicate>::type Base;
|
typedef typename internal::dense_xpr_base<Replicate>::type Base;
|
||||||
@ -124,7 +129,7 @@ template<typename MatrixType,int RowFactor,int ColFactor> class Replicate
|
|||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const typename MatrixType::Nested m_matrix;
|
const MatrixTypeNested m_matrix;
|
||||||
const internal::variable_if_dynamic<Index, RowFactor> m_rowFactor;
|
const internal::variable_if_dynamic<Index, RowFactor> m_rowFactor;
|
||||||
const internal::variable_if_dynamic<Index, ColFactor> m_colFactor;
|
const internal::variable_if_dynamic<Index, ColFactor> m_colFactor;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user