10#ifndef EIGEN_SPARSE_COMPRESSED_BASE_H
11#define EIGEN_SPARSE_COMPRESSED_BASE_H
15template<
typename Derived>
class SparseCompressedBase;
19template<
typename Derived>
35template<
typename Derived>
42 using Base::operator=;
139 const Index outer = Derived::IsRowMajor ?
row :
col;
140 const Index inner = Derived::IsRowMajor ?
col :
row;
144 eigen_assert(
end>=start &&
"you are using a non finalized sparse matrix or written coefficient does not exist");
157template<
typename Derived>
162 : m_values(0), m_indices(0), m_outer(0), m_id(0), m_end(0)
166 : m_values(other.m_values), m_indices(other.m_indices), m_outer(other.m_outer), m_id(other.m_id), m_end(other.m_end)
227 inline operator bool()
const {
return (m_id < m_end); }
243template<
typename Derived>
295 inline operator bool()
const {
return (m_id > m_start); }
308template<
typename Derived>
317 Flags = Derived::Flags
324 explicit evaluator(
const Derived &mat) : m_matrix(&mat), m_zero(0)
330 return m_matrix->nonZeros();
333 operator Derived&() {
return m_matrix->const_cast_derived(); }
334 operator const Derived&()
const {
return *m_matrix; }
344 return m_matrix->const_cast_derived().valuePtr()[p];
351 return m_matrix->const_cast_derived().valuePtr()[p];
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ColXpr col(Index i)
This is the const version of col().
Definition: BlockMethods.h:1097
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE RowXpr row(Index i)
This is the const version of row(). */.
Definition: BlockMethods.h:1118
#define eigen_internal_assert(x)
Definition: Macros.h:1053
#define eigen_assert(x)
Definition: Macros.h:1047
#define EIGEN_SPARSE_PUBLIC_INTERFACE(Derived)
Definition: SparseUtil.h:43
#define EIGEN_INTERNAL_CHECK_COST_VALUE(C)
Definition: StaticAssert.h:218
#define EIGEN_STATIC_ASSERT_VECTOR_ONLY(TYPE)
Definition: StaticAssert.h:142
Definition: ForwardDeclarations.h:50
A matrix or vector expression mapping an existing array of data.
Definition: Map.h:96
static ConstMapType Map(const Scalar *data)
Definition: PlainObjectBase.h:644
Definition: SparseCompressedBase.h:159
InnerIterator(const InnerIterator &other)
Definition: SparseCompressedBase.h:165
InnerIterator(const SparseCompressedBase &mat)
Definition: SparseCompressedBase.h:197
Index m_end
Definition: SparseCompressedBase.h:235
InnerIterator()
Definition: SparseCompressedBase.h:161
const OuterType m_outer
Definition: SparseCompressedBase.h:233
Index col() const
Definition: SparseCompressedBase.h:225
Index m_id
Definition: SparseCompressedBase.h:234
internal::variable_if_dynamic< Index, Derived::IsVectorAtCompileTime?0:Dynamic > OuterType
Definition: SparseCompressedBase.h:232
StorageIndex index() const
Definition: SparseCompressedBase.h:222
const Scalar * m_values
Definition: SparseCompressedBase.h:230
InnerIterator & operator++()
Definition: SparseCompressedBase.h:209
Scalar & valueRef()
Definition: SparseCompressedBase.h:220
Index row() const
Definition: SparseCompressedBase.h:224
InnerIterator operator+(Index i)
Definition: SparseCompressedBase.h:212
const StorageIndex * m_indices
Definition: SparseCompressedBase.h:231
InnerIterator(const SparseCompressedBase &mat, Index outer)
Definition: SparseCompressedBase.h:179
InnerIterator & operator=(const InnerIterator &other)
Definition: SparseCompressedBase.h:169
InnerIterator(const internal::CompressedStorage< Scalar, StorageIndex > &data)
Definition: SparseCompressedBase.h:203
InnerIterator & operator+=(Index i)
Definition: SparseCompressedBase.h:210
Index outer() const
Definition: SparseCompressedBase.h:223
const Scalar & value() const
Definition: SparseCompressedBase.h:219
Definition: SparseCompressedBase.h:245
Index m_id
Definition: SparseCompressedBase.h:303
internal::variable_if_dynamic< Index, Derived::IsVectorAtCompileTime?0:Dynamic > OuterType
Definition: SparseCompressedBase.h:300
StorageIndex index() const
Definition: SparseCompressedBase.h:290
const Scalar & value() const
Definition: SparseCompressedBase.h:287
Index row() const
Definition: SparseCompressedBase.h:292
Index outer() const
Definition: SparseCompressedBase.h:291
ReverseInnerIterator & operator-=(Index i)
Definition: SparseCompressedBase.h:278
ReverseInnerIterator & operator--()
Definition: SparseCompressedBase.h:277
const StorageIndex * m_indices
Definition: SparseCompressedBase.h:299
Index m_start
Definition: SparseCompressedBase.h:302
const Scalar * m_values
Definition: SparseCompressedBase.h:298
const OuterType m_outer
Definition: SparseCompressedBase.h:301
ReverseInnerIterator operator-(Index i)
Definition: SparseCompressedBase.h:280
Index col() const
Definition: SparseCompressedBase.h:293
Scalar & valueRef()
Definition: SparseCompressedBase.h:288
ReverseInnerIterator(const internal::CompressedStorage< Scalar, StorageIndex > &data)
Definition: SparseCompressedBase.h:271
ReverseInnerIterator(const SparseCompressedBase &mat)
Definition: SparseCompressedBase.h:265
ReverseInnerIterator(const SparseCompressedBase &mat, Index outer)
Definition: SparseCompressedBase.h:247
Common base class for sparse [compressed]-{row|column}-storage format.
Definition: SparseCompressedBase.h:38
StorageIndex * innerNonZeroPtr()
Definition: SparseCompressedBase.h:104
Index nonZeros() const
Definition: SparseCompressedBase.h:56
const StorageIndex * innerIndexPtr() const
Definition: SparseCompressedBase.h:80
StorageIndex * innerIndexPtr()
Definition: SparseCompressedBase.h:84
Eigen::Map< IndexVector > innerNonZeros()
Definition: SparseCompressedBase.h:50
SparseMatrixBase< Derived > Base
Definition: SparseCompressedBase.h:40
const Eigen::Map< const IndexVector > innerNonZeros() const
Definition: SparseCompressedBase.h:51
internal::LowerBoundIndex lower_bound(Index row, Index col) const
Definition: SparseCompressedBase.h:135
const Scalar * valuePtr() const
Definition: SparseCompressedBase.h:71
bool isCompressed() const
Definition: SparseCompressedBase.h:107
const StorageIndex * outerIndexPtr() const
Definition: SparseCompressedBase.h:90
Scalar * valuePtr()
Definition: SparseCompressedBase.h:75
Map< Array< Scalar, Dynamic, 1 > > coeffs()
Definition: SparseCompressedBase.h:126
const StorageIndex * innerNonZeroPtr() const
Definition: SparseCompressedBase.h:100
Base::IndexVector IndexVector
Definition: SparseCompressedBase.h:49
StorageIndex * outerIndexPtr()
Definition: SparseCompressedBase.h:95
@ IsRowMajor
Definition: SparseMatrixBase.h:100
const Map< const Array< Scalar, Dynamic, 1 > > coeffs() const
Definition: SparseCompressedBase.h:114
SparseCompressedBase()
Default constructor.
Definition: SparseCompressedBase.h:130
Base class of any sparse matrices or sparse expressions.
Definition: SparseMatrixBase.h:28
internal::traits< Derived >::StorageIndex StorageIndex
The integer type used to store indices within a SparseMatrix.
Definition: SparseMatrixBase.h:43
const Derived & derived() const
Definition: SparseMatrixBase.h:143
Index size() const
Definition: SparseMatrixBase.h:181
Index rows() const
Definition: SparseMatrixBase.h:176
internal::traits< Derived >::Scalar Scalar
Definition: SparseMatrixBase.h:31
@ IsRowMajor
Definition: SparseMatrixBase.h:100
Index outerSize() const
Definition: SparseMatrixBase.h:189
Index cols() const
Definition: SparseMatrixBase.h:178
Definition: XprHelper.h:130
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR T value()
Definition: XprHelper.h:135
FMT_CONSTEXPR auto find(Ptr first, Ptr last, T value, Ptr &out) -> bool
Definition: core.h:2325
static EIGEN_DEPRECATED const end_t end
Definition: IndexedViewHelper.h:181
Namespace containing all symbols from the Eigen library.
Definition: Core:141
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74
const int Dynamic
This value means that a positive quantity (e.g., a size) is not known at compile-time,...
Definition: Constants.h:22
result
Definition: format.h:2564
Definition: Eigen_Colamd.h:50
Eigen::Index Index
The interface type of indices.
Definition: EigenBase.h:39
Holds information about the various numeric (i.e.
Definition: NumTraits.h:233
Definition: SparseUtil.h:144
bool found
Definition: SparseUtil.h:148
Index value
Definition: SparseUtil.h:147
Derived::Scalar Scalar
Definition: SparseCompressedBase.h:312
Index find(Index row, Index col) const
Definition: SparseCompressedBase.h:356
evaluator()
Definition: SparseCompressedBase.h:320
DenseCoeffsBase< Derived, ReadOnlyAccessors >::CoeffReturnType CoeffReturnType
Definition: SparseCompressedBase.h:336
Index nonZerosEstimate() const
Definition: SparseCompressedBase.h:329
const Derived * m_matrix
Definition: SparseCompressedBase.h:362
evaluator(const Derived &mat)
Definition: SparseCompressedBase.h:324
Scalar & coeffRef(Index row, Index col)
Definition: SparseCompressedBase.h:347
const Scalar m_zero
Definition: SparseCompressedBase.h:363
Derived::InnerIterator InnerIterator
Definition: SparseCompressedBase.h:313
const Scalar & coeff(Index row, Index col) const
Definition: SparseCompressedBase.h:337
Definition: CoreEvaluators.h:111
Definition: CoreEvaluators.h:91
Definition: ForwardDeclarations.h:17
Definition: format.h:1552