10#ifndef EIGEN_SPARSEMATRIXBASE_H
11#define EIGEN_SPARSEMATRIXBASE_H
54 template<
typename OtherDerived>
105 #ifndef EIGEN_PARSED_BY_DOXYGEN
121#ifndef EIGEN_PARSED_BY_DOXYGEN
143 inline const Derived&
derived()
const {
return *
static_cast<const Derived*
>(
this); }
144 inline Derived&
derived() {
return *
static_cast<Derived*
>(
this); }
152#define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::SparseMatrixBase
153#ifdef EIGEN_PARSED_BY_DOXYGEN
154#define EIGEN_DOC_UNARY_ADDONS(METHOD,OP)
155#define EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
156#define EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(COND)
158#define EIGEN_DOC_UNARY_ADDONS(X,Y)
159#define EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
160#define EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(COND)
162# include "../plugins/CommonCwiseUnaryOps.h"
163# include "../plugins/CommonCwiseBinaryOps.h"
164# include "../plugins/MatrixCwiseUnaryOps.h"
165# include "../plugins/MatrixCwiseBinaryOps.h"
166# include "../plugins/BlockMethods.h"
167# ifdef EIGEN_SPARSEMATRIXBASE_PLUGIN
168# include EIGEN_SPARSEMATRIXBASE_PLUGIN
170#undef EIGEN_CURRENT_STORAGE_BASE_CLASS
171#undef EIGEN_DOC_UNARY_ADDONS
172#undef EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
173#undef EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF
200 template<
typename OtherDerived>
203 template<
typename OtherDerived>
206 inline Derived&
operator=(
const Derived& other);
210 template<
typename OtherDerived>
211 inline Derived&
assign(
const OtherDerived& other);
213 template<
typename OtherDerived>
220 typedef typename Derived::Nested Nested;
232 for ( ;
col<it.index(); ++
col)
234 s << it.value() <<
" ";
250 for ( ;
row<it.index(); ++
row)
251 s <<
"0" << std::endl;
252 s << it.value() << std::endl;
256 s <<
"0" << std::endl;
261 s << static_cast<const SparseMatrixBase<SparseMatrix<Scalar, RowMajorBit, StorageIndex> >&>(trans);
267 template<
typename OtherDerived>
269 template<
typename OtherDerived>
272 template<
typename OtherDerived>
274 template<
typename OtherDerived>
277 template<
typename OtherDerived>
279 template<
typename OtherDerived>
295 template<
typename OtherDerived>
300 template<
typename OtherDerived>
306 template<
typename OtherDerived>
friend
312 template<
typename OtherDerived>
317 template<
typename OtherDerived>
323 template<
typename OtherDerived>
friend
334 template<
typename OtherDerived>
343 template<
unsigned int UpLo>
inline
345 template<
unsigned int UpLo>
inline
363 template<
typename OtherDerived>
367 template<
typename OtherDerived>
370 {
return toDense().isApprox(other,prec); }
390 return internal::convert_index<StorageIndex>(idx);
393 template<
typename Dest>
void evalTo(Dest &)
const;
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_SIZE_MAX(a, b)
Definition: Macros.h:1320
#define EIGEN_STRONG_INLINE
Definition: Macros.h:927
Generic expression where a coefficient-wise binary operator is applied to two expressions.
Definition: CwiseBinaryOp.h:84
Generic expression of a matrix where all coefficients are defined by a functor.
Definition: CwiseNullaryOp.h:61
Generic expression where a coefficient-wise unary operator is applied to an expression.
Definition: CwiseUnaryOp.h:56
Definition: DiagonalMatrix.h:19
EIGEN_DEVICE_FUNC const Derived & derived() const
Definition: DiagonalMatrix.h:41
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:50
Expression of the product of two arbitrary matrices or vectors.
Definition: Product.h:75
Definition: ReturnByValue.h:52
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 Product< Derived, OtherDerived > operator*(const DiagonalBase< OtherDerived > &other) const
Definition: SparseMatrixBase.h:302
const Derived & derived() const
Definition: SparseMatrixBase.h:143
Index size() const
Definition: SparseMatrixBase.h:181
Index innerSize() const
Definition: SparseMatrixBase.h:192
Index rows() const
Definition: SparseMatrixBase.h:176
bool isRValue() const
Definition: SparseMatrixBase.h:194
Scalar dot(const SparseMatrixBase< OtherDerived > &other) const
const ConstTransposeReturnType transpose() const
Definition: SparseMatrixBase.h:355
internal::conditional< _HasDirectAccess, constScalar &, Scalar >::type CoeffReturnType
Definition: SparseMatrixBase.h:132
Derived & operator=(const EigenBase< OtherDerived > &other)
Definition: SparseAssign.h:17
SparseMatrixBase()
Definition: SparseMatrixBase.h:197
bool m_isRValue
Definition: SparseMatrixBase.h:387
internal::traits< Derived >::Scalar Scalar
Definition: SparseMatrixBase.h:31
Scalar dot(const MatrixBase< OtherDerived > &other) const
EigenBase< Derived > Base
Definition: SparseMatrixBase.h:148
void assignGeneric(const OtherDerived &other)
Derived & operator*=(const Scalar &other)
Definition: SparseCwiseUnaryOp.h:126
Transpose< Derived > TransposeReturnType
Definition: SparseMatrixBase.h:115
friend const Product< OtherDerived, Derived > operator*(const MatrixBase< OtherDerived > &lhs, const SparseMatrixBase &rhs)
Definition: SparseMatrixBase.h:325
Derived & operator*=(const SparseMatrixBase< OtherDerived > &other)
SelfAdjointViewReturnType< UpLo >::Type selfadjointView()
SparseMatrix< Scalar, Flags &RowMajorBit ? RowMajor :ColMajor, StorageIndex > PlainObject
Definition: SparseMatrixBase.h:119
@ _HasDirectAccess
Definition: SparseMatrixBase.h:106
@ InnerSizeAtCompileTime
Definition: SparseMatrixBase.h:102
@ IsVectorAtCompileTime
This is set to true if either the number of rows or the number of columns is known at compile-time to...
Definition: SparseMatrixBase.h:84
@ NumDimensions
This value is equal to Tensor::NumDimensions, i.e.
Definition: SparseMatrixBase.h:90
@ ColsAtCompileTime
The number of columns at compile-time.
Definition: SparseMatrixBase.h:65
@ Flags
This stores expression Flags flags which may or may not be inherited by new expressions constructed f...
Definition: SparseMatrixBase.h:95
@ RowsAtCompileTime
The number of rows at compile-time.
Definition: SparseMatrixBase.h:59
@ MaxColsAtCompileTime
Definition: SparseMatrixBase.h:79
@ MaxRowsAtCompileTime
Definition: SparseMatrixBase.h:78
@ MaxSizeAtCompileTime
Definition: SparseMatrixBase.h:81
@ SizeAtCompileTime
This is equal to the number of coefficients, i.e.
Definition: SparseMatrixBase.h:72
@ IsRowMajor
Definition: SparseMatrixBase.h:100
Derived & operator-=(const SparseMatrixBase< OtherDerived > &other)
internal::packet_traits< Scalar >::type PacketScalar
Definition: SparseMatrixBase.h:38
friend const Product< OtherDerived, Derived > operator*(const DiagonalBase< OtherDerived > &lhs, const SparseMatrixBase &rhs)
Definition: SparseMatrixBase.h:308
const TriangularView< const Derived, Mode > triangularView() const
Definition: SparseTriangularView.h:182
DenseMatrixType toDense() const
Definition: SparseMatrixBase.h:358
Derived & derived()
Definition: SparseMatrixBase.h:144
bool isApprox(const SparseMatrixBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: SparseFuzzy.h:17
Derived & assign(const OtherDerived &other)
internal::conditional< NumTraits< Scalar >::IsComplex, CwiseUnaryOp< internal::scalar_conjugate_op< Scalar >, Eigen::Transpose< constDerived > >, Transpose< constDerived > >::type AdjointReturnType
Definition: SparseMatrixBase.h:114
Derived & operator+=(const SparseMatrixBase< OtherDerived > &other)
Derived & const_cast_derived() const
Definition: SparseMatrixBase.h:145
ConstSelfAdjointViewReturnType< UpLo >::Type selfadjointView() const
bool isVector() const
Definition: SparseMatrixBase.h:186
Matrix< StorageIndex, Dynamic, 1 > IndexVector
Definition: SparseMatrixBase.h:51
CwiseNullaryOp< internal::scalar_constant_op< Scalar >, Matrix< Scalar, Dynamic, Dynamic > > ConstantReturnType
Definition: SparseMatrixBase.h:135
internal::traits< Derived >::StorageKind StorageKind
Definition: SparseMatrixBase.h:39
RealScalar squaredNorm() const
Definition: SparseDot.h:77
Matrix< Scalar, EIGEN_SIZE_MAX(RowsAtCompileTime, ColsAtCompileTime), EIGEN_SIZE_MAX(RowsAtCompileTime, ColsAtCompileTime)> SquareMatrixType
type of the equivalent square matrix
Definition: SparseMatrixBase.h:141
bool isApprox(const MatrixBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: SparseMatrixBase.h:368
SparseMatrixBase StorageBaseType
Definition: SparseMatrixBase.h:49
NumTraits< Scalar >::Real RealScalar
This is the "real scalar" type; if the Scalar type is already real numbers (e.g.
Definition: SparseMatrixBase.h:128
EIGEN_STRONG_INLINE const CwiseProductDenseReturnType< OtherDerived >::Type cwiseProduct(const MatrixBase< OtherDerived > &other) const
TransposeReturnType transpose()
Definition: SparseMatrixBase.h:354
Scalar value_type
The numeric type of the expression' coefficients, e.g.
Definition: SparseMatrixBase.h:36
RealScalar blueNorm() const
Definition: SparseDot.h:92
Index outerSize() const
Definition: SparseMatrixBase.h:189
const SparseView< Derived > pruned(const Scalar &reference=Scalar(0), const RealScalar &epsilon=NumTraits< Scalar >::dummy_precision()) const
Definition: SparseView.h:246
Index cols() const
Definition: SparseMatrixBase.h:178
Matrix< Scalar, RowsAtCompileTime, ColsAtCompileTime > DenseMatrixType
type of the equivalent dense matrix
Definition: SparseMatrixBase.h:138
internal::add_const< Transpose< constDerived > >::type ConstTransposeReturnType
Definition: SparseMatrixBase.h:116
internal::add_const_on_value_type_if_arithmetic< typenameinternal::packet_traits< Scalar >::type >::type PacketReturnType
Definition: SparseMatrixBase.h:47
SparseSymmetricPermutationProduct< Derived, Upper|Lower > twistedBy(const PermutationMatrix< Dynamic, Dynamic, StorageIndex > &perm) const
Definition: SparseMatrixBase.h:329
const AdjointReturnType adjoint() const
Definition: SparseMatrixBase.h:356
Derived & operator/=(const Scalar &other)
Definition: SparseCwiseUnaryOp.h:138
const internal::eval< Derived >::type eval() const
Definition: SparseMatrixBase.h:377
RealScalar norm() const
Definition: SparseDot.h:84
const Product< Derived, OtherDerived > operator*(const MatrixBase< OtherDerived > &other) const
Definition: SparseMatrixBase.h:319
Scalar sum() const
Definition: SparseRedux.h:17
Matrix< Scalar, Dynamic, 1 > ScalarVector
Definition: SparseMatrixBase.h:52
static StorageIndex convert_index(const Index idx)
Definition: SparseMatrixBase.h:389
Derived & markAsRValue()
Definition: SparseMatrixBase.h:195
friend std::ostream & operator<<(std::ostream &s, const SparseMatrixBase &m)
Definition: SparseMatrixBase.h:218
A versatible sparse matrix representation.
Definition: SparseMatrix.h:98
Pseudo expression to manipulate a triangular sparse matrix as a selfadjoint matrix.
Definition: SparseSelfAdjointView.h:45
Definition: SparseSelfAdjointView.h:601
Expression of a dense or sparse matrix with zero or too small values removed.
Definition: SparseView.h:46
Expression of the transpose of a matrix.
Definition: Transpose.h:54
Expression of a triangular part in a matrix.
Definition: TriangularMatrix.h:189
type
Definition: core.h:575
const unsigned int DirectAccessBit
Means that the underlying array of coefficients can be directly accessed as a plain strided array.
Definition: Constants.h:155
const unsigned int RowMajorBit
for a matrix, this means that the storage order is row-major.
Definition: Constants.h:66
Namespace containing all symbols from the Eigen library.
Definition: Core:141
Common base class for all classes T such that MatrixBase has an operator=(T) and a constructor Matrix...
Definition: EigenBase.h:30
Eigen::Index Index
The interface type of indices.
Definition: EigenBase.h:39
Holds information about the various numeric (i.e.
Definition: NumTraits.h:233
Determines whether the given binary operation of two numeric types is allowed and what the scalar ret...
Definition: XprHelper.h:806
Definition: SparseMatrixBase.h:341
const SparseSelfAdjointView< const Derived, UpLo > Type
Definition: SparseMatrixBase.h:341
Definition: SparseMatrixBase.h:285
CwiseBinaryOp< internal::scalar_product_op< typename ScalarBinaryOpTraits< typename internal::traits< Derived >::Scalar, typename internal::traits< OtherDerived >::Scalar >::ReturnType >, const Derived, const OtherDerived > Type
Definition: SparseMatrixBase.h:292
Definition: SparseMatrixBase.h:340
SparseSelfAdjointView< Derived, UpLo > Type
Definition: SparseMatrixBase.h:340
Definition: DenseCoeffsBase.h:17
Definition: XprHelper.h:332
Definition: CoreEvaluators.h:91
T type
Definition: GenericPacketMath.h:108
T type
Definition: Meta.h:126
Definition: BinaryFunctors.h:71
Definition: XprHelper.h:282
Definition: ForwardDeclarations.h:17