Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Eigen::SparseView< MatrixType > Class Template Reference

Expression of a dense or sparse matrix with zero or too small values removed. More...

#include <src/eigen/Eigen/src/SparseCore/SparseView.h>

+ Inheritance diagram for Eigen::SparseView< MatrixType >:
+ Collaboration diagram for Eigen::SparseView< MatrixType >:

Public Types

typedef internal::remove_all< MatrixType >::type NestedExpression
 
enum  
 
typedef internal::traits< SparseView< MatrixType > >::Scalar Scalar
 
typedef Scalar value_type
 
typedef internal::packet_traits< Scalar >::type PacketScalar
 
typedef internal::traits< SparseView< MatrixType > >::StorageKind StorageKind
 
typedef internal::traits< SparseView< MatrixType > >::StorageIndex StorageIndex
 
typedef internal::add_const_on_value_type_if_arithmetic< typenameinternal::packet_traits< Scalar >::type >::type PacketReturnType
 
typedef SparseMatrixBase StorageBaseType
 
typedef Matrix< StorageIndex, Dynamic, 1 > IndexVector
 
typedef Matrix< Scalar, Dynamic, 1 > ScalarVector
 
typedef internal::conditional< NumTraits< Scalar >::IsComplex, CwiseUnaryOp< internal::scalar_conjugate_op< Scalar >, Eigen::Transpose< constDerived > >, Transpose< constDerived > >::type AdjointReturnType
 
typedef Transpose< SparseView< MatrixType > > TransposeReturnType
 
typedef internal::add_const< Transpose< constDerived > >::type ConstTransposeReturnType
 
typedef SparseMatrix< Scalar, Flags &RowMajorBit ? RowMajor :ColMajor, StorageIndexPlainObject
 
typedef NumTraits< Scalar >::Real RealScalar
 
typedef internal::conditional< _HasDirectAccess, constScalar &, Scalar >::type CoeffReturnType
 
typedef CwiseNullaryOp< internal::scalar_constant_op< Scalar >, Matrix< Scalar, Dynamic, Dynamic > > ConstantReturnType
 
typedef Matrix< Scalar, RowsAtCompileTime, ColsAtCompileTimeDenseMatrixType
 
typedef Matrix< Scalar, EIGEN_SIZE_MAX(RowsAtCompileTime, ColsAtCompileTime), EIGEN_SIZE_MAX(RowsAtCompileTime, ColsAtCompileTime)> SquareMatrixType
 
typedef Block< SparseView< MatrixType >, IsRowMajor?1:Dynamic, IsRowMajor?Dynamic:1, true > InnerVectorReturnType
 
typedef Block< const SparseView< MatrixType >, IsRowMajor?1:Dynamic, IsRowMajor?Dynamic:1, true > ConstInnerVectorReturnType
 
typedef Block< SparseView< MatrixType >, Dynamic, Dynamic, true > InnerVectorsReturnType
 
typedef Block< const SparseView< MatrixType >, Dynamic, Dynamic, true > ConstInnerVectorsReturnType
 
typedef Eigen::Index Index
 The interface type of indices.
 

Public Member Functions

 SparseView (const MatrixType &mat, const Scalar &reference=Scalar(0), const RealScalar &epsilon=NumTraits< Scalar >::dummy_precision())
 
Index rows () const
 
Index cols () const
 
Index innerSize () const
 
Index outerSize () const
 
const internal::remove_all< MatrixTypeNested >::type & nestedExpression () const
 
Scalar reference () const
 
RealScalar epsilon () const
 
const SparseView< MatrixType > & derived () const
 
SparseView< MatrixType > & derived ()
 
SparseView< MatrixType > & const_cast_derived () const
 
Index size () const
 
bool isVector () const
 
bool isRValue () const
 
SparseView< MatrixType > & markAsRValue ()
 
SparseView< MatrixType > & operator+= (const SparseMatrixBase< OtherDerived > &other)
 
SparseView< MatrixType > & operator+= (const DiagonalBase< OtherDerived > &other)
 
SparseView< MatrixType > & operator+= (const EigenBase< OtherDerived > &other)
 
EIGEN_STRONG_INLINE SparseView< MatrixType > & operator+= (const SparseMatrixBase< OtherDerived > &other)
 
SparseView< MatrixType > & operator-= (const SparseMatrixBase< OtherDerived > &other)
 
SparseView< MatrixType > & operator-= (const DiagonalBase< OtherDerived > &other)
 
SparseView< MatrixType > & operator-= (const EigenBase< OtherDerived > &other)
 
EIGEN_STRONG_INLINE SparseView< MatrixType > & operator-= (const SparseMatrixBase< OtherDerived > &other)
 
SparseView< MatrixType > & operator*= (const Scalar &other)
 
SparseView< MatrixType > & operator*= (const SparseMatrixBase< OtherDerived > &other)
 
SparseView< MatrixType > & operator/= (const Scalar &other)
 
EIGEN_STRONG_INLINE const CwiseProductDenseReturnType< OtherDerived >::Type cwiseProduct (const MatrixBase< OtherDerived > &other) const
 
EIGEN_STRONG_INLINE const SparseMatrixBase< SparseView< MatrixType > >::template CwiseProductDenseReturnType< OtherDerived >::Type cwiseProduct (const MatrixBase< OtherDerived > &other) const
 
const Product< SparseView< MatrixType >, OtherDerived > operator* (const DiagonalBase< OtherDerived > &other) const
 
const Product< SparseView< MatrixType >, OtherDerived, AliasFreeProductoperator* (const SparseMatrixBase< OtherDerived > &other) const
 
