10 #ifndef EIGEN_SPARSEMATRIXBASE_H 11 #define EIGEN_SPARSEMATRIXBASE_H 26 template<
typename Derived>
class SparseMatrixBase
54 template<
typename OtherDerived>
100 #ifndef EIGEN_PARSED_BY_DOXYGEN
116 #ifndef EIGEN_PARSED_BY_DOXYGEN 138 inline const Derived&
derived()
const {
return *
static_cast<const Derived*
>(
this); }
139 inline Derived&
derived() {
return *
static_cast<Derived*
>(
this); }
145 #endif // not EIGEN_PARSED_BY_DOXYGEN 147 #define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::SparseMatrixBase 148 #ifdef EIGEN_PARSED_BY_DOXYGEN 149 #define EIGEN_DOC_UNARY_ADDONS(METHOD,OP) 150 #define EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL 151 #define EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(COND) 153 #define EIGEN_DOC_UNARY_ADDONS(X,Y) 154 #define EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL 155 #define EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(COND) 157 # include "../plugins/CommonCwiseUnaryOps.h" 158 # include "../plugins/CommonCwiseBinaryOps.h" 159 # include "../plugins/MatrixCwiseUnaryOps.h" 160 # include "../plugins/MatrixCwiseBinaryOps.h" 161 # include "../plugins/BlockMethods.h" 162 # ifdef EIGEN_SPARSEMATRIXBASE_PLUGIN 163 # include EIGEN_SPARSEMATRIXBASE_PLUGIN 165 #undef EIGEN_CURRENT_STORAGE_BASE_CLASS 166 #undef EIGEN_DOC_UNARY_ADDONS 167 #undef EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL 168 #undef EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF 195 template<
typename OtherDerived>
198 template<
typename OtherDerived>
201 inline Derived&
operator=(
const Derived& other);
205 template<
typename OtherDerived>
206 inline Derived&
assign(
const OtherDerived& other);
208 template<
typename OtherDerived>
215 typedef typename Derived::Nested Nested;
227 for ( ; col<it.index(); ++
col)
229 s << it.value() <<
" ";
245 for ( ; row<it.index(); ++
row)
246 s <<
"0" << std::endl;
247 s << it.value() << std::endl;
251 s <<
"0" << std::endl;
256 s << static_cast<const SparseMatrixBase<SparseMatrix<Scalar, RowMajorBit, StorageIndex> >&>(trans);
262 template<
typename OtherDerived>
264 template<
typename OtherDerived>
267 template<
typename OtherDerived>
269 template<
typename OtherDerived>
272 template<
typename OtherDerived>
274 template<
typename OtherDerived>
290 template<
typename OtherDerived>
295 template<
typename OtherDerived>
301 template<
typename OtherDerived>
friend 307 template<
typename OtherDerived>
312 template<
typename OtherDerived>
318 template<
typename OtherDerived>
friend 329 template<
typename OtherDerived>
338 template<
unsigned int UpLo>
inline 340 template<
unsigned int UpLo>
inline 346 RealScalar
norm()
const;
370 template<
typename OtherDerived>
374 template<
typename OtherDerived>
377 {
return toDense().isApprox(other,prec); }
397 return internal::convert_index<StorageIndex>(idx);
400 template<
typename Dest>
void evalTo(Dest &)
const;
405 #endif // EIGEN_SPARSEMATRIXBASE_H ConstSelfAdjointViewReturnType< UpLo >::Type selfadjointView() const
Generic expression of a matrix where all coefficients are defined by a functor.
RealScalar squaredNorm() const
EIGEN_DEVICE_FUNC const Derived & derived() const
#define EIGEN_STRONG_INLINE
const AdjointReturnType adjoint() const
Block< const Derived, IsRowMajor?1:Dynamic, IsRowMajor?Dynamic:1, true > ConstInnerVectorReturnType
friend std::ostream & operator<<(std::ostream &s, const SparseMatrixBase &m)
Block< const Derived, Dynamic, Dynamic, true > ConstInnerVectorsReturnType
internal::traits< Derived >::StorageKind StorageKind
SparseMatrixBase StorageBaseType
Expression of the product of two arbitrary matrices or vectors.
EIGEN_STRONG_INLINE const CwiseProductDenseReturnType< OtherDerived >::Type cwiseProduct(const MatrixBase< OtherDerived > &other) const
RealScalar blueNorm() const
A versatible sparse matrix representation.
internal::packet_traits< Scalar >::type PacketScalar
CwiseBinaryOp< internal::scalar_product_op< typename ScalarBinaryOpTraits< typename internal::traits< Derived >::Scalar, typename internal::traits< OtherDerived >::Scalar >::ReturnType >, const Derived, const OtherDerived > Type
Expression of the transpose of a matrix.
const unsigned int DirectAccessBit
CwiseNullaryOp< internal::scalar_constant_op< Scalar >, Matrix< Scalar, Dynamic, Dynamic > > ConstantReturnType
Derived & operator+=(const SparseMatrixBase< OtherDerived > &other)
Pseudo expression to manipulate a triangular sparse matrix as a selfadjoint matrix.
const TriangularView< const Derived, Mode > triangularView() const
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
Derived & operator=(const EigenBase< OtherDerived > &other)
Scalar dot(const MatrixBase< OtherDerived > &other) const
const SparseView< Derived > pruned(const Scalar &reference=Scalar(0), const RealScalar &epsilon=NumTraits< Scalar >::dummy_precision()) const
EIGEN_DEVICE_FUNC RowXpr row(Index i)
Eigen::Index Index
The interface type of indices.
Block< Derived, IsRowMajor?1:Dynamic, IsRowMajor?Dynamic:1, true > InnerVectorReturnType
const unsigned int RowMajorBit
Transpose< Derived > TransposeReturnType
internal::conditional< NumTraits< Scalar >::IsComplex, CwiseUnaryOp< internal::scalar_conjugate_op< Scalar >, Eigen::Transpose< const Derived > >, Transpose< const Derived > >::type AdjointReturnType
const Product< Derived, OtherDerived > operator*(const MatrixBase< OtherDerived > &other) const
static StorageIndex convert_index(const Index idx)
internal::traits< Derived >::StorageIndex StorageIndex
Generic expression where a coefficient-wise binary operator is applied to two expressions.
Base class of any sparse matrices or sparse expressions.
TransposeReturnType transpose()
internal::traits< Derived >::Scalar Scalar
const internal::eval< Derived >::type eval() const
SparseSelfAdjointView< Derived, UpLo > Type
Matrix< Scalar, RowsAtCompileTime, ColsAtCompileTime > DenseMatrixType
InnerVectorReturnType innerVector(Index outer)
Expression of a dense or sparse matrix with zero or too small values removed.
Derived & assign(const OtherDerived &other)
bool isApprox(const SparseMatrixBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
EIGEN_DEVICE_FUNC ColXpr col(Index i)
void evalTo(Dest &) const
const Product< Derived, OtherDerived > operator*(const DiagonalBase< OtherDerived > &other) const
SparseSymmetricPermutationProduct< Derived, Upper|Lower > twistedBy(const PermutationMatrix< Dynamic, Dynamic, StorageIndex > &perm) const
internal::add_const< Transpose< const Derived > >::type ConstTransposeReturnType
InnerVectorsReturnType innerVectors(Index outerStart, Index outerSize)
Expression of a fixed-size or dynamic-size block.
EigenBase< Derived > Base
Derived & operator*=(const Scalar &other)
const Derived & derived() const
Derived & operator/=(const Scalar &other)
Expression of a triangular part in a matrix.
Derived & operator-=(const SparseMatrixBase< OtherDerived > &other)
internal::conditional< _HasDirectAccess, const Scalar &, Scalar >::type CoeffReturnType
void assignGeneric(const OtherDerived &other)
Matrix< Scalar, EIGEN_SIZE_MAX(RowsAtCompileTime, ColsAtCompileTime), EIGEN_SIZE_MAX(RowsAtCompileTime, ColsAtCompileTime)> SquareMatrixType
Matrix< StorageIndex, Dynamic, 1 > IndexVector
friend const Product< OtherDerived, Derived > operator*(const MatrixBase< OtherDerived > &lhs, const SparseMatrixBase &rhs)
Determines whether the given binary operation of two numeric types is allowed and what the scalar ret...
DenseMatrixType toDense() const
Block< Derived, Dynamic, Dynamic, true > InnerVectorsReturnType
const SparseSelfAdjointView< const Derived, UpLo > Type
Generic expression where a coefficient-wise unary operator is applied to an expression.
bool isApprox(const MatrixBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
NumTraits< Scalar >::Real RealScalar
Matrix< Scalar, Dynamic, 1 > ScalarVector
internal::add_const_on_value_type_if_arithmetic< typename internal::packet_traits< Scalar >::type >::type PacketReturnType
#define EIGEN_SIZE_MAX(a, b)
SparseMatrix< Scalar, Flags &RowMajorBit?RowMajor:ColMajor, StorageIndex > PlainObject
Base class for all dense matrices, vectors, and expressions.
friend const Product< OtherDerived, Derived > operator*(const DiagonalBase< OtherDerived > &lhs, const SparseMatrixBase &rhs)
Derived & const_cast_derived() const
const ConstTransposeReturnType transpose() const