mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
add missing .data() members to MatrixWrapper and ArrayWrapper
This commit is contained in:
@@ -53,6 +53,12 @@ class ArrayWrapper : public ArrayBase<ArrayWrapper<ExpressionType> >
|
|||||||
EIGEN_DENSE_PUBLIC_INTERFACE(ArrayWrapper)
|
EIGEN_DENSE_PUBLIC_INTERFACE(ArrayWrapper)
|
||||||
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(ArrayWrapper)
|
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(ArrayWrapper)
|
||||||
|
|
||||||
|
typedef typename internal::conditional<
|
||||||
|
internal::is_lvalue<ExpressionType>::value,
|
||||||
|
Scalar,
|
||||||
|
const Scalar
|
||||||
|
>::type ScalarWithConstIfNotLvalue;
|
||||||
|
|
||||||
typedef typename internal::nested<ExpressionType>::type NestedExpressionType;
|
typedef typename internal::nested<ExpressionType>::type NestedExpressionType;
|
||||||
|
|
||||||
inline ArrayWrapper(const ExpressionType& matrix) : m_expression(matrix) {}
|
inline ArrayWrapper(const ExpressionType& matrix) : m_expression(matrix) {}
|
||||||
@@ -62,6 +68,9 @@ class ArrayWrapper : public ArrayBase<ArrayWrapper<ExpressionType> >
|
|||||||
inline Index outerStride() const { return m_expression.outerStride(); }
|
inline Index outerStride() const { return m_expression.outerStride(); }
|
||||||
inline Index innerStride() const { return m_expression.innerStride(); }
|
inline Index innerStride() const { return m_expression.innerStride(); }
|
||||||
|
|
||||||
|
inline ScalarWithConstIfNotLvalue* data() { return m_expression.data(); }
|
||||||
|
inline const Scalar* data() const { return m_expression.data(); }
|
||||||
|
|
||||||
inline const CoeffReturnType coeff(Index row, Index col) const
|
inline const CoeffReturnType coeff(Index row, Index col) const
|
||||||
{
|
{
|
||||||
return m_expression.coeff(row, col);
|
return m_expression.coeff(row, col);
|
||||||
@@ -157,6 +166,12 @@ class MatrixWrapper : public MatrixBase<MatrixWrapper<ExpressionType> >
|
|||||||
EIGEN_DENSE_PUBLIC_INTERFACE(MatrixWrapper)
|
EIGEN_DENSE_PUBLIC_INTERFACE(MatrixWrapper)
|
||||||
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(MatrixWrapper)
|
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(MatrixWrapper)
|
||||||
|
|
||||||
|
typedef typename internal::conditional<
|
||||||
|
internal::is_lvalue<ExpressionType>::value,
|
||||||
|
Scalar,
|
||||||
|
const Scalar
|
||||||
|
>::type ScalarWithConstIfNotLvalue;
|
||||||
|
|
||||||
typedef typename internal::nested<ExpressionType>::type NestedExpressionType;
|
typedef typename internal::nested<ExpressionType>::type NestedExpressionType;
|
||||||
|
|
||||||
inline MatrixWrapper(const ExpressionType& matrix) : m_expression(matrix) {}
|
inline MatrixWrapper(const ExpressionType& matrix) : m_expression(matrix) {}
|
||||||
@@ -166,6 +181,9 @@ class MatrixWrapper : public MatrixBase<MatrixWrapper<ExpressionType> >
|
|||||||
inline Index outerStride() const { return m_expression.outerStride(); }
|
inline Index outerStride() const { return m_expression.outerStride(); }
|
||||||
inline Index innerStride() const { return m_expression.innerStride(); }
|
inline Index innerStride() const { return m_expression.innerStride(); }
|
||||||
|
|
||||||
|
inline ScalarWithConstIfNotLvalue* data() { return m_expression.data(); }
|
||||||
|
inline const Scalar* data() const { return m_expression.data(); }
|
||||||
|
|
||||||
inline const CoeffReturnType coeff(Index row, Index col) const
|
inline const CoeffReturnType coeff(Index row, Index col) const
|
||||||
{
|
{
|
||||||
return m_expression.coeff(row, col);
|
return m_expression.coeff(row, col);
|
||||||
|
|||||||
Reference in New Issue
Block a user