const Product< SparseView< MatrixType >, OtherDerived > operator* (const MatrixBase< OtherDerived > &other) const
 
SparseSymmetricPermutationProduct< SparseView< MatrixType >, Upper|LowertwistedBy (const PermutationMatrix< Dynamic, Dynamic, StorageIndex > &perm) const
 
const TriangularView< const SparseView< MatrixType >, Mode > triangularView () const
 
ConstSelfAdjointViewReturnType< UpLo >::Type selfadjointView () const
 
SelfAdjointViewReturnType< UpLo >::Type selfadjointView ()
 
SparseMatrixBase< SparseView< MatrixType > >::template ConstSelfAdjointViewReturnType< UpLo >::Type selfadjointView () const
 
SparseMatrixBase< SparseView< MatrixType > >::template SelfAdjointViewReturnType< UpLo >::Type selfadjointView ()
 
Scalar dot (const MatrixBase< OtherDerived > &other) const
 
Scalar dot (const SparseMatrixBase< OtherDerived > &other) const
 
internal::traits< SparseView< MatrixType > >::Scalar dot (const MatrixBase< OtherDerived > &other) const
 
internal::traits< SparseView< MatrixType > >::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
 
InnerVectorReturnType innerVector (Index outer)
 
const ConstInnerVectorReturnType innerVector (Index outer) const
 
InnerVectorsReturnType innerVectors (Index outerStart, Index outerSize)
 
const ConstInnerVectorsReturnType innerVectors (Index outerStart, Index outerSize) const
 
DenseMatrixType toDense () const
 
