From f10bae74e81ecf1fed70c012090efcb1a05be842 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 2 Dec 2011 10:00:24 +0100 Subject: - move CompressedStorage and AmbiVector into internal namespace - remove innerVectorNonZeros(j) => use innerVector(j).nonZeros() --- Eigen/src/SparseCore/SparseMatrix.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'Eigen/src/SparseCore/SparseMatrix.h') 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 Map; using Base::IsRowMajor; - typedef CompressedStorage Storage; + typedef internal::CompressedStorage 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 m_data; + Storage m_data; Eigen::Map > innerNonZeros() { return Eigen::Map >(m_innerNonZeros, m_innerNonZeros?m_outerSize:0); } const Eigen::Map > innerNonZeros() const { return Eigen::Map >(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 */ -- cgit v1.2.3