Eigen::SparseCompressedBase< Derived > Class Template Reference

Common base class for sparse [compressed]-{row|column}-storage format. More...

#include <SparseCompressedBase.h>

+ Inheritance diagram for Eigen::SparseCompressedBase< Derived >:

Classes

class  InnerIterator
 
class  ReverseInnerIterator
 

Public Types

typedef SparseMatrixBase< Derived > Base
 
- Public Types inherited from Eigen::SparseMatrixBase< Derived >
enum  {
  RowsAtCompileTime = internal::traits<Derived>::RowsAtCompileTime , ColsAtCompileTime = internal::traits<Derived>::ColsAtCompileTime , SizeAtCompileTime = (internal::size_of_xpr_at_compile_time<Derived>::ret) , MaxRowsAtCompileTime = RowsAtCompileTime ,
  MaxColsAtCompileTime = ColsAtCompileTime , MaxSizeAtCompileTime = internal::size_at_compile_time(MaxRowsAtCompileTime, MaxColsAtCompileTime) , IsVectorAtCompileTime = RowsAtCompileTime == 1 || ColsAtCompileTime == 1 , NumDimensions ,
  Flags = internal::traits<Derived>::Flags , IsRowMajor = Flags & RowMajorBit ? 1 : 0 , InnerSizeAtCompileTime , HasDirectAccess_ = (int(Flags) & DirectAccessBit) ? 1 : 0
}
 
typedef internal::traits< Derived >::Scalar Scalar
 
typedef Scalar value_type
 
typedef internal::packet_traits< Scalar >::type PacketScalar
 
typedef internal::traits< Derived >::StorageKind StorageKind
 
typedef internal::traits< Derived >::StorageIndex StorageIndex
 
typedef internal::add_const_on_value_type_if_arithmetic< typename internal::packet_traits< Scalar >::type >::type PacketReturnType
 
typedef SparseMatrixBase StorageBaseType
 
typedef Matrix< StorageIndex, Dynamic, 1 > IndexVector
 
typedef Matrix< Scalar, Dynamic, 1 > ScalarVector
 
typedef std::conditional_t< NumTraits< Scalar >::IsComplex, CwiseUnaryOp< internal::scalar_conjugate_op< Scalar >, Eigen::Transpose< const Derived > >, Transpose< const Derived > > AdjointReturnType
 
typedef Transpose< Derived > TransposeReturnType
 
typedef Transpose< const Derived > ConstTransposeReturnType
 
typedef SparseMatrix< Scalar, Flags &RowMajorBit ? RowMajor :ColMajor, StorageIndexPlainObject
 
typedef NumTraits< Scalar >::Real RealScalar
 
typedef std::conditional_t< HasDirectAccess_, const Scalar &, ScalarCoeffReturnType
 
typedef CwiseNullaryOp< internal::scalar_constant_op< Scalar >, Matrix< Scalar, Dynamic, Dynamic > > ConstantReturnType
 
typedef Matrix< Scalar, RowsAtCompileTime, ColsAtCompileTimeDenseMatrixType
 
typedef Matrix< Scalar, internal::max_size_prefer_dynamic(RowsAtCompileTime, ColsAtCompileTime), internal::max_size_prefer_dynamic(RowsAtCompileTime, ColsAtCompileTime)> SquareMatrixType
 
typedef EigenBase< Derived > Base
 
- Public Types inherited from Eigen::EigenBase< Derived >
typedef Eigen::Index Index
 The interface type of indices. More...
 
typedef internal::traits< Derived >::StorageKind StorageKind
 

Public Member Functions

Index nonZeros () const
 
const ScalarvaluePtr () const
 
ScalarvaluePtr ()
 
const StorageIndexinnerIndexPtr () const
 
StorageIndexinnerIndexPtr ()
 
const StorageIndexouterIndexPtr () const
 
StorageIndexouterIndexPtr ()
 
const StorageIndexinnerNonZeroPtr () const
 
StorageIndexinnerNonZeroPtr ()
 
bool isCompressed () const
 
const Map< const Array< Scalar, Dynamic, 1 > > coeffs () const
 
Map< Array< Scalar, Dynamic, 1 > > coeffs ()
 
