mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-12 11:49:02 +08:00
add important comment and move stride helpers to DenseCoeffsBase.h
This commit is contained in:
parent
8f076f6817
commit
6624b93d67
@ -26,30 +26,6 @@
|
|||||||
#ifndef EIGEN_DENSEBASE_H
|
#ifndef EIGEN_DENSEBASE_H
|
||||||
#define EIGEN_DENSEBASE_H
|
#define EIGEN_DENSEBASE_H
|
||||||
|
|
||||||
template<typename Derived, bool HasDirectAccess = ei_has_direct_access<Derived>::ret>
|
|
||||||
struct ei_inner_stride_at_compile_time
|
|
||||||
{
|
|
||||||
enum { ret = ei_traits<Derived>::InnerStrideAtCompileTime };
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename Derived>
|
|
||||||
struct ei_inner_stride_at_compile_time<Derived, false>
|
|
||||||
{
|
|
||||||
enum { ret = 0 };
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename Derived, bool HasDirectAccess = ei_has_direct_access<Derived>::ret>
|
|
||||||
struct ei_outer_stride_at_compile_time
|
|
||||||
{
|
|
||||||
enum { ret = ei_traits<Derived>::OuterStrideAtCompileTime };
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename Derived>
|
|
||||||
struct ei_outer_stride_at_compile_time<Derived, false>
|
|
||||||
{
|
|
||||||
enum { ret = 0 };
|
|
||||||
};
|
|
||||||
|
|
||||||
/** \class DenseBase
|
/** \class DenseBase
|
||||||
*
|
*
|
||||||
* \brief Base class for all dense matrices, vectors, and arrays
|
* \brief Base class for all dense matrices, vectors, and arrays
|
||||||
|
@ -214,6 +214,11 @@ class DenseCoeffsBase : public EigenBase<Derived>
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
// explanation: DenseBase is doing "using ..." on the methods from DenseCoeffsBase.
|
||||||
|
// But some methods are only available in the EnableDirectAccessAPI case.
|
||||||
|
// So we add dummy methods here with these names, so that "using... " doesn't fail.
|
||||||
|
// It's not private so that the child class DenseBase can access them, and it's not public
|
||||||
|
// either since it's an implementation detail, so has to be protected.
|
||||||
void coeffRef();
|
void coeffRef();
|
||||||
void coeffRefByOuterInner();
|
void coeffRefByOuterInner();
|
||||||
void writePacket();
|
void writePacket();
|
||||||
@ -570,4 +575,28 @@ inline static int ei_first_aligned(const Derived& m)
|
|||||||
::run(m);
|
::run(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename Derived, bool HasDirectAccess = ei_has_direct_access<Derived>::ret>
|
||||||
|
struct ei_inner_stride_at_compile_time
|
||||||
|
{
|
||||||
|
enum { ret = ei_traits<Derived>::InnerStrideAtCompileTime };
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename Derived>
|
||||||
|
struct ei_inner_stride_at_compile_time<Derived, false>
|
||||||
|
{
|
||||||
|
enum { ret = 0 };
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename Derived, bool HasDirectAccess = ei_has_direct_access<Derived>::ret>
|
||||||
|
struct ei_outer_stride_at_compile_time
|
||||||
|
{
|
||||||
|
enum { ret = ei_traits<Derived>::OuterStrideAtCompileTime };
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename Derived>
|
||||||
|
struct ei_outer_stride_at_compile_time<Derived, false>
|
||||||
|
{
|
||||||
|
enum { ret = 0 };
|
||||||
|
};
|
||||||
|
|
||||||
#endif // EIGEN_COEFFS_H
|
#endif // EIGEN_COEFFS_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user