bool isApprox (const SparseMatrixBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
bool isApprox (const MatrixBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
const internal::eval< SparseView< MatrixType > >::type eval () const
 
Scalar sum () const
 
const SparseView< SparseView< MatrixType > > pruned (const Scalar &reference=Scalar(0), const RealScalar &epsilon=NumTraits< Scalar >::dummy_precision()) const
 
EIGEN_DEVICE_FUNC const Derived & const_derived () 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
 

Protected Member Functions

SparseView< MatrixType > & assign (const OtherDerived &other)
 
void assignGeneric (const OtherDerived &other)
 

Static Protected Member Functions

static StorageIndex convert_index (const Index idx)
 

Protected Attributes

MatrixTypeNested m_matrix
 
Scalar m_reference
 
RealScalar m_epsilon
 
bool m_isRValue
 

Private Types

typedef MatrixType::Nested MatrixTypeNested
 
typedef internal::remove_all< MatrixTypeNested >::type _MatrixTypeNested
 
typedef SparseMatrixBase< SparseViewBase
 

Private Member Functions

void evalTo (Dest &) const
 

Detailed Description

template<typename MatrixType>
class Eigen::SparseView< MatrixType >

Expression of a dense or sparse matrix with zero or too small values removed.

Template Parameters
MatrixTypethe type of the object of which we are removing the small entries

This class represents an expression of a given dense or sparse matrix with entries smaller than reference * epsilon are removed. It is the return type of MatrixBase::sparseView() and SparseMatrixBase::pruned() and most of the time this is the only way it is used.

See also
MatrixBase::sparseView(), SparseMatrixBase::pruned()

Member Typedef Documentation

◆ _MatrixTypeNested

template<typename MatrixType >
typedef internal::remove_all<MatrixTypeNested>::type Eigen::SparseView< MatrixType >::_MatrixTypeNested
private

◆ AdjointReturnType

typedef internal::conditional<NumTraits<Scalar>::IsComplex,CwiseUnaryOp<internal::scalar_conjugate_op<Scalar>,Eigen::Transpose<constDerived>>,Transpose<constDerived>>::type Eigen::SparseMatrixBase< SparseView< MatrixType > >::AdjointReturnType
inherited

◆ Base

template<typename MatrixType >
typedef SparseMatrixBase<SparseView > Eigen::SparseView< MatrixType >::Base
private

◆ CoeffReturnType

typedef internal::conditional<_HasDirectAccess,constScalar&,Scalar>::type Eigen::SparseMatrixBase< SparseView< MatrixType > >::CoeffReturnType
inherited

◆ ConstantReturnType

◆ ConstInnerVectorReturnType

typedef Block<const SparseView< MatrixType > ,IsRowMajor?1:Dynamic,IsRowMajor?Dynamic:1,true> Eigen::SparseMatrixBase< SparseView< MatrixType > >::ConstInnerVectorReturnType
inherited

◆ ConstInnerVectorsReturnType

typedef Block<const SparseView< MatrixType > ,Dynamic,Dynamic,true> Eigen::SparseMatrixBase< SparseView< MatrixType > >::ConstInnerVectorsReturnType
inherited

◆ ConstTransposeReturnType

typedef internal::add_const<Transpose<constDerived>>::type Eigen::SparseMatrixBase< SparseView< MatrixType > >::ConstTransposeReturnType
inherited

◆ DenseMatrixType

typedef Matrix<Scalar,RowsAtCompileTime,ColsAtCompileTime> Eigen::SparseMatrixBase< SparseView< MatrixType > >::DenseMatrixType
inherited

type of the equivalent dense matrix

◆ Index

template<typename Derived >
typedef Eigen::Index Eigen::EigenBase< Derived >::Index
inherited

The interface type of indices.

To change this, #define the preprocessor symbol EIGEN_DEFAULT_DENSE_INDEX_TYPE.

See also
StorageIndex, TopicPreprocessorDirectives.

◆ IndexVector

typedef Matrix<StorageIndex,Dynamic,1> Eigen::SparseMatrixBase< SparseView< MatrixType > >::IndexVector
inherited

◆ InnerVectorReturnType

typedef Block<SparseView< MatrixType > ,IsRowMajor?1:Dynamic,IsRowMajor?Dynamic:1,true> Eigen::SparseMatrixBase< SparseView< MatrixType > >::InnerVectorReturnType
inherited

◆ InnerVectorsReturnType

typedef Block<SparseView< MatrixType > ,Dynamic,Dynamic,true> Eigen::SparseMatrixBase< SparseView< MatrixType > >::InnerVectorsReturnType
inherited

◆ MatrixTypeNested

template<typename MatrixType >
typedef MatrixType::Nested Eigen::SparseView< MatrixType >::MatrixTypeNested
private

◆ NestedExpression

template<typename MatrixType >
typedef internal::remove_all<MatrixType>::type Eigen::SparseView< MatrixType >::NestedExpression

◆ PacketReturnType

typedef internal::add_const_on_value_type_if_arithmetic<typenameinternal::packet_traits<Scalar>::type>::type Eigen::SparseMatrixBase< SparseView< MatrixType > >::PacketReturnType
inherited

◆ PacketScalar

typedef internal::packet_traits<Scalar>::type Eigen::SparseMatrixBase< SparseView< MatrixType > >::PacketScalar
inherited

◆ PlainObject

typedef SparseMatrix<Scalar, Flags&RowMajorBit ? RowMajor : ColMajor, StorageIndex> Eigen::SparseMatrixBase< SparseView< MatrixType > >::PlainObject
inherited

◆ RealScalar

typedef NumTraits<Scalar>::Real Eigen::SparseMatrixBase< SparseView< MatrixType > >::RealScalar
inherited

This is the "real scalar" type; if the Scalar type is already real numbers (e.g. int, float or double) then RealScalar is just the same as Scalar. If Scalar is std::complex<T> then RealScalar is T.

See also
class NumTraits

◆ Scalar

typedef internal::traits<SparseView< MatrixType > >::Scalar Eigen::SparseMatrixBase< SparseView< MatrixType > >::Scalar
inherited

◆ ScalarVector

typedef Matrix<Scalar,Dynamic,1> Eigen::SparseMatrixBase< SparseView< MatrixType > >::ScalarVector
inherited

◆ SquareMatrixType

type of the equivalent square matrix

◆ StorageBaseType

typedef SparseMatrixBase Eigen::SparseMatrixBase< SparseView< MatrixType > >::StorageBaseType
inherited

◆ StorageIndex

typedef internal::traits<SparseView< MatrixType > >::StorageIndex Eigen::SparseMatrixBase< SparseView< MatrixType > >::StorageIndex
inherited

The integer type used to store indices within a SparseMatrix. For a SparseMatrix<Scalar,Options,IndexType> it an alias of the third template parameter IndexType.

◆ StorageKind

typedef internal::traits<SparseView< MatrixType > >::StorageKind Eigen::SparseMatrixBase< SparseView< MatrixType > >::StorageKind
inherited

◆ TransposeReturnType

typedef Transpose<SparseView< MatrixType > > Eigen::SparseMatrixBase< SparseView< MatrixType > >::TransposeReturnType
inherited

◆ value_type

typedef Scalar Eigen::SparseMatrixBase< SparseView< MatrixType > >::value_type
inherited

The numeric type of the expression' coefficients, e.g. float, double, int or std::complex<float>, etc.

It is an alias for the Scalar type

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited
57 {
58
59 RowsAtCompileTime = internal::traits<Derived>::RowsAtCompileTime,
65 ColsAtCompileTime = internal::traits<Derived>::ColsAtCompileTime,
72 SizeAtCompileTime = (internal::size_at_compile_time<internal::traits<Derived>::RowsAtCompileTime,
73 internal::traits<Derived>::ColsAtCompileTime>::ret),
78 MaxRowsAtCompileTime = RowsAtCompileTime,
79 MaxColsAtCompileTime = ColsAtCompileTime,
80
81 MaxSizeAtCompileTime = (internal::size_at_compile_time<MaxRowsAtCompileTime,
82 MaxColsAtCompileTime>::ret),
83
84 IsVectorAtCompileTime = RowsAtCompileTime == 1 || ColsAtCompileTime == 1,
90 Flags = internal::traits<Derived>::Flags,
96
97 InnerSizeAtCompileTime = int(IsVectorAtCompileTime) ? int(SizeAtCompileTime)
98 : int(IsRowMajor) ? int(ColsAtCompileTime) : int(RowsAtCompileTime),
99
100 #ifndef EIGEN_PARSED_BY_DOXYGEN
101 _HasDirectAccess = (int(Flags)&DirectAccessBit) ? 1 : 0 // workaround sunCC
102 #endif
103 };
@ _HasDirectAccess
Definition SparseMatrixBase.h:101
@ InnerSizeAtCompileTime
Definition SparseMatrixBase.h:97
@ IsVectorAtCompileTime
Definition SparseMatrixBase.h:84
@ ColsAtCompileTime
Definition SparseMatrixBase.h:65
@ Flags
Definition SparseMatrixBase.h:90
@ RowsAtCompileTime
Definition SparseMatrixBase.h:59
@ SizeAtCompileTime
Definition SparseMatrixBase.h:72
@ IsRowMajor
Definition SparseMatrixBase.h:95
const unsigned int DirectAccessBit
Definition Constants.h:150
const unsigned int RowMajorBit
Definition Constants.h:61

Constructor & Destructor Documentation

◆ SparseView()

template<typename MatrixType >
Eigen::SparseView< MatrixType >::SparseView ( const MatrixType &  mat,
const Scalar reference = Scalar(0),
const RealScalar epsilon = NumTraits<Scalar>::dummy_precision() 
)
inlineexplicit
Scalar reference() const
Definition SparseView.h:68
Scalar m_reference
Definition SparseView.h:73
RealScalar m_epsilon
Definition SparseView.h:74
MatrixTypeNested m_matrix
Definition SparseView.h:72
RealScalar epsilon() const
Definition SparseView.h:69

Member Function Documentation

◆ addTo()

template<typename Derived >
template<typename Dest >
EIGEN_DEVICE_FUNC void Eigen::EigenBase< Derived >::addTo ( Dest &  dst) const
inlineinherited
78 {
79 // This is the default implementation,
80 // derived class can reimplement it in a more optimized way.
81 typename Dest::PlainObject res(rows(),cols());
82 evalTo(res);
83 dst += res;
84 }
EIGEN_DEVICE_FUNC Index cols() const
Definition EigenBase.h:62
EIGEN_DEVICE_FUNC Index rows() const
Definition EigenBase.h:59
EIGEN_DEVICE_FUNC void evalTo(Dest &dst) const
Definition EigenBase.h:71

◆ adjoint()

const AdjointReturnType Eigen::SparseMatrixBase< SparseView< MatrixType > >::adjoint ( ) const
inlineinherited
351{ return AdjointReturnType(transpose()); }
internal::conditional< NumTraits< Scalar >::IsComplex, CwiseUnaryOp< internal::scalar_conjugate_op< Scalar >, Eigen::Transpose< constDerived > >, Transpose< constDerived > >::type AdjointReturnType
Definition SparseMatrixBase.h:109
TransposeReturnType transpose()
Definition SparseMatrixBase.h:349

◆ applyThisOnTheLeft()

template<typename Derived >
template<typename Dest >
EIGEN_DEVICE_FUNC void Eigen::EigenBase< Derived >::applyThisOnTheLeft ( Dest &  dst) const
inlineinherited
110 {
111 // This is the default implementation,
112 // derived class can reimplement it in a more optimized way.
113 dst = this->derived() * dst;
114 }
EIGEN_DEVICE_FUNC Derived & derived()
Definition EigenBase.h:45

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

+ Here is the call graph for this function:

◆ applyThisOnTheRight()

template<typename Derived >
template<typename Dest >
EIGEN_DEVICE_FUNC void Eigen::EigenBase< Derived >::applyThisOnTheRight ( Dest &  dst) const
inlineinherited
101 {
102 // This is the default implementation,
103 // derived class can reimplement it in a more optimized way.
104 dst = dst * this->derived();
105 }

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

+ Here is the call graph for this function:

◆ assign()

SparseView< MatrixType > & Eigen::SparseMatrixBase< SparseView< MatrixType > >::assign ( const OtherDerived &  other)
inlineprotectedinherited

◆ assignGeneric()

void Eigen::SparseMatrixBase< SparseView< MatrixType > >::assignGeneric ( const OtherDerived &  other)
inlineprotectedinherited

◆ blueNorm()

NumTraits< typenameinternal::traits< SparseView< MatrixType > >::Scalar >::Real Eigen::SparseMatrixBase< SparseView< MatrixType > >::blueNorm
inlineinherited
93{
94 return internal::blueNorm_impl(*this);
95}

◆ cols()

template<typename MatrixType >
Index Eigen::SparseView< MatrixType >::cols ( ) const
inline
59{ return m_matrix.cols(); }

References Eigen::SparseView< MatrixType >::m_matrix.

◆ const_cast_derived()

SparseView< MatrixType > & Eigen::SparseMatrixBase< SparseView< MatrixType > >::const_cast_derived ( ) const
inlineinherited
141 { return *static_cast<Derived*>(const_cast<SparseMatrixBase*>(this)); }
SparseMatrixBase()
Definition SparseMatrixBase.h:192

◆ const_derived()

template<typename Derived >
EIGEN_DEVICE_FUNC const Derived & Eigen::EigenBase< Derived >::const_derived ( ) const
inlineinherited
55 { return *static_cast<const Derived*>(this); }

◆ convert_index()

static StorageIndex Eigen::SparseMatrixBase< SparseView< MatrixType > >::convert_index ( const Index  idx)
inlinestaticprotectedinherited
396 {
397 return internal::convert_index<StorageIndex>(idx);
398 }

◆ cwiseProduct() [1/2]

EIGEN_STRONG_INLINE const SparseMatrixBase< SparseView< MatrixType > >::template CwiseProductDenseReturnType< OtherDerived >::Type Eigen::SparseMatrixBase< SparseView< MatrixType > >::cwiseProduct ( const MatrixBase< OtherDerived > &  other) const
inherited
692{
693 return typename CwiseProductDenseReturnType<OtherDerived>::Type(derived(), other.derived());
694}
const SparseView< MatrixType > & derived() const
Definition SparseMatrixBase.h:138

◆ cwiseProduct() [2/2]

EIGEN_STRONG_INLINE const CwiseProductDenseReturnType< OtherDerived >::Type Eigen::SparseMatrixBase< SparseView< MatrixType > >::cwiseProduct ( const MatrixBase< OtherDerived > &  other) const
inherited

◆ derived() [1/2]

SparseView< MatrixType > & Eigen::SparseMatrixBase< SparseView< MatrixType > >::derived ( )
inlineinherited
139{ return *static_cast<Derived*>(this); }

◆ derived() [2/2]

const SparseView< MatrixType > & Eigen::SparseMatrixBase< SparseView< MatrixType > >::derived ( ) const
inlineinherited
138{ return *static_cast<const Derived*>(this); }

◆ dot() [1/4]

internal::traits< SparseView< MatrixType > >::Scalar Eigen::SparseMatrixBase< SparseView< MatrixType > >::dot ( const MatrixBase< OtherDerived > &  other) const
inherited
19{
22 EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(Derived,OtherDerived)
23 EIGEN_STATIC_ASSERT((internal::is_same<Scalar, typename OtherDerived::Scalar>::value),
24 YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
25
26 eigen_assert(size() == other.size());
27 eigen_assert(other.size()>0 && "you are using a non initialized vector");
28
29 internal::evaluator<Derived> thisEval(derived());
30 typename internal::evaluator<Derived>::InnerIterator i(thisEval, 0);
31 Scalar res(0);
32 while (i)
33 {
34 res += numext::conj(i.value()) * other.coeff(i.index());
35 ++i;
36 }
37 return res;
38}
#define eigen_assert(x)
Definition Macros.h:579
#define EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(TYPE0, TYPE1)
Definition StaticAssert.h:164
#define EIGEN_STATIC_ASSERT_VECTOR_ONLY(TYPE)
Definition StaticAssert.h:139
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
Definition StaticAssert.h:124
Index size() const
Definition SparseMatrixBase.h:176
internal::traits< SparseView< MatrixType > >::Scalar Scalar
Definition SparseMatrixBase.h:31

◆ dot() [2/4]

Scalar Eigen::SparseMatrixBase< SparseView< MatrixType > >::dot ( const MatrixBase< OtherDerived > &  other) const
inherited

◆ dot() [3/4]

internal::traits< SparseView< MatrixType > >::Scalar Eigen::SparseMatrixBase< SparseView< MatrixType > >::dot ( const SparseMatrixBase< OtherDerived > &  other) const
inherited
44{
47 EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(Derived,OtherDerived)
48 EIGEN_STATIC_ASSERT((internal::is_same<Scalar, typename OtherDerived::Scalar>::value),
49 YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
50
51 eigen_assert(size() == other.size());
52
53 internal::evaluator<Derived> thisEval(derived());
54 typename internal::evaluator<Derived>::InnerIterator i(thisEval, 0);
55
56 internal::evaluator<OtherDerived> otherEval(other.derived());
57 typename internal::evaluator<OtherDerived>::InnerIterator j(otherEval, 0);
58
59 Scalar res(0);
60 while (i && j)
61 {
62 if (i.index()==j.index())
63 {
64 res += numext::conj(i.value()) * j.value();
65 ++i; ++j;
66 }
67 else if (i.index()<j.index())
68 ++i;
69 else
70 ++j;
71 }
72 return res;
73}

◆ dot() [4/4]

Scalar Eigen::SparseMatrixBase< SparseView< MatrixType > >::dot ( const SparseMatrixBase< OtherDerived > &  other) const
inherited

◆ epsilon()

template<typename MatrixType >
RealScalar Eigen::SparseView< MatrixType >::epsilon ( ) const
inline
69{ return m_epsilon; }

References Eigen::SparseView< MatrixType >::m_epsilon.

Referenced by Eigen::internal::unary_evaluator< SparseView< Product< Lhs, Rhs, Options > >, IteratorBased >::unary_evaluator(), and Eigen::internal::unary_evaluator< SparseView< ArgType >, IteratorBased >::InnerIterator::incrementToNonZero().

+ Here is the caller graph for this function:

◆ eval()

const internal::eval< SparseView< MatrixType > >::type Eigen::SparseMatrixBase< SparseView< MatrixType > >::eval ( ) const
inlineinherited
Returns
the matrix or vector obtained by evaluating this expression.

Notice that in the case of a plain matrix or vector (not an expression) this function just returns a const reference, in order to avoid a useless copy.

385 { return typename internal::eval<Derived>::type(derived()); }

◆ evalTo()

void Eigen::SparseMatrixBase< SparseView< MatrixType > >::evalTo ( Dest &  ) const
privateinherited

◆ innerSize()

template<typename MatrixType >
Index Eigen::SparseView< MatrixType >::innerSize ( ) const
inline
61{ return m_matrix.innerSize(); }

References Eigen::SparseView< MatrixType >::m_matrix.

◆ innerVector() [1/2]

SparseMatrixBase< SparseView< MatrixType > >::InnerVectorReturnType Eigen::SparseMatrixBase< SparseView< MatrixType > >::innerVector ( Index  outer)
inherited
Returns
the outer -th column (resp. row) of the matrix *this if *this is col-major (resp. row-major).
334{ return InnerVectorReturnType(derived(), outer); }
Block< SparseView< MatrixType >, IsRowMajor?1:Dynamic, IsRowMajor?Dynamic:1, true > InnerVectorReturnType
Definition SparseMatrixBase.h:354

◆ innerVector() [2/2]

const SparseMatrixBase< SparseView< MatrixType > >::ConstInnerVectorReturnType Eigen::SparseMatrixBase< SparseView< MatrixType > >::innerVector ( Index  outer) const
inherited
Returns
the outer -th column (resp. row) of the matrix *this if *this is col-major (resp. row-major). Read-only.
341{ return ConstInnerVectorReturnType(derived(), outer); }
Block< const SparseView< MatrixType >, IsRowMajor?1:Dynamic, IsRowMajor?Dynamic:1, true > ConstInnerVectorReturnType
Definition SparseMatrixBase.h:355

◆ innerVectors() [1/2]

SparseMatrixBase< SparseView< MatrixType > >::InnerVectorsReturnType Eigen::SparseMatrixBase< SparseView< MatrixType > >::innerVectors ( Index  outerStart,
Index  outerSize 
)
inherited
Returns
the outer -th column (resp. row) of the matrix *this if *this is col-major (resp. row-major).
349{
350 return Block<Derived,Dynamic,Dynamic,true>(derived(),
351 IsRowMajor ? outerStart : 0, IsRowMajor ? 0 : outerStart,
353
354}
Index rows() const
Definition SparseMatrixBase.h:171
Index outerSize() const
Definition SparseMatrixBase.h:184
Index cols() const
Definition SparseMatrixBase.h:173

◆ innerVectors() [2/2]

const SparseMatrixBase< SparseView< MatrixType > >::ConstInnerVectorsReturnType Eigen::SparseMatrixBase< SparseView< MatrixType > >::innerVectors ( Index  outerStart,
Index  outerSize 
) const
inherited
Returns
the outer -th column (resp. row) of the matrix *this if *this is col-major (resp. row-major). Read-only.
362{
363 return Block<const Derived,Dynamic,Dynamic,true>(derived(),
364 IsRowMajor ? outerStart : 0, IsRowMajor ? 0 : outerStart,
366
367}

◆ isApprox() [1/2]

bool Eigen::SparseMatrixBase< SparseView< MatrixType > >::isApprox ( const MatrixBase< OtherDerived > &  other,
const RealScalar prec = NumTraits<Scalar>::dummy_precision() 
) const
inlineinherited
377 { return toDense().isApprox(other,prec); }
DenseMatrixType toDense() const
Definition SparseMatrixBase.h:365

◆ isApprox() [2/2]

bool Eigen::SparseMatrixBase< SparseView< MatrixType > >::isApprox ( const SparseMatrixBase< OtherDerived > &  other,
const RealScalar prec = NumTraits<Scalar>::dummy_precision() 
) const
inherited
18{
19 const typename internal::nested_eval<Derived,2,PlainObject>::type actualA(derived());
20 typename internal::conditional<bool(IsRowMajor)==bool(OtherDerived::IsRowMajor),
21 const typename internal::nested_eval<OtherDerived,2,PlainObject>::type,
22 const PlainObject>::type actualB(other.derived());
23
24 return (actualA - actualB).squaredNorm() <= prec * prec * numext::mini(actualA.squaredNorm(), actualB.squaredNorm());
25}
SparseMatrix< Scalar, Flags &RowMajorBit ? RowMajor :ColMajor, StorageIndex > PlainObject
Definition SparseMatrixBase.h:114

◆ isRValue()

bool Eigen::SparseMatrixBase< SparseView< MatrixType > >::isRValue ( ) const
inlineinherited
189{ return m_isRValue; }
bool m_isRValue
Definition SparseMatrixBase.h:394

◆ isVector()

bool Eigen::SparseMatrixBase< SparseView< MatrixType > >::isVector ( ) const
inlineinherited
Returns
true if either the number of rows or the number of columns is equal to 1. In other words, this function returns
rows()==1 || cols()==1
Index cols() const
Definition SparseView.h:59
Index rows() const
Definition SparseView.h:58
See also
rows(), cols(), IsVectorAtCompileTime.
181{ return rows()==1 || cols()==1; }

◆ markAsRValue()

SparseView< MatrixType > & Eigen::SparseMatrixBase< SparseView< MatrixType > >::markAsRValue ( )
inlineinherited
190{ m_isRValue = true; return derived(); }

◆ nestedExpression()

template<typename MatrixType >
const internal::remove_all< MatrixTypeNested >::type & Eigen::SparseView< MatrixType >::nestedExpression ( ) const
inline
Returns
the nested expression
66{ return m_matrix; }

References Eigen::SparseView< MatrixType >::m_matrix.

Referenced by Eigen::internal::unary_evaluator< SparseView< Product< Lhs, Rhs, Options > >, IteratorBased >::unary_evaluator().

+ Here is the caller graph for this function:

◆ norm()

NumTraits< typenameinternal::traits< SparseView< MatrixType > >::Scalar >::Real Eigen::SparseMatrixBase< SparseView< MatrixType > >::norm
inlineinherited
85{
86 using std::sqrt;
87 return sqrt(squaredNorm());
88}
EIGEN_DEVICE_FUNC const SqrtReturnType sqrt() const
Definition ArrayCwiseUnaryOps.h:152
RealScalar squaredNorm() const
Definition SparseDot.h:77

◆ operator*() [1/3]

const Product< SparseView< MatrixType > , OtherDerived > Eigen::SparseMatrixBase< SparseView< MatrixType > >::operator* ( const DiagonalBase< OtherDerived > &  other) const
inlineinherited
298 { return Product<Derived,OtherDerived>(derived(), other.derived()); }

◆ operator*() [2/3]

const Product< SparseView< MatrixType > , OtherDerived > Eigen::SparseMatrixBase< SparseView< MatrixType > >::operator* ( const MatrixBase< OtherDerived > &  other) const
inlineinherited
315 { return Product<Derived,OtherDerived>(derived(), other.derived()); }

◆ operator*() [3/3]

const Product< SparseView< MatrixType > , OtherDerived, AliasFreeProduct > Eigen::SparseMatrixBase< SparseView< MatrixType > >::operator* ( const SparseMatrixBase< OtherDerived > &  other) const
inlineinherited
Returns
an expression of the product of two sparse matrices. By default a conservative product preserving the symbolic non zeros is performed. The automatic pruning of the small values can be achieved by calling the pruned() function in which case a totally different product algorithm is employed:
C = (A*B).pruned(); // supress numerical zeros (exact)
C = (A*B).pruned(ref);
C = (A*B).pruned(ref,epsilon);
const SparseView< SparseView< MatrixType > > pruned(const Scalar &reference=Scalar(0), const RealScalar &epsilon=NumTraits< Scalar >::dummy_precision()) const
Definition SparseView.h:245
where ref is a meaningful non zero reference value.
30{
31 return Product<Derived,OtherDerived,AliasFreeProduct>(derived(), other.derived());
32}

◆ operator*=() [1/2]

EIGEN_STRONG_INLINE SparseView< MatrixType > & Eigen::SparseMatrixBase< SparseView< MatrixType > >::operator*= ( const Scalar other)
inherited
125{
126 typedef typename internal::evaluator<Derived>::InnerIterator EvalIterator;
127 internal::evaluator<Derived> thisEval(derived());
128 for (Index j=0; j<outerSize(); ++j)
129 for (EvalIterator i(thisEval,j); i; ++i)
130 i.valueRef() *= other;
131 return derived();
132}

◆ operator*=() [2/2]

SparseView< MatrixType > & Eigen::SparseMatrixBase< SparseView< MatrixType > >::operator*= ( const SparseMatrixBase< OtherDerived > &  other)
inherited

◆ operator+=() [1/4]

SparseView< MatrixType > & Eigen::SparseMatrixBase< SparseView< MatrixType > >::operator+= ( const DiagonalBase< OtherDerived > &  other)
inherited
675{
676 call_assignment_no_alias(derived(), other.derived(), internal::add_assign_op<Scalar,typename OtherDerived::Scalar>());
677 return derived();
678}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_assignment_no_alias(Dst &dst, const Src &src, const Func &func)
Definition AssignEvaluator.h:819

◆ operator+=() [2/4]

SparseView< MatrixType > & Eigen::SparseMatrixBase< SparseView< MatrixType > >::operator+= ( const EigenBase< OtherDerived > &  other)
inherited
643{
644 call_assignment(derived(), other.derived(), internal::add_assign_op<Scalar,typename OtherDerived::Scalar>());
645 return derived();
646}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_assignment(Dst &dst, const Src &src)
Definition AssignEvaluator.h:780

◆ operator+=() [3/4]

EIGEN_STRONG_INLINE SparseView< MatrixType > & Eigen::SparseMatrixBase< SparseView< MatrixType > >::operator+= ( const SparseMatrixBase< OtherDerived > &  other)
inherited
668{
669 return derived() = derived() + other.derived();
670}

◆ operator+=() [4/4]

SparseView< MatrixType > & Eigen::SparseMatrixBase< SparseView< MatrixType > >::operator+= ( const SparseMatrixBase< OtherDerived > &  other)
inherited

◆ operator-=() [1/4]

SparseView< MatrixType > & Eigen::SparseMatrixBase< SparseView< MatrixType > >::operator-= ( const DiagonalBase< OtherDerived > &  other)
inherited
683{
684 call_assignment_no_alias(derived(), other.derived(), internal::sub_assign_op<Scalar,typename OtherDerived::Scalar>());
685 return derived();
686}

◆ operator-=() [2/4]

SparseView< MatrixType > & Eigen::SparseMatrixBase< SparseView< MatrixType > >::operator-= ( const EigenBase< OtherDerived > &  other)
inherited
651{
652 call_assignment(derived(), other.derived(), internal::assign_op<Scalar,typename OtherDerived::Scalar>());
653 return derived();
654}

◆ operator-=() [3/4]

EIGEN_STRONG_INLINE SparseView< MatrixType > & Eigen::SparseMatrixBase< SparseView< MatrixType > >::operator-= ( const SparseMatrixBase< OtherDerived > &  other)
inherited
660{
661 return derived() = derived() - other.derived();
662}

◆ operator-=() [4/4]

SparseView< MatrixType > & Eigen::SparseMatrixBase< SparseView< MatrixType > >::operator-= ( const SparseMatrixBase< OtherDerived > &  other)
inherited

◆ operator/=()

EIGEN_STRONG_INLINE SparseView< MatrixType > & Eigen::SparseMatrixBase< SparseView< MatrixType > >::operator/= ( const Scalar other)
inherited
137{
138 typedef typename internal::evaluator<Derived>::InnerIterator EvalIterator;
139 internal::evaluator<Derived> thisEval(derived());
140 for (Index j=0; j<outerSize(); ++j)
141 for (EvalIterator i(thisEval,j); i; ++i)
142 i.valueRef() /= other;
143 return derived();
144}

◆ outerSize()

template<typename MatrixType >
Index Eigen::SparseView< MatrixType >::outerSize ( ) const
inline
62{ return m_matrix.outerSize(); }

References Eigen::SparseView< MatrixType >::m_matrix.

◆ pruned()

const SparseView< SparseView< MatrixType > > Eigen::SparseMatrixBase< SparseView< MatrixType > >::pruned ( const Scalar reference = Scalar(0),
const RealScalar epsilon = NumTraits<Scalar>::dummy_precision() 
) const
inlineinherited
Returns
an expression of *this with values smaller than reference * epsilon removed.

This method is typically used in conjunction with the product of two sparse matrices to automatically prune the smallest values as follows:

C = (A*B).pruned(); // suppress numerical zeros (exact)
C = (A*B).pruned(ref);
C = (A*B).pruned(ref,epsilon);

where ref is a meaningful non zero reference value.

247{
248 return SparseView<Derived>(derived(), reference, epsilon);
249}

◆ reference()

template<typename MatrixType >
Scalar Eigen::SparseView< MatrixType >::reference ( ) const
inline
68{ return m_reference; }

References Eigen::SparseView< MatrixType >::m_reference.

Referenced by Eigen::internal::unary_evaluator< SparseView< Product< Lhs, Rhs, Options > >, IteratorBased >::unary_evaluator(), and Eigen::internal::unary_evaluator< SparseView< ArgType >, IteratorBased >::InnerIterator::incrementToNonZero().

+ Here is the caller graph for this function:

◆ rows()

template<typename MatrixType >
Index Eigen::SparseView< MatrixType >::rows ( ) const
inline
58{ return m_matrix.rows(); }

References Eigen::SparseView< MatrixType >::m_matrix.

◆ selfadjointView() [1/4]

SelfAdjointViewReturnType< UpLo >::Type Eigen::SparseMatrixBase< SparseView< MatrixType > >::selfadjointView ( )
inlineinherited

◆ selfadjointView() [2/4]

SparseMatrixBase< SparseView< MatrixType > >::template SelfAdjointViewReturnType< UpLo >::Type Eigen::SparseMatrixBase< SparseView< MatrixType > >::selfadjointView ( )
inherited
183{
184 return SparseSelfAdjointView<Derived, UpLo>(derived());
185}

◆ selfadjointView() [3/4]

ConstSelfAdjointViewReturnType< UpLo >::Type Eigen::SparseMatrixBase< SparseView< MatrixType > >::selfadjointView ( ) const
inlineinherited

◆ selfadjointView() [4/4]

SparseMatrixBase< SparseView< MatrixType > >::template ConstSelfAdjointViewReturnType< UpLo >::Type Eigen::SparseMatrixBase< SparseView< MatrixType > >::selfadjointView ( ) const
inherited
176{
177 return SparseSelfAdjointView<const Derived, UpLo>(derived());
178}

◆ size()

Index Eigen::SparseMatrixBase< SparseView< MatrixType > >::size ( ) const
inlineinherited
Returns
the number of coefficients, which is rows()*cols().
See also
rows(), cols().
176{ return rows() * cols(); }

◆ squaredNorm()

NumTraits< typenameinternal::traits< SparseView< MatrixType > >::Scalar >::Real Eigen::SparseMatrixBase< SparseView< MatrixType > >::squaredNorm
inlineinherited
78{
79 return numext::real((*this).cwiseAbs2().sum());
80}

◆ subTo()

template<typename Derived >
template<typename Dest >
EIGEN_DEVICE_FUNC void Eigen::EigenBase< Derived >::subTo ( Dest &  dst) const
inlineinherited
90 {
91 // This is the default implementation,
92 // derived class can reimplement it in a more optimized way.
93 typename Dest::PlainObject res(rows(),cols());
94 evalTo(res);
95 dst -= res;
96 }

References Eigen::EigenBase< Derived >::cols(), Eigen::EigenBase< Derived >::evalTo(), and Eigen::EigenBase< Derived >::rows().

+ Here is the call graph for this function:

◆ sum()

internal::traits< SparseView< MatrixType > >::Scalar Eigen::SparseMatrixBase< SparseView< MatrixType > >::sum
inherited
18{
19 eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix");
20 Scalar res(0);
21 internal::evaluator<Derived> thisEval(derived());
22 for (Index j=0; j<outerSize(); ++j)
23 for (typename internal::evaluator<Derived>::InnerIterator iter(thisEval,j); iter; ++iter)
24 res += iter.value();
25 return res;
26}

◆ toDense()

DenseMatrixType Eigen::SparseMatrixBase< SparseView< MatrixType > >::toDense ( ) const
inlineinherited
366 {
367 return DenseMatrixType(derived());
368 }
Matrix< Scalar, RowsAtCompileTime, ColsAtCompileTime > DenseMatrixType
Definition SparseMatrixBase.h:133

◆ transpose() [1/2]

TransposeReturnType Eigen::SparseMatrixBase< SparseView< MatrixType > >::transpose ( )
inlineinherited
349{ return TransposeReturnType(derived()); }
Transpose< SparseView< MatrixType > > TransposeReturnType
Definition SparseMatrixBase.h:110

◆ transpose() [2/2]

const ConstTransposeReturnType Eigen::SparseMatrixBase< SparseView< MatrixType > >::transpose ( ) const
inlineinherited
internal::add_const< Transpose< constDerived > >::type ConstTransposeReturnType
Definition SparseMatrixBase.h:111

◆ triangularView()

const TriangularView< const SparseView< MatrixType > , Mode > Eigen::SparseMatrixBase< SparseView< MatrixType > >::triangularView
inlineinherited
183{
184 return TriangularView<const Derived, Mode>(derived());
185}

◆ twistedBy()

SparseSymmetricPermutationProduct< SparseView< MatrixType > , Upper|Lower > Eigen::SparseMatrixBase< SparseView< MatrixType > >::twistedBy ( const PermutationMatrix< Dynamic, Dynamic, StorageIndex > &  perm) const
inlineinherited
Returns
an expression of P H P^-1 where H is the matrix represented by *this
325 {
326 return SparseSymmetricPermutationProduct<Derived,Upper|Lower>(derived(), perm);
327 }

Member Data Documentation

◆ m_epsilon

template<typename MatrixType >
RealScalar Eigen::SparseView< MatrixType >::m_epsilon
protected

◆ m_isRValue

bool Eigen::SparseMatrixBase< SparseView< MatrixType > >::m_isRValue
protectedinherited

◆ m_matrix

◆ m_reference

template<typename MatrixType >
Scalar Eigen::SparseView< MatrixType >::m_reference
protected

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