10 #ifndef EIGEN_SPARSEMATRIXBASE_H 11 #define EIGEN_SPARSEMATRIXBASE_H 26 template<
typename Derived>
class SparseMatrixBase
50 template<
typename OtherDerived>
78 MaxColsAtCompileTime>::ret),
96 #ifndef EIGEN_PARSED_BY_DOXYGEN
112 #ifndef EIGEN_PARSED_BY_DOXYGEN 134 inline const Derived& derived()
const {
return *
static_cast<const Derived*
>(
this); }
135 inline Derived& derived() {
return *
static_cast<Derived*
>(
this); }
136 inline Derived& const_cast_derived()
const 141 #endif // not EIGEN_PARSED_BY_DOXYGEN 143 #define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::SparseMatrixBase 144 #ifdef EIGEN_PARSED_BY_DOXYGEN 145 #define EIGEN_DOC_UNARY_ADDONS(METHOD,OP) 146 #define EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL 147 #define EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(COND) 149 #define EIGEN_DOC_UNARY_ADDONS(X,Y) 150 #define EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL 151 #define EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(COND) 153 # include "../plugins/CommonCwiseUnaryOps.h" 154 # include "../plugins/CommonCwiseBinaryOps.h" 155 # include "../plugins/MatrixCwiseUnaryOps.h" 156 # include "../plugins/MatrixCwiseBinaryOps.h" 157 # include "../plugins/BlockMethods.h" 158 # ifdef EIGEN_SPARSEMATRIXBASE_PLUGIN 159 # include EIGEN_SPARSEMATRIXBASE_PLUGIN 161 #undef EIGEN_CURRENT_STORAGE_BASE_CLASS 162 #undef EIGEN_DOC_UNARY_ADDONS 163 #undef EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL 164 #undef EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF 185 bool isRValue()
const {
return m_isRValue; }
186 Derived& markAsRValue() { m_isRValue =
true;
return derived(); }
191 template<
typename OtherDerived>
194 template<
typename OtherDerived>
197 inline Derived& operator=(
const Derived& other);
201 template<
typename OtherDerived>
202 inline Derived& assign(
const OtherDerived& other);
204 template<
typename OtherDerived>
205 inline void assignGeneric(
const OtherDerived& other);
209 friend std::ostream & operator << (std::ostream & s,
const SparseMatrixBase& m)
211 typedef typename Derived::Nested Nested;
216 const Nested nm(m.derived());
223 for ( ; col<it.index(); ++
col)
225 s << it.value() <<
" ";
235 const Nested nm(m.derived());
241 for ( ; row<it.index(); ++
row)
242 s <<
"0" << std::endl;
243 s << it.value() << std::endl;
247 s <<
"0" << std::endl;
252 s << static_cast<const SparseMatrixBase<SparseMatrix<Scalar, RowMajorBit, StorageIndex> >&>(trans);
258 template<
typename OtherDerived>
260 template<
typename OtherDerived>
263 template<
typename OtherDerived>
265 template<
typename OtherDerived>
268 Derived& operator*=(
const Scalar& other);
269 Derived& operator/=(
const Scalar& other);
271 template<
typename OtherDerived>
struct CwiseProductDenseReturnType {
281 template<
typename OtherDerived>
282 EIGEN_STRONG_INLINE
const typename CwiseProductDenseReturnType<OtherDerived>::Type
286 template<
typename OtherDerived>
292 template<
typename OtherDerived>
friend 298 template<
typename OtherDerived>
303 template<
typename OtherDerived>
309 template<
typename OtherDerived>
friend 320 template<
typename OtherDerived>
329 template<
unsigned int UpLo>
inline 330 typename ConstSelfAdjointViewReturnType<UpLo>::Type selfadjointView()
const;
331 template<
unsigned int UpLo>
inline 332 typename SelfAdjointViewReturnType<UpLo>::Type selfadjointView();
336 RealScalar squaredNorm()
const;
337 RealScalar norm()
const;
338 RealScalar blueNorm()
const;
340 TransposeReturnType transpose() {
return TransposeReturnType(derived()); }
341 const ConstTransposeReturnType transpose()
const {
return ConstTransposeReturnType(derived()); }
342 const AdjointReturnType adjoint()
const {
return AdjointReturnType(transpose()); }
356 DenseMatrixType toDense()
const 361 template<
typename OtherDerived>
365 template<
typename OtherDerived>
368 {
return toDense().isApprox(other,prec); }
387 static inline StorageIndex convert_index(
const Index idx) {
388 return internal::convert_index<StorageIndex>(idx);
391 template<
typename Dest>
void evalTo(Dest &)
const;
396 #endif // EIGEN_SPARSEMATRIXBASE_H Generic expression of a matrix where all coefficients are defined by a functor.
Definition: CwiseNullaryOp.h:60
Index innerSize() const
Definition: SparseMatrixBase.h:183
Index cols() const
Definition: SparseMatrixBase.h:169
Expression of the product of two arbitrary matrices or vectors.
Definition: Product.h:71
A versatible sparse matrix representation.
Definition: SparseMatrix.h:92
Definition: SparseSelfAdjointView.h:566
Expression of the transpose of a matrix.
Definition: Transpose.h:52
const unsigned int DirectAccessBit
Means that the underlying array of coefficients can be directly accessed as a plain strided array...
Definition: Constants.h:150
Definition: CoreEvaluators.h:90
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:85
Pseudo expression to manipulate a triangular sparse matrix as a selfadjoint matrix.
Definition: SparseSelfAdjointView.h:43
Holds information about the various numeric (i.e.
Definition: NumTraits.h:150
Index outerSize() const
Definition: SparseMatrixBase.h:180
EIGEN_DEVICE_FUNC RowXpr row(Index i)
Definition: SparseMatrixBase.h:860
Eigen::Index Index
The interface type of indices.
Definition: EigenBase.h:37
const unsigned int RowMajorBit
for a matrix, this means that the storage order is row-major.
Definition: Constants.h:61
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:80
bool isVector() const
Definition: SparseMatrixBase.h:177
Definition: DenseCoeffsBase.h:16
Common base class for all classes T such that MatrixBase has an operator=(T) and a constructor Matrix...
Definition: EigenBase.h:28
Definition: ReturnByValue.h:50
Index size() const
Definition: SparseMatrixBase.h:172
const SparseView< Derived > pruned(const Scalar &reference=Scalar(0), const RealScalar &epsilon=NumTraits< Scalar >::dummy_precision()) const
Definition: SparseView.h:214
Definition: BinaryFunctors.h:76
Generic expression where a coefficient-wise binary operator is applied to two expressions.
Definition: CwiseBinaryOp.h:77
Index rows() const
Definition: SparseMatrixBase.h:167
Base class of any sparse matrices or sparse expressions.
Definition: ForwardDeclarations.h:281
The number of rows at compile-time.
Definition: SparseMatrixBase.h:55
This stores expression Flags flags which may or may not be inherited by new expressions constructed f...
Definition: SparseMatrixBase.h:86
Matrix< Scalar, RowsAtCompileTime, ColsAtCompileTime > DenseMatrixType
type of the equivalent dense matrix
Definition: SparseMatrixBase.h:129
InnerVectorReturnType innerVector(Index outer)
Definition: SparseBlock.h:333
Definition: ForwardDeclarations.h:126
EIGEN_DEVICE_FUNC ColXpr col(Index i)
Definition: SparseMatrixBase.h:839
Scalar value_type
The numeric type of the expression' coefficients, e.g.
Definition: SparseMatrixBase.h:36
InnerVectorsReturnType innerVectors(Index outerStart, Index outerSize)
Definition: SparseBlock.h:348
Expression of a fixed-size or dynamic-size block.
Definition: Block.h:103
Definition: SparseMatrixBase.h:326
Definition: DiagonalMatrix.h:18
Expression of a triangular part in a matrix.
Definition: TriangularMatrix.h:186
SparseSymmetricPermutationProduct< Derived, Upper|Lower > twistedBy(const PermutationMatrix< Dynamic, Dynamic, StorageIndex > &perm) const
Definition: SparseMatrixBase.h:315
Matrix< Scalar, EIGEN_SIZE_MAX(RowsAtCompileTime, ColsAtCompileTime), EIGEN_SIZE_MAX(RowsAtCompileTime, ColsAtCompileTime)> SquareMatrixType
type of the equivalent square matrix
Definition: SparseMatrixBase.h:132
Definition: SparseMatrixBase.h:327
Determines whether the given binary operation of two numeric types is allowed and what the scalar ret...
Definition: XprHelper.h:757
const internal::eval< Derived >::type eval() const
Definition: SparseMatrixBase.h:375
The number of columns at compile-time.
Definition: SparseMatrixBase.h:61
Generic expression where a coefficient-wise unary operator is applied to an expression.
Definition: CwiseUnaryOp.h:55
NumTraits< Scalar >::Real RealScalar
This is the "real scalar" type; if the Scalar type is already real numbers (e.g.
Definition: SparseMatrixBase.h:119
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:48
Definition: ForwardDeclarations.h:17
Definition: XprHelper.h:312
This is equal to the number of coefficients, i.e.
Definition: SparseMatrixBase.h:68
Definition: XprHelper.h:261