Eigen::SparseCompressedBase< Derived >::InnerIterator Class Reference

#include <SparseCompressedBase.h>

Public Member Functions

 InnerIterator ()
 
 InnerIterator (const InnerIterator &other)
 
InnerIterator & operator= (const InnerIterator &other)
 
 InnerIterator (const SparseCompressedBase &mat, Index outer)
 
 InnerIterator (const SparseCompressedBase &mat)
 
 InnerIterator (const internal::CompressedStorage< Scalar, StorageIndex > &data)
 
InnerIterator & operator++ ()
 
InnerIterator & operator+= (Index i)
 
InnerIterator operator+ (Index i)
 
const Scalar & value () const
 
Scalar & valueRef ()
 
StorageIndex index () const
 
Index outer () const
 
Index row () const
 
Index col () const
 
 operator bool () const
 

Protected Types

typedef internal::variable_if_dynamic< Index, Derived::IsVectorAtCompileTime ? 0 :Dynamic > OuterType
 

Protected Attributes

const Scalar * m_values
 
const StorageIndex * m_indices
 
const OuterType m_outer
 
Index m_id
 
Index m_end
 

Private Member Functions

template<typename T >
 InnerIterator (const SparseMatrixBase< T > &, Index outer)
 

Member Typedef Documentation

◆ OuterType

template<typename Derived >
typedef internal::variable_if_dynamic<Index, Derived::IsVectorAtCompileTime ? 0 : Dynamic> Eigen::SparseCompressedBase< Derived >::InnerIterator::OuterType
protected

Constructor & Destructor Documentation

◆ InnerIterator() [1/6]

template<typename Derived >
Eigen::SparseCompressedBase< Derived >::InnerIterator::InnerIterator ( )
inline
209 : m_values(0), m_indices(0), m_outer(0), m_id(0), m_end(0) {}
Index m_end
Definition: SparseCompressedBase.h:281
const OuterType m_outer
Definition: SparseCompressedBase.h:279
Index m_id
Definition: SparseCompressedBase.h:280
const Scalar * m_values
Definition: SparseCompressedBase.h:276
const StorageIndex * m_indices
Definition: SparseCompressedBase.h:277

◆ InnerIterator() [2/6]

template<typename Derived >
Eigen::SparseCompressedBase< Derived >::InnerIterator::InnerIterator ( const InnerIterator &  other)
inline
212  : m_values(other.m_values),
213  m_indices(other.m_indices),
214  m_outer(other.m_outer),
215  m_id(other.m_id),
216  m_end(other.m_end) {}

◆ InnerIterator() [3/6]

template<typename Derived >
Eigen::SparseCompressedBase< Derived >::InnerIterator::InnerIterator ( const SparseCompressedBase &  mat,
Index  outer 
)
inline
229  if (Derived::IsVectorAtCompileTime && mat.outerIndexPtr() == 0) {
230  m_id = 0;
231  m_end = mat.nonZeros();
232  } else {
234  if (mat.isCompressed())
235  m_end = mat.outerIndexPtr()[outer + 1];
236  else
238  }
239  }
Index outer() const
Definition: SparseCompressedBase.h:269
Index nonZeros() const
Definition: SparseCompressedBase.h:64
const StorageIndex * innerNonZeroPtr() const
Definition: SparseMatrix.h:198
const Scalar * valuePtr() const
Definition: SparseMatrix.h:171
bool isCompressed() const
Definition: SparseCompressedBase.h:114
const StorageIndex * outerIndexPtr() const
Definition: SparseMatrix.h:189
const StorageIndex * innerIndexPtr() const
Definition: SparseMatrix.h:180

References Eigen::SparseMatrix< Scalar_, Options_, StorageIndex_ >::innerNonZeroPtr(), Eigen::SparseMatrix< Scalar_, Options_, StorageIndex_ >::isCompressed(), Eigen::SparseMatrix< Scalar_, Options_, StorageIndex_ >::nonZeros(), and Eigen::SparseMatrix< Scalar_, Options_, StorageIndex_ >::outerIndexPtr().

◆ InnerIterator() [4/6]

template<typename Derived >
Eigen::SparseCompressedBase< Derived >::InnerIterator::InnerIterator ( const SparseCompressedBase &  mat)
inlineexplicit
241  : InnerIterator(mat, Index(0)) {
243  }
#define EIGEN_STATIC_ASSERT_VECTOR_ONLY(TYPE)
Definition: StaticAssert.h:36
InnerIterator()
Definition: SparseCompressedBase.h:209
Eigen::Index Index
The interface type of indices.
Definition: EigenBase.h:43

References EIGEN_STATIC_ASSERT_VECTOR_ONLY.

◆ InnerIterator() [5/6]

