MCPcopy Create free account
hub / github.com/ErrorAtLine0/infinipaint / SparseMatrix

Class SparseMatrix

include/Eigen/src/SparseCore/SparseMatrix.h:121–1114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119
120template <typename Scalar_, int Options_, typename StorageIndex_>
121class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_, StorageIndex_>> {
122 typedef SparseCompressedBase<SparseMatrix> Base;
123 using Base::convert_index;
124 friend class SparseVector<Scalar_, 0, StorageIndex_>;
125 template <typename, typename, typename, typename, typename>
126 friend struct internal::Assignment;
127
128 public:
129 using Base::isCompressed;
130 using Base::nonZeros;
131 EIGEN_SPARSE_PUBLIC_INTERFACE(SparseMatrix)
132 using Base::operator+=;
133 using Base::operator-=;
134
135 typedef Eigen::Map<SparseMatrix<Scalar, Options_, StorageIndex>> Map;
136 typedef Diagonal<SparseMatrix> DiagonalReturnType;
137 typedef Diagonal<const SparseMatrix> ConstDiagonalReturnType;
138 typedef typename Base::InnerIterator InnerIterator;
139 typedef typename Base::ReverseInnerIterator ReverseInnerIterator;
140
141 using Base::IsRowMajor;
142 typedef internal::CompressedStorage<Scalar, StorageIndex> Storage;
143 enum { Options = Options_ };
144
145 typedef typename Base::IndexVector IndexVector;
146 typedef typename Base::ScalarVector ScalarVector;
147
148 protected:
149 typedef SparseMatrix<Scalar, IsRowMajor ? ColMajor : RowMajor, StorageIndex> TransposedSparseMatrix;
150
151 Index m_outerSize;
152 Index m_innerSize;
153 StorageIndex* m_outerIndex;
154 StorageIndex* m_innerNonZeros; // optional, if null then the data is compressed
155 Storage m_data;
156
157 public:
158 /** \returns the number of rows of the matrix */
159 inline Index rows() const { return IsRowMajor ? m_outerSize : m_innerSize; }
160 /** \returns the number of columns of the matrix */
161 inline Index cols() const { return IsRowMajor ? m_innerSize : m_outerSize; }
162
163 /** \returns the number of rows (resp. columns) of the matrix if the storage order column major (resp. row major) */
164 inline Index innerSize() const { return m_innerSize; }
165 /** \returns the number of columns (resp. rows) of the matrix if the storage order column major (resp. row major) */
166 inline Index outerSize() const { return m_outerSize; }
167
168 /** \returns a const pointer to the array of values.
169 * This function is aimed at interoperability with other libraries.
170 * \sa innerIndexPtr(), outerIndexPtr() */
171 inline const Scalar* valuePtr() const { return m_data.valuePtr(); }
172 /** \returns a non-const pointer to the array of values.
173 * This function is aimed at interoperability with other libraries.
174 * \sa innerIndexPtr(), outerIndexPtr() */
175 inline Scalar* valuePtr() { return m_data.valuePtr(); }
176
177 /** \returns a const pointer to the array of inner indices.
178 * This function is aimed at interoperability with other libraries.

Callers

nothing calls this directly

Calls 15

swapMethod · 0.95
smart_copyFunction · 0.85
searchLowerIndexMethod · 0.80
isRValueMethod · 0.80
swapFunction · 0.70
rowsFunction · 0.50
colsFunction · 0.50
operator=Function · 0.50
indexMethod · 0.45
valueMethod · 0.45
sizeMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected