aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/SparseCore/SparseMatrix.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2011-12-02 10:00:24 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2011-12-02 10:00:24 +0100
commitf10bae74e81ecf1fed70c012090efcb1a05be842 (patch)
treefc7fc90bba3a50ea4a93403afbc63276518dcf41 /Eigen/src/SparseCore/SparseMatrix.h
parenta0bcaa88af027de43306361f768c0b227d0072cb (diff)
- move CompressedStorage and AmbiVector into internal namespace
- remove innerVectorNonZeros(j) => use innerVector(j).nonZeros()
Diffstat (limited to 'Eigen/src/SparseCore/SparseMatrix.h')
-rw-r--r--Eigen/src/SparseCore/SparseMatrix.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h
index 87ff2ecf4..56811ce27 100644
--- a/Eigen/src/SparseCore/SparseMatrix.h
+++ b/Eigen/src/SparseCore/SparseMatrix.h
@@ -83,7 +83,7 @@ class SparseMatrix
typedef MappedSparseMatrix<Scalar,Flags> Map;
using Base::IsRowMajor;
- typedef CompressedStorage<Scalar,Index> Storage;
+ typedef internal::CompressedStorage<Scalar,Index> Storage;
enum {
Options = _Options
};
@@ -96,7 +96,7 @@ class SparseMatrix
Index m_innerSize;
Index* m_outerIndex;
Index* m_innerNonZeros; // optional, if null then the data is compressed
- CompressedStorage<Scalar,Index> m_data;
+ Storage m_data;
Eigen::Map<Matrix<Index,Dynamic,1> > innerNonZeros() { return Eigen::Map<Matrix<Index,Dynamic,1> >(m_innerNonZeros, m_innerNonZeros?m_outerSize:0); }
const Eigen::Map<const Matrix<Index,Dynamic,1> > innerNonZeros() const { return Eigen::Map<const Matrix<Index,Dynamic,1> >(m_innerNonZeros, m_innerNonZeros?m_outerSize:0); }
@@ -105,17 +105,15 @@ class SparseMatrix
inline bool compressed() const { return m_innerNonZeros==0; }
+ /** \returns the number of rows of the matrix */
inline Index rows() const { return IsRowMajor ? m_outerSize : m_innerSize; }
+ /** \returns the number of columns of the matrix */
inline Index cols() const { return IsRowMajor ? m_innerSize : m_outerSize; }
+ /** \returns the number of rows (resp. columns) of the matrix if the storage order column major (resp. row major) */
inline Index innerSize() const { return m_innerSize; }
+ /** \returns the number of columns (resp. rows) of the matrix if the storage order column major (resp. row major) */
inline Index outerSize() const { return m_outerSize; }
- /** \returns the number of non zeros in the inner vector \a j
- */
- inline Index innerNonZeros(Index j) const
- {
- return m_innerNonZeros ? m_innerNonZeros[j] : m_outerIndex[j+1]-m_outerIndex[j];
- }
/** \internal
* \returns a const pointer to the array of values */