10 #ifndef EIGEN_SPARSEMATRIXBASE_H
11 #define EIGEN_SPARSEMATRIXBASE_H
29 template <
typename Derived>
54 template <
typename OtherDerived>
105 #ifndef EIGEN_PARSED_BY_DOXYGEN
121 #ifndef EIGEN_PARSED_BY_DOXYGEN
144 inline const Derived&
derived()
const {
return *
static_cast<const Derived*
>(
this); }
145 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, \
157 #define EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
160 #define EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF( \
164 #define EIGEN_DOC_UNARY_ADDONS(X, Y)
165 #define EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
166 #define EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(COND)
168 #include "../plugins/CommonCwiseUnaryOps.inc"
169 #include "../plugins/CommonCwiseBinaryOps.inc"
170 #include "../plugins/MatrixCwiseUnaryOps.inc"
171 #include "../plugins/MatrixCwiseBinaryOps.inc"
172 #include "../plugins/BlockMethods.inc"
173 #ifdef EIGEN_SPARSEMATRIXBASE_PLUGIN
174 #include EIGEN_SPARSEMATRIXBASE_PLUGIN
176 #undef EIGEN_CURRENT_STORAGE_BASE_CLASS
177 #undef EIGEN_DOC_UNARY_ADDONS
178 #undef EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL
179 #undef EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF
209 template <
typename OtherDerived>
212 template <
typename OtherDerived>
215 inline Derived&
operator=(
const Derived& other);
218 template <
typename OtherDerived>
219 inline Derived&
assign(
const OtherDerived& other);
221 template <
typename OtherDerived>
227 typedef typename Derived::Nested Nested;
231 Nested nm(
m.derived());
236 for (;
col < it.index(); ++
col)
s <<
"0 ";
237 s << it.value() <<
" ";
240 for (;
col <
m.cols(); ++
col)
s <<
"0 ";
244 Nested nm(
m.derived());
249 for (;
row < it.index(); ++
row)
s <<
"0" << std::endl;
250 s << it.value() << std::endl;
253 for (;
row <
m.rows(); ++
row)
s <<
"0" << std::endl;
256 s << static_cast<const SparseMatrixBase<SparseMatrix<Scalar, RowMajorBit, StorageIndex> >&>(
trans);
263 template <
typename OtherDerived>
265 template <
typename OtherDerived>
268 template <
typename OtherDerived>
270 template <
typename OtherDerived>
273 template <
typename OtherDerived>
275 template <
typename OtherDerived>
281 template <
typename OtherDerived>
286 const Derived,
const OtherDerived>
290 template <
typename OtherDerived>
295 template <
typename OtherDerived>
301 template <
typename OtherDerived>
308 template <
typename OtherDerived>
312 template <
typename OtherDerived>
318 template <
typename OtherDerived>
330 template <
typename OtherDerived>
336 template <
unsigned int UpLo>
340 template <
unsigned int UpLo>
345 template <
unsigned int UpLo>
347 template <
unsigned int UpLo>
350 template <
typename OtherDerived>
352 template <
typename OtherDerived>
364 template <
typename OtherDerived>
368 template <
typename OtherDerived>
371 return toDense().isApprox(other, prec);
394 template <
typename Dest>
#define EIGEN_STRONG_INLINE
Definition: Macros.h:834
SCALAR Scalar
Definition: bench_gemm.cpp:45
NumTraits< Scalar >::Real RealScalar
Definition: bench_gemm.cpp:46
Generic expression where a coefficient-wise binary operator is applied to two expressions.
Definition: CwiseBinaryOp.h:79
Generic expression of a matrix where all coefficients are defined by a functor.
Definition: CwiseNullaryOp.h:64
Generic expression where a coefficient-wise unary operator is applied to an expression.
Definition: CwiseUnaryOp.h:53
Base class for diagonal matrices and expressions.
Definition: DiagonalMatrix.h:33
EIGEN_DEVICE_FUNC const Derived & derived() const
Definition: DiagonalMatrix.h:57
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:52
Expression of the product of two arbitrary matrices or vectors.
Definition: Product.h:202
Definition: ReturnByValue.h:50
Base class of any sparse matrices or sparse expressions.
Definition: SparseMatrixBase.h:30
Matrix< Scalar, Dynamic, 1 > ScalarVector
Definition: SparseMatrixBase.h:52
internal::traits< Derived >::StorageIndex StorageIndex
Definition: SparseMatrixBase.h:44
const Product< Derived, OtherDerived > operator*(const DiagonalBase< OtherDerived > &other) const
Definition: SparseMatrixBase.h:296
Index size() const
Definition: SparseMatrixBase.h:187
Index innerSize() const
Definition: SparseMatrixBase.h:198
Index rows() const
Definition: SparseMatrixBase.h:182
const Product< Derived, OtherDerived > operator*(const MatrixBase< OtherDerived > &other) const
Definition: SparseMatrixBase.h:313
bool isRValue() const
Definition: SparseMatrixBase.h:200
RealScalar blueNorm() const
Definition: SparseDot.h:94
Scalar dot(const SparseMatrixBase< OtherDerived > &other) const
void evalTo(Dest &) const
const ConstTransposeReturnType transpose() const
Definition: SparseMatrixBase.h:359
friend std::ostream & operator<<(std::ostream &s, const SparseMatrixBase &m)
Definition: SparseMatrixBase.h:226
Derived & const_cast_derived() const
Definition: SparseMatrixBase.h:146
Derived & operator=(const EigenBase< OtherDerived > &other)
Definition: SparseAssign.h:20
SparseMatrixBase()
Definition: SparseMatrixBase.h:206
bool m_isRValue
Definition: SparseMatrixBase.h:389
CwiseNullaryOp< internal::scalar_constant_op< Scalar >, Matrix< Scalar, Dynamic, Dynamic > > ConstantReturnType
Definition: SparseMatrixBase.h:135
internal::traits< Derived >::Scalar Scalar
Definition: SparseMatrixBase.h:32
Derived & operator-=(const SparseMatrixBase< OtherDerived > &other)
Derived & operator+=(const SparseMatrixBase< OtherDerived > &other)
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:123
Transpose< Derived > TransposeReturnType
Definition: SparseMatrixBase.h:115
std::conditional_t< NumTraits< Scalar >::IsComplex, CwiseUnaryOp< internal::scalar_conjugate_op< Scalar >, Eigen::Transpose< const Derived > >, Transpose< const Derived > > AdjointReturnType
Definition: SparseMatrixBase.h:114
RealScalar squaredNorm() const
Definition: SparseDot.h:82
internal::packet_traits< Scalar >::type PacketScalar
Definition: SparseMatrixBase.h:39
friend const Product< OtherDerived, Derived > operator*(const MatrixBase< OtherDerived > &lhs, const SparseMatrixBase &rhs)
Definition: SparseMatrixBase.h:319
const TriangularView< const Derived, Mode > triangularView() const
Definition: SparseTriangularView.h:171
DenseMatrixType toDense() const
Definition: SparseMatrixBase.h:362
bool isApprox(const SparseMatrixBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: SparseFuzzy.h:20
Transpose< const Derived > ConstTransposeReturnType
Definition: SparseMatrixBase.h:116
SparseSymmetricPermutationProduct< Derived, Upper|Lower > twistedBy(const PermutationMatrix< Dynamic, Dynamic, StorageIndex > &perm) const
Definition: SparseMatrixBase.h:325
const internal::eval< Derived >::type eval() const
Definition: SparseMatrixBase.h:379
bool isVector() const
Definition: SparseMatrixBase.h:192
Matrix< Scalar, internal::max_size_prefer_dynamic(RowsAtCompileTime, ColsAtCompileTime), internal::max_size_prefer_dynamic(RowsAtCompileTime, ColsAtCompileTime)> SquareMatrixType
Definition: SparseMatrixBase.h:142
internal::traits< Derived >::StorageKind StorageKind
Definition: SparseMatrixBase.h:40
Derived & markAsRValue()
Definition: SparseMatrixBase.h:201
EIGEN_STRONG_INLINE const CwiseProductDenseReturnType< OtherDerived >::Type cwiseProduct(const MatrixBase< OtherDerived > &other) const
SparseMatrix< Scalar, Flags &RowMajorBit ? RowMajor :ColMajor, StorageIndex > PlainObject
Definition: SparseMatrixBase.h:119
SelfAdjointViewReturnType< UpLo >::Type selfadjointView()
const Derived & derived() const
Definition: SparseMatrixBase.h:144
bool isApprox(const MatrixBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: SparseMatrixBase.h:369
Derived & assign(const OtherDerived &other)
std::conditional_t< HasDirectAccess_, const Scalar &, Scalar > CoeffReturnType
Definition: SparseMatrixBase.h:132
SparseMatrixBase StorageBaseType
Definition: SparseMatrixBase.h:49
RealScalar norm() const
Definition: SparseDot.h:88
NumTraits< Scalar >::Real RealScalar
Definition: SparseMatrixBase.h:128
Derived & operator*=(const SparseMatrixBase< OtherDerived > &other)
internal::add_const_on_value_type_if_arithmetic< typename internal::packet_traits< Scalar >::type >::type PacketReturnType
Definition: SparseMatrixBase.h:47
TransposeReturnType transpose()
Definition: SparseMatrixBase.h:358
ConstSelfAdjointViewReturnType< UpLo >::Type selfadjointView() const
Scalar value_type
Definition: SparseMatrixBase.h:37
Index outerSize() const
Definition: SparseMatrixBase.h:195
const SparseView< Derived > pruned(const Scalar &reference=Scalar(0), const RealScalar &epsilon=NumTraits< Scalar >::dummy_precision()) const
Definition: SparseView.h:219
Index cols() const
Definition: SparseMatrixBase.h:184
const AdjointReturnType adjoint() const
Definition: SparseMatrixBase.h:360
Derived & operator/=(const Scalar &other)
Definition: SparseCwiseUnaryOp.h:132
@ InnerSizeAtCompileTime
Definition: SparseMatrixBase.h:101
@ IsVectorAtCompileTime
Definition: SparseMatrixBase.h:81
@ NumDimensions
Definition: SparseMatrixBase.h:87
@ ColsAtCompileTime
Definition: SparseMatrixBase.h:65
@ RowsAtCompileTime
Definition: SparseMatrixBase.h:59
@ MaxColsAtCompileTime
Definition: SparseMatrixBase.h:77
@ MaxRowsAtCompileTime
Definition: SparseMatrixBase.h:76
@ MaxSizeAtCompileTime
Definition: SparseMatrixBase.h:79
@ SizeAtCompileTime
Definition: SparseMatrixBase.h:71
@ HasDirectAccess_
Definition: SparseMatrixBase.h:106
@ IsRowMajor
Definition: SparseMatrixBase.h:99
Derived & derived()
Definition: SparseMatrixBase.h:145
Matrix< Scalar, RowsAtCompileTime, ColsAtCompileTime > DenseMatrixType
Definition: SparseMatrixBase.h:138
Matrix< StorageIndex, Dynamic, 1 > IndexVector
Definition: SparseMatrixBase.h:51
Scalar sum() const
Definition: SparseRedux.h:19
static StorageIndex convert_index(const Index idx)
Definition: SparseMatrixBase.h:391
friend const Product< OtherDerived, Derived > operator*(const DiagonalBase< OtherDerived > &lhs, const SparseMatrixBase &rhs)
Definition: SparseMatrixBase.h:302
A versatible sparse matrix representation.
Definition: SparseMatrix.h:121
Pseudo expression to manipulate a triangular sparse matrix as a selfadjoint matrix.
Definition: SparseSelfAdjointView.h:52
Definition: SparseSelfAdjointView.h:556
Expression of a dense or sparse matrix with zero or too small values removed.
Definition: SparseView.h:45
Expression of the transpose of a matrix.
Definition: Transpose.h:56
Expression of a triangular part in a matrix.
Definition: TriangularMatrix.h:167
@ IsComplex
Definition: common.h:73
const unsigned int DirectAccessBit
Definition: Constants.h:159
const unsigned int RowMajorBit
Definition: Constants.h:70
RealScalar s
Definition: level1_cplx_impl.h:130
int * m
Definition: level2_cplx_impl.h:294
char * trans
Definition: level2_impl.h:240
constexpr int size_at_compile_time(int rows, int cols)
Definition: XprHelper.h:373
typename remove_all< T >::type remove_all_t
Definition: Meta.h:142
constexpr int max_size_prefer_dynamic(A a, B b)
Definition: Meta.h:695
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
Extend namespace for flags.
Definition: fsi_chan_precond_driver.cc:56
type
Definition: compute_granudrum_aor.py:141
double epsilon
Definition: osc_ring_sarah_asymptotics.h:43
Definition: EigenBase.h:33
Eigen::Index Index
The interface type of indices.
Definition: EigenBase.h:43
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:217
Determines whether the given binary operation of two numeric types is allowed and what the scalar ret...
Definition: XprHelper.h:1043
Definition: SparseMatrixBase.h:341
const SparseSelfAdjointView< const Derived, UpLo > Type
Definition: SparseMatrixBase.h:342
Definition: SparseMatrixBase.h:282
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:287
Definition: SparseMatrixBase.h:337
SparseSelfAdjointView< Derived, UpLo > Type
Definition: SparseMatrixBase.h:338
Definition: DenseCoeffsBase.h:20
Definition: XprHelper.h:427
Definition: CoreEvaluators.h:104
Template functor to compute the product of two scalars.
Definition: BinaryFunctors.h:73
Definition: XprHelper.h:380
Definition: ForwardDeclarations.h:21