template<class Comp = std::less<>>
void sortInnerIndices (Index begin, Index end)
 
template<class Comp = std::less<>>
Index innerIndicesAreSorted (Index begin, Index end) const
 
template<class Comp = std::less<>>
void sortInnerIndices ()
 
template<class Comp = std::less<>>
Index innerIndicesAreSorted () const
 
template<typename OtherDerived >
Derived & operator= (const EigenBase< OtherDerived > &other)
 
template<typename OtherDerived >
Derived & operator= (const ReturnByValue< OtherDerived > &other)
 
template<typename OtherDerived >
Derived & operator= (const SparseMatrixBase< OtherDerived > &other)
 
Derived & operator= (const Derived &other)
 
- Public Member Functions inherited from Eigen::SparseMatrixBase< Derived >
template<typename OtherDerived >
Derived & operator= (const EigenBase< OtherDerived > &other)
 
const Derived & derived () const
 
Derived & derived ()
 
Derived & const_cast_derived () const
 
Index rows () const
 
Index cols () const
 
Index size () const
 
bool isVector () const
 
Index outerSize () const
 
Index innerSize () const
 
bool isRValue () const
 
Derived & markAsRValue ()
 
 SparseMatrixBase ()
 
template<typename OtherDerived >
Derived & operator= (const ReturnByValue< OtherDerived > &other)
 
template<typename OtherDerived >
Derived & operator= (const SparseMatrixBase< OtherDerived > &other)
 
Derived & operator= (const Derived &other)
 
template<typename OtherDerived >
Derived & operator+= (const SparseMatrixBase< OtherDerived > &other)
 
template<typename OtherDerived >
Derived & operator-= (const SparseMatrixBase< OtherDerived > &other)
 
template<typename OtherDerived >
Derived & operator+= (const DiagonalBase< OtherDerived > &other)
 
template<typename OtherDerived >
Derived & operator-= (const DiagonalBase< OtherDerived > &other)
 
template<typename OtherDerived >
Derived & operator+= (const EigenBase< OtherDerived > &other)
 
template<typename OtherDerived >
Derived & operator-= (const EigenBase< OtherDerived > &other)
 
Derived & operator*= (const Scalar &other)
 
Derived & operator/= (const Scalar &other)
 
template<typename OtherDerived >
EIGEN_STRONG_INLINE const CwiseProductDenseReturnType< OtherDerived >::Type cwiseProduct (const MatrixBase< OtherDerived > &other) const
 
template<typename OtherDerived >
const Product< Derived, OtherDerived > operator* (const DiagonalBase< OtherDerived > &other) const
 
template<typename OtherDerived >
const Product< Derived, OtherDerived, AliasFreeProductoperator* (const SparseMatrixBase< OtherDerived > &other) const
 
template<typename OtherDerived >
const Product< Derived, OtherDerived > operator* (const MatrixBase< OtherDerived > &other) const
 
SparseSymmetricPermutationProduct< Derived, Upper|LowertwistedBy (const PermutationMatrix< Dynamic, Dynamic, StorageIndex > &perm) const
 
template<typename OtherDerived >
Derived & operator*= (const SparseMatrixBase< OtherDerived > &other)
 
template<int Mode>
const TriangularView< const Derived, Mode > triangularView () const
 
template<unsigned int UpLo>
ConstSelfAdjointViewReturnType< UpLo >::Type selfadjointView () const
 
template<unsigned int UpLo>
SelfAdjointViewReturnType< UpLo >::Type selfadjointView ()
 
template<typename OtherDerived >
Scalar dot (const MatrixBase< OtherDerived > &other) const
 
template<typename OtherDerived >
Scalar dot (const SparseMatrixBase< OtherDerived > &other) const
 
RealScalar squaredNorm () const
 
RealScalar norm () const
 
RealScalar blueNorm () const
 
TransposeReturnType transpose ()
 
const ConstTransposeReturnType transpose () const
 
const AdjointReturnType adjoint () const
 
DenseMatrixType toDense () const
 
