mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-10-10 23:21:29 +08:00
Refactor code to use constexpr for data() functions.
This commit is contained in:
parent
2d4c9b400c
commit
2a3465102a
@ -65,8 +65,8 @@ class ArrayWrapper : public ArrayBase<ArrayWrapper<ExpressionType> > {
|
|||||||
return m_expression.innerStride();
|
return m_expression.innerStride();
|
||||||
}
|
}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC inline ScalarWithConstIfNotLvalue* data() { return m_expression.data(); }
|
EIGEN_DEVICE_FUNC constexpr ScalarWithConstIfNotLvalue* data() { return m_expression.data(); }
|
||||||
EIGEN_DEVICE_FUNC inline const Scalar* data() const { return m_expression.data(); }
|
EIGEN_DEVICE_FUNC constexpr const Scalar* data() const { return m_expression.data(); }
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC inline const Scalar& coeffRef(Index rowId, Index colId) const {
|
EIGEN_DEVICE_FUNC inline const Scalar& coeffRef(Index rowId, Index colId) const {
|
||||||
return m_expression.coeffRef(rowId, colId);
|
return m_expression.coeffRef(rowId, colId);
|
||||||
@ -144,8 +144,8 @@ class MatrixWrapper : public MatrixBase<MatrixWrapper<ExpressionType> > {
|
|||||||
return m_expression.innerStride();
|
return m_expression.innerStride();
|
||||||
}
|
}
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC inline ScalarWithConstIfNotLvalue* data() { return m_expression.data(); }
|
EIGEN_DEVICE_FUNC constexpr ScalarWithConstIfNotLvalue* data() { return m_expression.data(); }
|
||||||
EIGEN_DEVICE_FUNC inline const Scalar* data() const { return m_expression.data(); }
|
EIGEN_DEVICE_FUNC constexpr const Scalar* data() const { return m_expression.data(); }
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC inline const Scalar& coeffRef(Index rowId, Index colId) const {
|
EIGEN_DEVICE_FUNC inline const Scalar& coeffRef(Index rowId, Index colId) const {
|
||||||
return m_expression.derived().coeffRef(rowId, colId);
|
return m_expression.derived().coeffRef(rowId, colId);
|
||||||
|
@ -278,7 +278,7 @@ class BlockImpl_dense : public internal::dense_xpr_base<Block<XprType, BlockRows
|
|||||||
|
|
||||||
#ifdef EIGEN_PARSED_BY_DOXYGEN
|
#ifdef EIGEN_PARSED_BY_DOXYGEN
|
||||||
/** \sa MapBase::data() */
|
/** \sa MapBase::data() */
|
||||||
EIGEN_DEVICE_FUNC inline const Scalar* data() const;
|
EIGEN_DEVICE_FUNC constexpr const Scalar* data() const;
|
||||||
EIGEN_DEVICE_FUNC inline Index innerStride() const;
|
EIGEN_DEVICE_FUNC inline Index innerStride() const;
|
||||||
EIGEN_DEVICE_FUNC inline Index outerStride() const;
|
EIGEN_DEVICE_FUNC inline Index outerStride() const;
|
||||||
#endif
|
#endif
|
||||||
|
@ -258,8 +258,8 @@ class DenseStorage<T, 0, Dynamic, Dynamic, Options_> {
|
|||||||
m_cols = cols;
|
m_cols = cols;
|
||||||
eigen_assert(m_rows * m_cols == 0 && "The number of rows times columns must equal the storage size.");
|
eigen_assert(m_rows * m_cols == 0 && "The number of rows times columns must equal the storage size.");
|
||||||
}
|
}
|
||||||
EIGEN_DEVICE_FUNC const T* data() const { return nullptr; }
|
EIGEN_DEVICE_FUNC constexpr const T* data() const { return nullptr; }
|
||||||
EIGEN_DEVICE_FUNC T* data() { return nullptr; }
|
EIGEN_DEVICE_FUNC constexpr T* data() { return nullptr; }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T, int Rows_, int Options_>
|
template <typename T, int Rows_, int Options_>
|
||||||
@ -288,8 +288,8 @@ class DenseStorage<T, 0, Rows_, Dynamic, Options_> {
|
|||||||
m_cols = cols;
|
m_cols = cols;
|
||||||
eigen_assert(Rows_ * m_cols == 0 && "The number of rows times columns must equal the storage size.");
|
eigen_assert(Rows_ * m_cols == 0 && "The number of rows times columns must equal the storage size.");
|
||||||
}
|
}
|
||||||
EIGEN_DEVICE_FUNC const T* data() const { return nullptr; }
|
EIGEN_DEVICE_FUNC constexpr const T* data() const { return nullptr; }
|
||||||
EIGEN_DEVICE_FUNC T* data() { return nullptr; }
|
EIGEN_DEVICE_FUNC constexpr T* data() { return nullptr; }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T, int Cols_, int Options_>
|
template <typename T, int Cols_, int Options_>
|
||||||
@ -318,8 +318,8 @@ class DenseStorage<T, 0, Dynamic, Cols_, Options_> {
|
|||||||
m_rows = rows;
|
m_rows = rows;
|
||||||
eigen_assert(m_rows * Cols_ == 0 && "The number of rows times columns must equal the storage size.");
|
eigen_assert(m_rows * Cols_ == 0 && "The number of rows times columns must equal the storage size.");
|
||||||
}
|
}
|
||||||
EIGEN_DEVICE_FUNC const T* data() const { return nullptr; }
|
EIGEN_DEVICE_FUNC constexpr const T* data() const { return nullptr; }
|
||||||
EIGEN_DEVICE_FUNC T* data() { return nullptr; }
|
EIGEN_DEVICE_FUNC constexpr T* data() { return nullptr; }
|
||||||
};
|
};
|
||||||
|
|
||||||
// dynamic-size matrix with fixed-size storage
|
// dynamic-size matrix with fixed-size storage
|
||||||
@ -507,8 +507,8 @@ class DenseStorage<T, Dynamic, Dynamic, Dynamic, Options_> {
|
|||||||
m_rows = rows;
|
m_rows = rows;
|
||||||
m_cols = cols;
|
m_cols = cols;
|
||||||
}
|
}
|
||||||
EIGEN_DEVICE_FUNC const T* data() const { return m_data; }
|
EIGEN_DEVICE_FUNC constexpr const T* data() const { return m_data; }
|
||||||
EIGEN_DEVICE_FUNC T* data() { return m_data; }
|
EIGEN_DEVICE_FUNC constexpr T* data() { return m_data; }
|
||||||
};
|
};
|
||||||
|
|
||||||
// matrix with dynamic width and fixed height (so that matrix has dynamic size).
|
// matrix with dynamic width and fixed height (so that matrix has dynamic size).
|
||||||
@ -574,8 +574,8 @@ class DenseStorage<T, Dynamic, Rows_, Dynamic, Options_> {
|
|||||||
}
|
}
|
||||||
m_cols = cols;
|
m_cols = cols;
|
||||||
}
|
}
|
||||||
EIGEN_DEVICE_FUNC const T* data() const { return m_data; }
|
EIGEN_DEVICE_FUNC constexpr const T* data() const { return m_data; }
|
||||||
EIGEN_DEVICE_FUNC T* data() { return m_data; }
|
EIGEN_DEVICE_FUNC constexpr T* data() { return m_data; }
|
||||||
};
|
};
|
||||||
|
|
||||||
// matrix with dynamic height and fixed width (so that matrix has dynamic size).
|
// matrix with dynamic height and fixed width (so that matrix has dynamic size).
|
||||||
@ -641,8 +641,8 @@ class DenseStorage<T, Dynamic, Dynamic, Cols_, Options_> {
|
|||||||
}
|
}
|
||||||
m_rows = rows;
|
m_rows = rows;
|
||||||
}
|
}
|
||||||
EIGEN_DEVICE_FUNC const T* data() const { return m_data; }
|
EIGEN_DEVICE_FUNC constexpr const T* data() const { return m_data; }
|
||||||
EIGEN_DEVICE_FUNC T* data() { return m_data; }
|
EIGEN_DEVICE_FUNC constexpr T* data() { return m_data; }
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace Eigen
|
} // end namespace Eigen
|
||||||
|
@ -229,7 +229,7 @@ struct gemv_static_vector_if;
|
|||||||
|
|
||||||
template <typename Scalar, int Size, int MaxSize>
|
template <typename Scalar, int Size, int MaxSize>
|
||||||
struct gemv_static_vector_if<Scalar, Size, MaxSize, false> {
|
struct gemv_static_vector_if<Scalar, Size, MaxSize, false> {
|
||||||
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Scalar* data() {
|
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC constexpr Scalar* data() {
|
||||||
eigen_internal_assert(false && "should never be called");
|
eigen_internal_assert(false && "should never be called");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -237,19 +237,19 @@ struct gemv_static_vector_if<Scalar, Size, MaxSize, false> {
|
|||||||
|
|
||||||
template <typename Scalar, int Size>
|
template <typename Scalar, int Size>
|
||||||
struct gemv_static_vector_if<Scalar, Size, Dynamic, true> {
|
struct gemv_static_vector_if<Scalar, Size, Dynamic, true> {
|
||||||
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Scalar* data() { return 0; }
|
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC constexpr Scalar* data() { return 0; }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename Scalar, int Size, int MaxSize>
|
template <typename Scalar, int Size, int MaxSize>
|
||||||
struct gemv_static_vector_if<Scalar, Size, MaxSize, true> {
|
struct gemv_static_vector_if<Scalar, Size, MaxSize, true> {
|
||||||
#if EIGEN_MAX_STATIC_ALIGN_BYTES != 0
|
#if EIGEN_MAX_STATIC_ALIGN_BYTES != 0
|
||||||
internal::plain_array<Scalar, internal::min_size_prefer_fixed(Size, MaxSize), 0, AlignedMax> m_data;
|
internal::plain_array<Scalar, internal::min_size_prefer_fixed(Size, MaxSize), 0, AlignedMax> m_data;
|
||||||
EIGEN_STRONG_INLINE Scalar* data() { return m_data.array; }
|
EIGEN_STRONG_INLINE constexpr Scalar* data() { return m_data.array; }
|
||||||
#else
|
#else
|
||||||
// Some architectures cannot align on the stack,
|
// Some architectures cannot align on the stack,
|
||||||
// => let's manually enforce alignment by allocating more data and return the address of the first aligned element.
|
// => let's manually enforce alignment by allocating more data and return the address of the first aligned element.
|
||||||
internal::plain_array<Scalar, internal::min_size_prefer_fixed(Size, MaxSize) + EIGEN_MAX_ALIGN_BYTES, 0> m_data;
|
internal::plain_array<Scalar, internal::min_size_prefer_fixed(Size, MaxSize) + EIGEN_MAX_ALIGN_BYTES, 0> m_data;
|
||||||
EIGEN_STRONG_INLINE Scalar* data() {
|
EIGEN_STRONG_INLINE constexpr Scalar* data() {
|
||||||
return reinterpret_cast<Scalar*>((std::uintptr_t(m_data.array) & ~(std::size_t(EIGEN_MAX_ALIGN_BYTES - 1))) +
|
return reinterpret_cast<Scalar*>((std::uintptr_t(m_data.array) & ~(std::size_t(EIGEN_MAX_ALIGN_BYTES - 1))) +
|
||||||
EIGEN_MAX_ALIGN_BYTES);
|
EIGEN_MAX_ALIGN_BYTES);
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,7 @@ class MapBase<Derived, ReadOnlyAccessors> : public internal::dense_xpr_base<Deri
|
|||||||
*
|
*
|
||||||
* \sa innerStride(), outerStride()
|
* \sa innerStride(), outerStride()
|
||||||
*/
|
*/
|
||||||
EIGEN_DEVICE_FUNC inline const Scalar* data() const { return m_data; }
|
EIGEN_DEVICE_FUNC constexpr const Scalar* data() const { return m_data; }
|
||||||
|
|
||||||
/** \copydoc PlainObjectBase::coeff(Index,Index) const */
|
/** \copydoc PlainObjectBase::coeff(Index,Index) const */
|
||||||
EIGEN_DEVICE_FUNC inline const Scalar& coeff(Index rowId, Index colId) const {
|
EIGEN_DEVICE_FUNC inline const Scalar& coeff(Index rowId, Index colId) const {
|
||||||
@ -233,8 +233,8 @@ class MapBase<Derived, WriteAccessors> : public MapBase<Derived, ReadOnlyAccesso
|
|||||||
|
|
||||||
typedef std::conditional_t<internal::is_lvalue<Derived>::value, Scalar, const Scalar> ScalarWithConstIfNotLvalue;
|
typedef std::conditional_t<internal::is_lvalue<Derived>::value, Scalar, const Scalar> ScalarWithConstIfNotLvalue;
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC inline const Scalar* data() const { return this->m_data; }
|
EIGEN_DEVICE_FUNC constexpr const Scalar* data() const { return this->m_data; }
|
||||||
EIGEN_DEVICE_FUNC inline ScalarWithConstIfNotLvalue* data() {
|
EIGEN_DEVICE_FUNC constexpr ScalarWithConstIfNotLvalue* data() {
|
||||||
return this->m_data;
|
return this->m_data;
|
||||||
} // no const-cast here so non-const-correct code will give a compile error
|
} // no const-cast here so non-const-correct code will give a compile error
|
||||||
|
|
||||||
|
@ -270,10 +270,10 @@ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** \returns a const pointer to the data array of this matrix */
|
/** \returns a const pointer to the data array of this matrix */
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar* data() const { return m_storage.data(); }
|
EIGEN_DEVICE_FUNC constexpr const Scalar* data() const { return m_storage.data(); }
|
||||||
|
|
||||||
/** \returns a pointer to the data array of this matrix */
|
/** \returns a pointer to the data array of this matrix */
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar* data() { return m_storage.data(); }
|
EIGEN_DEVICE_FUNC constexpr Scalar* data() { return m_storage.data(); }
|
||||||
|
|
||||||
/** Resizes \c *this to a \a rows x \a cols matrix.
|
/** Resizes \c *this to a \a rows x \a cols matrix.
|
||||||
*
|
*
|
||||||
|
@ -173,7 +173,7 @@ class ReshapedImpl_dense<XprType, Rows, Cols, Order, false>
|
|||||||
|
|
||||||
#ifdef EIGEN_PARSED_BY_DOXYGEN
|
#ifdef EIGEN_PARSED_BY_DOXYGEN
|
||||||
/** \sa MapBase::data() */
|
/** \sa MapBase::data() */
|
||||||
EIGEN_DEVICE_FUNC inline const Scalar* data() const;
|
EIGEN_DEVICE_FUNC constexpr const Scalar* data() const;
|
||||||
EIGEN_DEVICE_FUNC inline Index innerStride() const;
|
EIGEN_DEVICE_FUNC inline Index innerStride() const;
|
||||||
EIGEN_DEVICE_FUNC inline Index outerStride() const;
|
EIGEN_DEVICE_FUNC inline Index outerStride() const;
|
||||||
#endif
|
#endif
|
||||||
|
@ -70,6 +70,13 @@ class Stride {
|
|||||||
/** Copy constructor */
|
/** Copy constructor */
|
||||||
EIGEN_DEVICE_FUNC Stride(const Stride& other) : m_outer(other.outer()), m_inner(other.inner()) {}
|
EIGEN_DEVICE_FUNC Stride(const Stride& other) : m_outer(other.outer()), m_inner(other.inner()) {}
|
||||||
|
|
||||||
|
/** Copy assignment operator */
|
||||||
|
EIGEN_DEVICE_FUNC Stride& operator=(const Stride& other) {
|
||||||
|
m_outer.setValue(other.outer());
|
||||||
|
m_inner.setValue(other.inner());
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
/** \returns the outer stride */
|
/** \returns the outer stride */
|
||||||
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index outer() const { return m_outer.value(); }
|
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR inline Index outer() const { return m_outer.value(); }
|
||||||
/** \returns the inner stride */
|
/** \returns the inner stride */
|
||||||
|
@ -119,10 +119,12 @@ class TransposeImpl<MatrixType, Dense> : public internal::TransposeImpl_base<Mat
|
|||||||
|
|
||||||
typedef std::conditional_t<internal::is_lvalue<MatrixType>::value, Scalar, const Scalar> ScalarWithConstIfNotLvalue;
|
typedef std::conditional_t<internal::is_lvalue<MatrixType>::value, Scalar, const Scalar> ScalarWithConstIfNotLvalue;
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ScalarWithConstIfNotLvalue* data() {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr ScalarWithConstIfNotLvalue* data() {
|
||||||
|
return derived().nestedExpression().data();
|
||||||
|
}
|
||||||
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr const Scalar* data() const {
|
||||||
return derived().nestedExpression().data();
|
return derived().nestedExpression().data();
|
||||||
}
|
}
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar* data() const { return derived().nestedExpression().data(); }
|
|
||||||
|
|
||||||
// FIXME: shall we keep the const version of coeffRef?
|
// FIXME: shall we keep the const version of coeffRef?
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar& coeffRef(Index rowId, Index colId) const {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar& coeffRef(Index rowId, Index colId) const {
|
||||||
|
@ -241,7 +241,7 @@ class blas_data_mapper<Scalar, Index, StorageOrder, AlignmentType, 1> {
|
|||||||
|
|
||||||
EIGEN_DEVICE_FUNC const Index stride() const { return m_stride; }
|
EIGEN_DEVICE_FUNC const Index stride() const { return m_stride; }
|
||||||
EIGEN_DEVICE_FUNC const Index incr() const { return 1; }
|
EIGEN_DEVICE_FUNC const Index incr() const { return 1; }
|
||||||
EIGEN_DEVICE_FUNC const Scalar* data() const { return m_data; }
|
EIGEN_DEVICE_FUNC constexpr const Scalar* data() const { return m_data; }
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC Index firstAligned(Index size) const {
|
EIGEN_DEVICE_FUNC Index firstAligned(Index size) const {
|
||||||
if (std::uintptr_t(m_data) % sizeof(Scalar)) {
|
if (std::uintptr_t(m_data) % sizeof(Scalar)) {
|
||||||
@ -430,7 +430,7 @@ class blas_data_mapper {
|
|||||||
|
|
||||||
EIGEN_DEVICE_FUNC const Index stride() const { return m_stride; }
|
EIGEN_DEVICE_FUNC const Index stride() const { return m_stride; }
|
||||||
EIGEN_DEVICE_FUNC const Index incr() const { return m_incr.value(); }
|
EIGEN_DEVICE_FUNC const Index incr() const { return m_incr.value(); }
|
||||||
EIGEN_DEVICE_FUNC Scalar* data() const { return m_data; }
|
EIGEN_DEVICE_FUNC constexpr Scalar* data() const { return m_data; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Scalar* EIGEN_RESTRICT m_data;
|
Scalar* EIGEN_RESTRICT m_data;
|
||||||
|
@ -116,17 +116,17 @@ class MaxSizeVector {
|
|||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool empty() const { return size_ == 0; }
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool empty() const { return size_ == 0; }
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T* data() { return data_; }
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr T* data() { return data_; }
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const T* data() const { return data_; }
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr const T* data() const { return data_; }
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T* begin() { return data_; }
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr T* begin() { return data_; }
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T* end() { return data_ + size_; }
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr T* end() { return data_ + size_; }
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const T* begin() const { return data_; }
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr const T* begin() const { return data_; }
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const T* end() const { return data_ + size_; }
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr const T* end() const { return data_ + size_; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
size_t reserve_;
|
size_t reserve_;
|
||||||
|
@ -588,9 +588,9 @@ class Transform {
|
|||||||
EIGEN_DEVICE_FUNC inline Transform inverse(TransformTraits traits = (TransformTraits)Mode) const;
|
EIGEN_DEVICE_FUNC inline Transform inverse(TransformTraits traits = (TransformTraits)Mode) const;
|
||||||
|
|
||||||
/** \returns a const pointer to the column major internal matrix */
|
/** \returns a const pointer to the column major internal matrix */
|
||||||
EIGEN_DEVICE_FUNC const Scalar* data() const { return m_matrix.data(); }
|
EIGEN_DEVICE_FUNC constexpr const Scalar* data() const { return m_matrix.data(); }
|
||||||
/** \returns a non-const pointer to the column major internal matrix */
|
/** \returns a non-const pointer to the column major internal matrix */
|
||||||
EIGEN_DEVICE_FUNC Scalar* data() { return m_matrix.data(); }
|
EIGEN_DEVICE_FUNC constexpr Scalar* data() { return m_matrix.data(); }
|
||||||
|
|
||||||
/** \returns \c *this with scalar type casted to \a NewScalarType
|
/** \returns \c *this with scalar type casted to \a NewScalarType
|
||||||
*
|
*
|
||||||
|
@ -202,9 +202,9 @@ class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_,
|
|||||||
inline StorageIndex* innerNonZeroPtr() { return m_innerNonZeros; }
|
inline StorageIndex* innerNonZeroPtr() { return m_innerNonZeros; }
|
||||||
|
|
||||||
/** \internal */
|
/** \internal */
|
||||||
inline Storage& data() { return m_data; }
|
constexpr Storage& data() { return m_data; }
|
||||||
/** \internal */
|
/** \internal */
|
||||||
inline const Storage& data() const { return m_data; }
|
constexpr const Storage& data() const { return m_data; }
|
||||||
|
|
||||||
/** \returns the value of the matrix at position \a i, \a j
|
/** \returns the value of the matrix at position \a i, \a j
|
||||||
* This function returns Scalar(0) if the element is an explicit \em zero */
|
* This function returns Scalar(0) if the element is an explicit \em zero */
|
||||||
|
@ -90,9 +90,9 @@ class SparseVector : public SparseCompressedBase<SparseVector<Scalar_, Options_,
|
|||||||
inline StorageIndex* innerNonZeroPtr() { return 0; }
|
inline StorageIndex* innerNonZeroPtr() { return 0; }
|
||||||
|
|
||||||
/** \internal */
|
/** \internal */
|
||||||
inline Storage& data() { return m_data; }
|
constexpr Storage& data() { return m_data; }
|
||||||
/** \internal */
|
/** \internal */
|
||||||
inline const Storage& data() const { return m_data; }
|
constexpr const Storage& data() const { return m_data; }
|
||||||
|
|
||||||
inline Scalar coeff(Index row, Index col) const {
|
inline Scalar coeff(Index row, Index col) const {
|
||||||
eigen_assert(IsColVector ? (col == 0 && row >= 0 && row < m_size) : (row == 0 && col >= 0 && col < m_size));
|
eigen_assert(IsColVector ? (col == 0 && row >= 0 && row < m_size) : (row == 0 && col >= 0 && col < m_size));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user