template<typename Derived >
Eigen::SparseCompressedBase< Derived >::InnerIterator::InnerIterator ( const internal::CompressedStorage< Scalar, StorageIndex > &  data)
inlineexplicit
246  : m_values(data.valuePtr()), m_indices(data.indexPtr()), m_outer(0), m_id(0), m_end(data.size()) {
248  }
int data[]
Definition: Map_placement_new.cpp:1

References EIGEN_STATIC_ASSERT_VECTOR_ONLY.

◆ InnerIterator() [6/6]

template<typename Derived >
template<typename T >
Eigen::SparseCompressedBase< Derived >::InnerIterator::InnerIterator ( const SparseMatrixBase< T > &  ,
Index  outer 
)
private

Member Function Documentation

◆ col()

template<typename Derived >
Index Eigen::SparseCompressedBase< Derived >::InnerIterator::col ( ) const
inline
271 { return IsRowMajor ? index() : m_outer.value(); }
const Scalar & value() const
Definition: SparseCompressedBase.h:265
StorageIndex index() const
Definition: SparseCompressedBase.h:268
@ IsRowMajor
Definition: SparseMatrixBase.h:99

References Eigen::SparseCompressedBase< Derived >::IsRowMajor.

◆ index()

template<typename Derived >
StorageIndex Eigen::SparseCompressedBase< Derived >::InnerIterator::index ( ) const
inline
268 { return m_indices[m_id]; }

◆ operator bool()

template<typename Derived >
Eigen::SparseCompressedBase< Derived >::InnerIterator::operator bool ( ) const
inline
273 { return (m_id < m_end); }

◆ operator+()

template<typename Derived >
InnerIterator Eigen::SparseCompressedBase< Derived >::InnerIterator::operator+ ( Index  i)
inline
259  {
260  InnerIterator result = *this;
261  result += i;
262  return result;
263  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9

References i.

◆ operator++()

template<typename Derived >
InnerIterator& Eigen::SparseCompressedBase< Derived >::InnerIterator::operator++ ( )
inline
250  {
251  m_id++;
252  return *this;
253  }

◆ operator+=()

template<typename Derived >
InnerIterator& Eigen::SparseCompressedBase< Derived >::InnerIterator::operator+= ( Index  i)
inline
254  {
255  m_id += i;
256  return *this;
257  }

References i.

◆ operator=()

template<typename Derived >
InnerIterator& Eigen::SparseCompressedBase< Derived >::InnerIterator::operator= ( const InnerIterator &  other)
inline
218  {
219  m_values = other.m_values;
220  m_indices = other.m_indices;
221  const_cast<OuterType&>(m_outer).setValue(other.m_outer.value());
222  m_id = other.m_id;
223  m_end = other.m_end;
224  return *this;
225  }
internal::variable_if_dynamic< Index, Derived::IsVectorAtCompileTime ? 0 :Dynamic > OuterType
Definition: SparseCompressedBase.h:278

References Eigen::SparseCompressedBase< Derived >::InnerIterator::m_end, Eigen::SparseCompressedBase< Derived >::InnerIterator::m_id, Eigen::SparseCompressedBase< Derived >::InnerIterator::m_indices, Eigen::SparseCompressedBase< Derived >::InnerIterator::m_outer, Eigen::SparseCompressedBase< Derived >::InnerIterator::m_values, and Eigen::internal::variable_if_dynamic< T, Value >::value().

◆ outer()

template<typename Derived >
Index Eigen::SparseCompressedBase< Derived >::InnerIterator::outer ( ) const
inline
269 { return m_outer.value(); }
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR T value()
Definition: XprHelper.h:161

◆ row()

template<typename Derived >
Index Eigen::SparseCompressedBase< Derived >::InnerIterator::row ( ) const
inline

◆ value()

template<typename Derived >
const Scalar& Eigen::SparseCompressedBase< Derived >::InnerIterator::value ( ) const
inline
265 { return m_values[m_id]; }

◆ valueRef()

template<typename Derived >
Scalar& Eigen::SparseCompressedBase< Derived >::InnerIterator::valueRef ( )
inline
266 { return const_cast<Scalar&>(m_values[m_id]); }
SCALAR Scalar
Definition: bench_gemm.cpp:45

Member Data Documentation

◆ m_end

template<typename Derived >
Index Eigen::SparseCompressedBase< Derived >::InnerIterator::m_end
protected

◆ m_id

template<typename Derived >
Index Eigen::SparseCompressedBase< Derived >::InnerIterator::m_id
protected

◆ m_indices

template<typename Derived >
const StorageIndex* Eigen::SparseCompressedBase< Derived >::InnerIterator::m_indices
protected

◆ m_outer

template<typename Derived >
const OuterType Eigen::SparseCompressedBase< Derived >::InnerIterator::m_outer
protected

◆ m_values

template<typename Derived >
const Scalar* Eigen::SparseCompressedBase< Derived >::InnerIterator::m_values
protected

The documentation for this class was generated from the following file: