Go to the documentation of this file.
10 #ifndef EIGEN_SPARSE_COMPRESSED_BASE_H
11 #define EIGEN_SPARSE_COMPRESSED_BASE_H
19 template<
typename Derived>
35 template<
typename Derived>
42 using Base::operator=;
46 class ReverseInnerIterator;
59 return derived().nonZeros();
62 else if(derived().outerSize()==0)
80 inline const StorageIndex*
innerIndexPtr()
const {
return derived().innerIndexPtr(); }
84 inline StorageIndex*
innerIndexPtr() {
return derived().innerIndexPtr(); }
90 inline const StorageIndex*
outerIndexPtr()
const {
return derived().outerIndexPtr(); }
95 inline StorageIndex*
outerIndexPtr() {
return derived().outerIndexPtr(); }
100 inline const StorageIndex*
innerNonZeroPtr()
const {
return derived().innerNonZeroPtr(); }
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");
157 template<
typename Derived>
162 : m_values(0), m_indices(0), m_outer(0), m_id(0), m_end(0)
171 m_values =
other.m_values;
172 m_indices =
other.m_indices;
182 if(Derived::IsVectorAtCompileTime &&
mat.outerIndexPtr()==0)
185 m_end =
mat.nonZeros();
189 m_id =
mat.outerIndexPtr()[outer];
190 if(
mat.isCompressed())
191 m_end =
mat.outerIndexPtr()[outer+1];
193 m_end = m_id +
mat.innerNonZeroPtr()[outer];
222 inline StorageIndex
index()
const {
return m_indices[m_id]; }
227 inline operator bool()
const {
return (m_id < m_end); }
243 template<
typename Derived>
250 if(Derived::IsVectorAtCompileTime &&
mat.outerIndexPtr()==0)
253 m_id =
mat.nonZeros();
257 m_start =
mat.outerIndexPtr()[outer];
258 if(
mat.isCompressed())
259 m_id =
mat.outerIndexPtr()[outer+1];
261 m_id = m_start +
mat.innerNonZeroPtr()[outer];
290 inline StorageIndex
index()
const {
return m_indices[m_id-1]; }
295 inline operator bool()
const {
return (m_id > m_start); }
308 template<
typename Derived>
317 Flags = Derived::Flags
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];
370 #endif // EIGEN_SPARSE_COMPRESSED_BASE_H
StorageIndex * innerIndexPtr()
Namespace containing all symbols from the Eigen library.
Scalar & coeffRef(Index row, Index col)
InnerIterator(const SparseCompressedBase &mat)
ReverseInnerIterator & operator--()
InnerIterator(const SparseCompressedBase &mat, Index outer)
const Scalar * valuePtr() const
InnerIterator(const InnerIterator &other)
InnerIterator(const internal::CompressedStorage< Scalar, StorageIndex > &data)
StorageIndex index() const
const Scalar & value() const
internal::LowerBoundIndex lower_bound(Index row, Index col) const
internal::variable_if_dynamic< Index, Derived::IsVectorAtCompileTime?0:Dynamic > OuterType
Eigen::Map< IndexVector > innerNonZeros()
StorageIndex * outerIndexPtr()
const StorageIndex * outerIndexPtr() const
bool isCompressed() const
Derived::InnerIterator InnerIterator
#define EIGEN_STATIC_ASSERT_VECTOR_ONLY(TYPE)
const StorageIndex * innerNonZeroPtr() const
const Scalar & coeff(Index row, Index col) const
ReverseInnerIterator(const SparseCompressedBase &mat, Index outer)
#define eigen_internal_assert(x)
InnerIterator operator+(Index i)
SparseMatrixBase< Derived > Base
const StorageIndex * innerIndexPtr() const
ReverseInnerIterator(const SparseCompressedBase &mat)
Common base class for sparse [compressed]-{row|column}-storage format.
#define EIGEN_SPARSE_PUBLIC_INTERFACE(Derived)
const Scalar & value() const
InnerIterator & operator++()
Index find(Index row, Index col) const
DenseCoeffsBase< Derived, ReadOnlyAccessors >::CoeffReturnType CoeffReturnType
StorageIndex index() const
ReverseInnerIterator operator-(Index i)
evaluator(const Derived &mat)
A matrix or vector expression mapping an existing array of data.
An InnerIterator allows to loop over the element of any matrix expression.
static ConstMapType Map(const Scalar *data)
ReverseInnerIterator(const internal::CompressedStorage< Scalar, StorageIndex > &data)
const StorageIndex * m_indices
const Map< const Array< Scalar, Dynamic, 1 > > coeffs() const
Base::IndexVector IndexVector
Index nonZerosEstimate() const
const Eigen::Map< const IndexVector > innerNonZeros() const
Base class of any sparse matrices or sparse expressions.
ReverseInnerIterator & operator-=(Index i)
InnerIterator & operator=(const InnerIterator &other)
internal::variable_if_dynamic< Index, Derived::IsVectorAtCompileTime?0:Dynamic > OuterType
const StorageIndex * m_indices
InnerIterator & operator+=(Index i)
static const EIGEN_DEPRECATED end_t end
#define EIGEN_INTERNAL_CHECK_COST_VALUE(C)
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
StorageIndex * innerNonZeroPtr()
Map< Array< Scalar, Dynamic, 1 > > coeffs()
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:04:26