template<typename OtherDerived >
bool isApprox (const SparseMatrixBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
template<typename OtherDerived >
bool isApprox (const MatrixBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
const internal::eval< Derived >::type eval () const
 
Scalar sum () const
 
const SparseView< Derived > pruned (const Scalar &reference=Scalar(0), const RealScalar &epsilon=NumTraits< Scalar >::dummy_precision()) const
 
template<typename OtherDerived >
EIGEN_STRONG_INLINE Derived & operator-= (const SparseMatrixBase< OtherDerived > &other)
 
template<typename OtherDerived >
EIGEN_STRONG_INLINE Derived & operator+= (const SparseMatrixBase< OtherDerived > &other)
 
template<typename OtherDerived >
EIGEN_STRONG_INLINE const SparseMatrixBase< Derived >::template CwiseProductDenseReturnType< OtherDerived >::Type cwiseProduct (const MatrixBase< OtherDerived > &other) const
 
template<typename OtherDerived >
internal::traits< Derived >::Scalar dot (const MatrixBase< OtherDerived > &other) const
 
template<typename OtherDerived >
internal::traits< Derived >::Scalar dot (const SparseMatrixBase< OtherDerived > &other) const
 
template<unsigned int UpLo>
SparseMatrixBase< Derived >::template ConstSelfAdjointViewReturnType< UpLo >::Type selfadjointView () const
 
template<unsigned int UpLo>
SparseMatrixBase< Derived >::template SelfAdjointViewReturnType< UpLo >::Type selfadjointView ()
 
- Public Member Functions inherited from Eigen::EigenBase< Derived >
constexpr EIGEN_DEVICE_FUNC Derived & derived ()
 
constexpr EIGEN_DEVICE_FUNC const Derived & derived () const
 
EIGEN_DEVICE_FUNC Derived & const_cast_derived () const
 
EIGEN_DEVICE_FUNC const Derived & const_derived () const
 
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows () const EIGEN_NOEXCEPT
 
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols () const EIGEN_NOEXCEPT
 
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index size () const EIGEN_NOEXCEPT
 
template<typename Dest >
EIGEN_DEVICE_FUNC void evalTo (Dest &dst) const
 
template<typename Dest >
EIGEN_DEVICE_FUNC void addTo (Dest &dst) const
 
template<typename Dest >
EIGEN_DEVICE_FUNC void subTo (Dest &dst) const
 
template<typename Dest >
EIGEN_DEVICE_FUNC void applyThisOnTheRight (Dest &dst) const
 
template<typename Dest >
EIGEN_DEVICE_FUNC void applyThisOnTheLeft (Dest &dst) const
 
template<typename Device >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DeviceWrapper< Derived, Device > device (Device &device)
 
template<typename Device >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DeviceWrapper< const Derived, Device > device (Device &device) const
 

Protected Types

typedef Base::IndexVector IndexVector
 

Protected Member Functions

Eigen::Map< IndexVectorinnerNonZeros ()
 
const Eigen::Map< const IndexVectorinnerNonZeros () const
 
 SparseCompressedBase ()
 
internal::LowerBoundIndex lower_bound (Index row, Index col) const
 
- Protected Member Functions inherited from Eigen::SparseMatrixBase< Derived >
template<typename OtherDerived >
Derived & assign (const OtherDerived &other)
 
template<typename OtherDerived >
void assignGeneric (const OtherDerived &other)
 

Private Member Functions

template<typename OtherDerived >
 SparseCompressedBase (const SparseCompressedBase< OtherDerived > &)
 

Friends

struct internal::evaluator< SparseCompressedBase< Derived > >
 

Additional Inherited Members

- Static Protected Member Functions inherited from Eigen::SparseMatrixBase< Derived >
static StorageIndex convert_index (const Index idx)
 
- Protected Attributes inherited from Eigen::SparseMatrixBase< Derived >
bool m_isRValue
 

Detailed Description

template<typename Derived>
class Eigen::SparseCompressedBase< Derived >

Common base class for sparse [compressed]-{row|column}-storage format.

This class defines the common interface for all derived classes implementing the compressed sparse storage format, such as:

  • SparseMatrix
  • Ref<SparseMatrixType,Options>
  • Map<SparseMatrixType>

Member Typedef Documentation

◆ Base

template<typename Derived >
typedef SparseMatrixBase<Derived> Eigen::SparseCompressedBase< Derived >::Base

◆ IndexVector

template<typename Derived >
typedef Base::IndexVector Eigen::SparseCompressedBase< Derived >::IndexVector
protected

Constructor & Destructor Documentation

◆ SparseCompressedBase() [1/2]

template<typename Derived >
Eigen::SparseCompressedBase< Derived >::SparseCompressedBase ( )
inlineprotected

Default constructor. Do nothing.

177 {}

◆ SparseCompressedBase() [2/2]

template<typename Derived >
template<typename OtherDerived >
Eigen::SparseCompressedBase< Derived >::SparseCompressedBase ( const SparseCompressedBase< OtherDerived > &  )
explicitprivate

Member Function Documentation

◆ coeffs() [1/2]

template<typename Derived >
Map<Array<Scalar, Dynamic, 1> > Eigen::SparseCompressedBase< Derived >::coeffs ( )
inline
Returns
a read-write view of the stored coefficients as a 1D array expression
Warning
this method is for compressed storage only, and it will trigger an assertion otherwise.

Here is an example:

SparseMatrix<double> A(3, 3);
A.insert(1, 2) = 0;
A.insert(0, 1) = 1;
A.insert(2, 0) = 2;
A.makeCompressed();
cout << "The matrix A is:" << endl << MatrixXd(A) << endl;
cout << "it has " << A.nonZeros() << " stored non zero coefficients that are: " << A.coeffs().transpose() << endl;
A.coeffs() += 10;
cout << "After adding 10 to every stored non zero coefficient, the matrix A is:" << endl << MatrixXd(A) << endl;
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
Definition: bench_gemm.cpp:47

and the output is:

See also
valuePtr(), isCompressed()
136  {
139  }
#define eigen_assert(x)
Definition: Macros.h:910
static ConstMapType Map(const Scalar *data)
Definition: PlainObjectBase.h:595
Index nonZeros() const
Definition: SparseCompressedBase.h:64
const Scalar * valuePtr() const
Definition: SparseCompressedBase.h:78
bool isCompressed() const
Definition: SparseCompressedBase.h:114

References eigen_assert, Eigen::SparseCompressedBase< Derived >::isCompressed(), Eigen::PlainObjectBase< Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > >::Map(), Eigen::SparseCompressedBase< Derived >::nonZeros(), and Eigen::SparseCompressedBase< Derived >::valuePtr().

◆ coeffs() [2/2]

template<typename Derived >
const Map<const Array<Scalar, Dynamic, 1> > Eigen::SparseCompressedBase< Derived >::coeffs ( ) const
inline
Returns
a read-only view of the stored coefficients as a 1D array expression.
Warning
this method is for compressed storage only, and it will trigger an assertion otherwise.
See also
valuePtr(), isCompressed()
121  {
124  }

References eigen_assert, Eigen::SparseCompressedBase< Derived >::isCompressed(), Eigen::PlainObjectBase< Array< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ > >::Map(), Eigen::SparseCompressedBase< Derived >::nonZeros(), and Eigen::SparseCompressedBase< Derived >::valuePtr().

◆ innerIndexPtr() [1/2]

template<typename Derived >
StorageIndex* Eigen::SparseCompressedBase< Derived >::innerIndexPtr ( )
inline
Returns
a non-const pointer to the array of inner indices. This function is aimed at interoperability with other libraries.
See also
valuePtr(), outerIndexPtr()
91 { return derived().innerIndexPtr(); }
const Derived & derived() const
Definition: SparseMatrixBase.h:144

References Eigen::SparseMatrixBase< Derived >::derived().

◆ innerIndexPtr() [2/2]

template<typename Derived >
const StorageIndex* Eigen::SparseCompressedBase< Derived >::innerIndexPtr ( ) const
inline
Returns
a const pointer to the array of inner indices. This function is aimed at interoperability with other libraries.
See also
valuePtr(), outerIndexPtr()
87 { return derived().innerIndexPtr(); }

References Eigen::SparseMatrixBase< Derived >::derived().

Referenced by Eigen::internal::inner_sort_impl< Derived, Comp, IsVector >::check(), Eigen::internal::inner_sort_impl< Derived, Comp, true >::check(), Eigen::internal::inner_sort_impl< Derived, Comp, IsVector >::run(), and Eigen::internal::inner_sort_impl< Derived, Comp, true >::run().

◆ innerIndicesAreSorted() [1/2]

template<typename Derived >
template<class Comp = std::less<>>
Index Eigen::SparseCompressedBase< Derived >::innerIndicesAreSorted ( ) const
inline
Returns
the index of the first inner vector in the range [0,outerSize) that is not sorted with respect to Comp, or outerSize if the range is fully sorted
See also
sortInnerIndices()
169  {
170  Index begin = 0;
171  Index end = derived().outerSize();
173  }
static constexpr lastp1_t end
Definition: IndexedViewHelper.h:79
Eigen::Index Index
The interface type of indices.
Definition: EigenBase.h:43
static Index check(const SparseCompressedBase< Derived > &obj, Index begin, Index end)
Definition: SparseCompressedBase.h:513

References Eigen::internal::inner_sort_impl< Derived, Comp, IsVector >::check(), Eigen::SparseMatrixBase< Derived >::derived(), and Eigen::placeholders::end.

◆ innerIndicesAreSorted() [2/2]

template<typename Derived >
template<class Comp = std::less<>>
Index Eigen::SparseCompressedBase< Derived >::innerIndicesAreSorted ( Index  begin,
Index  end 
) const
inline
Returns
the index of the first inner vector in the range [begin,end) that is not sorted with respect to Comp, or end if the range is fully sorted
See also
sortInnerIndices()
152  {
153  eigen_assert(begin >= 0 && end <= derived().outerSize() && end >= begin);
155  }
Index outerSize() const
Definition: SparseMatrixBase.h:195

References Eigen::internal::inner_sort_impl< Derived, Comp, IsVector >::check(), Eigen::SparseMatrixBase< Derived >::derived(), eigen_assert, Eigen::placeholders::end, and Eigen::SparseMatrixBase< Derived >::outerSize().

◆ innerNonZeroPtr() [1/2]

template<typename Derived >
StorageIndex* Eigen::SparseCompressedBase< Derived >::innerNonZeroPtr ( )
inline
Returns
a non-const pointer to the array of the number of non zeros of the inner vectors. This function is aimed at interoperability with other libraries.
Warning
it returns the null pointer 0 in compressed mode
111 { return derived().innerNonZeroPtr(); }

References Eigen::SparseMatrixBase< Derived >::derived().

◆ innerNonZeroPtr() [2/2]

template<typename Derived >
const StorageIndex* Eigen::SparseCompressedBase< Derived >::innerNonZeroPtr ( ) const
inline
Returns
a const pointer to the array of the number of non zeros of the inner vectors. This function is aimed at interoperability with other libraries.
Warning
it returns the null pointer 0 in compressed mode
107 { return derived().innerNonZeroPtr(); }

References Eigen::SparseMatrixBase< Derived >::derived().

Referenced by Eigen::internal::inner_sort_impl< Derived, Comp, IsVector >::check(), Eigen::SparseCompressedBase< Derived >::innerNonZeros(), Eigen::SparseCompressedBase< Derived >::isCompressed(), and Eigen::internal::inner_sort_impl< Derived, Comp, IsVector >::run().

◆ innerNonZeros() [1/2]

template<typename Derived >
Eigen::Map<IndexVector> Eigen::SparseCompressedBase< Derived >::innerNonZeros ( )
inlineprotected
55  {
57  }
A matrix or vector expression mapping an existing array of data.
Definition: Map.h:96
const StorageIndex * innerNonZeroPtr() const
Definition: SparseCompressedBase.h:107

References Eigen::SparseMatrixBase< Derived >::derived(), Eigen::SparseCompressedBase< Derived >::innerNonZeroPtr(), Eigen::SparseCompressedBase< Derived >::isCompressed(), and Eigen::SparseMatrixBase< Derived >::outerSize().

Referenced by Eigen::SparseCompressedBase< Derived >::nonZeros().

◆ innerNonZeros() [2/2]

◆ isCompressed()

◆ lower_bound()

template<typename Derived >
internal::LowerBoundIndex Eigen::SparseCompressedBase< Derived >::lower_bound ( Index  row,
Index  col 
) const
inlineprotected

return the index of the coeff at (row,col) or just before if it does not exist. This is an analogue of std::lower_bound.

182  {
183  eigen_internal_assert(row >= 0 && row < this->rows() && col >= 0 && col < this->cols());
184 
185  const Index outer = Derived::IsRowMajor ? row : col;
186  const Index inner = Derived::IsRowMajor ? col : row;
187 
188  Index start = this->outerIndexPtr()[outer];
189  Index end = this->isCompressed() ? this->outerIndexPtr()[outer + 1]
190  : this->outerIndexPtr()[outer] + this->innerNonZeroPtr()[outer];
191  eigen_assert(end >= start && "you are using a non finalized sparse matrix or written coefficient does not exist");
192  internal::LowerBoundIndex p;
193  p.value =
194  std::lower_bound(this->innerIndexPtr() + start, this->innerIndexPtr() + end, inner) - this->innerIndexPtr();
195  p.found = (p.value < end) && (this->innerIndexPtr()[p.value] == inner);
196  return p;
197  }
#define eigen_internal_assert(x)
Definition: Macros.h:916
m col(1)
m row(1)
float * p
Definition: Tutorial_Map_using.cpp:9
const StorageIndex * outerIndexPtr() const
Definition: SparseCompressedBase.h:97
const StorageIndex * innerIndexPtr() const
Definition: SparseCompressedBase.h:87
Index rows() const
Definition: SparseMatrixBase.h:182
Index cols() const
Definition: SparseMatrixBase.h:184
void start(const unsigned &i)
(Re-)start i-th timer
Definition: oomph_utilities.cc:243

◆ nonZeros()

template<typename Derived >
Index Eigen::SparseCompressedBase< Derived >::nonZeros ( ) const
inline
Returns
the number of non zero coefficients
64  {
65  if (Derived::IsVectorAtCompileTime && outerIndexPtr() == 0)
66  return derived().nonZeros();
67  else if (derived().outerSize() == 0)
68  return 0;
69  else if (isCompressed())
70  return outerIndexPtr()[derived().outerSize()] - outerIndexPtr()[0];
71  else
72  return innerNonZeros().sum();
73  }
Eigen::Map< IndexVector > innerNonZeros()
Definition: SparseCompressedBase.h:55

References Eigen::SparseMatrixBase< Derived >::derived(), Eigen::SparseCompressedBase< Derived >::innerNonZeros(), Eigen::SparseCompressedBase< Derived >::isCompressed(), Eigen::SparseCompressedBase< Derived >::outerIndexPtr(), and Eigen::SparseMatrixBase< Derived >::outerSize().

Referenced by Eigen::internal::inner_sort_impl< Derived, Comp, true >::check(), Eigen::SparseCompressedBase< Derived >::coeffs(), and Eigen::internal::inner_sort_impl< Derived, Comp, true >::run().

◆ operator=() [1/4]

template<typename Derived >
Derived & Eigen::SparseMatrixBase< Derived >::operator=
inline
43  {
44  internal::call_assignment_no_alias(derived(), other.derived());
45  return derived();
46 }
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR void call_assignment_no_alias(Dst &dst, const Src &src, const Func &func)
Definition: AssignEvaluator.h:812

Referenced by Eigen::SparseMatrix< Scalar_, Options_, StorageIndex_ >::operator=(), Eigen::SparseVector< Scalar_, Options_, StorageIndex_ >::operator=(), and Eigen::SparseMatrix< Scalar_, Options_, StorageIndex_ >::SparseMatrix().

◆ operator=() [2/4]

template<typename Derived >
template<typename OtherDerived >
Derived & Eigen::SparseMatrixBase< Derived >::operator= ( typename OtherDerived  )
20  {
21  internal::call_assignment_no_alias(derived(), other.derived());
22  return derived();
23 }

◆ operator=() [3/4]

template<typename Derived >
template<typename OtherDerived >
Derived & Eigen::SparseMatrixBase< Derived >::operator= ( typename OtherDerived  )
27  {
28  // TODO use the evaluator mechanism
29  other.evalTo(derived());
30  return derived();
31 }

◆ operator=() [4/4]

template<typename Derived >
template<typename OtherDerived >
Derived & Eigen::SparseMatrixBase< Derived >::operator= ( typename OtherDerived  )
inline
35  {
36  // by default sparse evaluation do not alias, so we can safely bypass the generic call_assignment routine
37  internal::Assignment<Derived, OtherDerived, internal::assign_op<Scalar, typename OtherDerived::Scalar>>::run(
38  derived(), other.derived(), internal::assign_op<Scalar, typename OtherDerived::Scalar>());
39  return derived();
40 }
auto run(Kernel kernel, Args &&... args) -> decltype(kernel(args...))
Definition: gpu_test_helper.h:414

◆ outerIndexPtr() [1/2]

template<typename Derived >
StorageIndex* Eigen::SparseCompressedBase< Derived >::outerIndexPtr ( )
inline
Returns
a non-const pointer to the array of the starting positions of the inner vectors. This function is aimed at interoperability with other libraries.
Warning
it returns the null pointer 0 for SparseVector
See also
valuePtr(), innerIndexPtr()
102 { return derived().outerIndexPtr(); }

References Eigen::SparseMatrixBase< Derived >::derived().

◆ outerIndexPtr() [2/2]

template<typename Derived >
const StorageIndex* Eigen::SparseCompressedBase< Derived >::outerIndexPtr ( ) const
inline
Returns
a const pointer to the array of the starting positions of the inner vectors. This function is aimed at interoperability with other libraries.
Warning
it returns the null pointer 0 for SparseVector
See also
valuePtr(), innerIndexPtr()
97 { return derived().outerIndexPtr(); }

References Eigen::SparseMatrixBase< Derived >::derived().

Referenced by Eigen::internal::inner_sort_impl< Derived, Comp, IsVector >::check(), Eigen::SparseCompressedBase< Derived >::nonZeros(), and Eigen::internal::inner_sort_impl< Derived, Comp, IsVector >::run().

◆ sortInnerIndices() [1/2]

template<typename Derived >
template<class Comp = std::less<>>
void Eigen::SparseCompressedBase< Derived >::sortInnerIndices ( )
inline

sorts the inner vectors in the range [0,outerSize) with respect to Comp

See also
innerIndicesAreSorted()
160  {
161  Index begin = 0;
162  Index end = derived().outerSize();
164  }
static void run(SparseCompressedBase< Derived > &obj, Index begin, Index end)
Definition: SparseCompressedBase.h:503

References Eigen::SparseMatrixBase< Derived >::derived(), Eigen::placeholders::end, and Eigen::internal::inner_sort_impl< Derived, Comp, IsVector >::run().

◆ sortInnerIndices() [2/2]

template<typename Derived >
template<class Comp = std::less<>>
void Eigen::SparseCompressedBase< Derived >::sortInnerIndices ( Index  begin,
Index  end 
)
inline

◆ valuePtr() [1/2]

template<typename Derived >
Scalar* Eigen::SparseCompressedBase< Derived >::valuePtr ( )
inline
Returns
a non-const pointer to the array of values. This function is aimed at interoperability with other libraries.
See also
innerIndexPtr(), outerIndexPtr()
82 { return derived().valuePtr(); }

References Eigen::SparseMatrixBase< Derived >::derived().

◆ valuePtr() [2/2]

template<typename Derived >
const Scalar* Eigen::SparseCompressedBase< Derived >::valuePtr ( ) const
inline
Returns
a const pointer to the array of values. This function is aimed at interoperability with other libraries.
See also
innerIndexPtr(), outerIndexPtr()
78 { return derived().valuePtr(); }

References Eigen::SparseMatrixBase< Derived >::derived().

Referenced by Eigen::SparseCompressedBase< Derived >::coeffs(), Eigen::internal::inner_sort_impl< Derived, Comp, IsVector >::run(), and Eigen::internal::inner_sort_impl< Derived, Comp, true >::run().

Friends And Related Function Documentation

◆ internal::evaluator< SparseCompressedBase< Derived > >

template<typename Derived >
friend struct internal::evaluator< SparseCompressedBase< Derived > >
friend

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