mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-09-25 15:53:19 +08:00
Make Ref<> suitable for both Matrix and Array kinds. Note that Matrix kind objects can be implicitely converted to an Array kind Ref<> and vice versa
This commit is contained in:
parent
7e0dd17312
commit
7740127e3d
@ -195,12 +195,12 @@ template<typename PlainObjectType, int Options, typename StrideType> class Ref
|
||||
Base::construct(expr);
|
||||
}
|
||||
template<typename Derived>
|
||||
inline Ref(const MatrixBase<Derived>& expr,
|
||||
inline Ref(const DenseBase<Derived>& expr,
|
||||
typename internal::enable_if<bool(internal::is_lvalue<Derived>::value&&bool(Traits::template match<Derived>::MatchAtCompileTime)),Derived>::type* = 0,
|
||||
int = Derived::ThisConstantIsPrivateInPlainObjectBase)
|
||||
#else
|
||||
template<typename Derived>
|
||||
inline Ref(MatrixBase<Derived>& expr)
|
||||
inline Ref(DenseBase<Derived>& expr)
|
||||
#endif
|
||||
{
|
||||
Base::construct(expr.const_cast_derived());
|
||||
@ -221,7 +221,7 @@ template<typename PlainObjectType, int Options, typename StrideType> class Ref<c
|
||||
EIGEN_DENSE_PUBLIC_INTERFACE(Ref)
|
||||
|
||||
template<typename Derived>
|
||||
inline Ref(const MatrixBase<Derived>& expr)
|
||||
inline Ref(const DenseBase<Derived>& expr)
|
||||
{
|
||||
// std::cout << match_helper<Derived>::HasDirectAccess << "," << match_helper<Derived>::OuterStrideMatch << "," << match_helper<Derived>::InnerStrideMatch << "\n";
|
||||
// std::cout << int(StrideType::OuterStrideAtCompileTime) << " - " << int(Derived::OuterStrideAtCompileTime) << "\n";
|
||||
|
Loading…
x
Reference in New Issue
Block a user