diff options
author | Gael Guennebaud <g.gael@free.fr> | 2015-02-16 15:56:11 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2015-02-16 15:56:11 +0100 |
commit | 953d5ccfd5e7612233d464456e111f7b7e90d382 (patch) | |
tree | 74dc74025ebd50d1d73d43e442e22f2815a1f6c3 /Eigen/src/SparseCore/SparseMatrix.h | |
parent | 98604576d1d4ef3d768b1cc08b4ccedbf16816ab (diff) |
Doc: explain how to free allocated memory in SparseMAtrix
Diffstat (limited to 'Eigen/src/SparseCore/SparseMatrix.h')
-rw-r--r-- | Eigen/src/SparseCore/SparseMatrix.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 4cf4f1826..4c8965802 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -243,7 +243,13 @@ class SparseMatrix public: - /** Removes all non zeros but keep allocated memory */ + /** Removes all non zeros but keep allocated memory + * + * This function does not free the currently allocated memory. To release as much as memory as possible, + * call \code mat.data().squeeze(); \endcode after resizing it. + * + * \sa resize(Index,Index), data() + */ inline void setZero() { m_data.clear(); @@ -601,6 +607,10 @@ class SparseMatrix } /** Resizes the matrix to a \a rows x \a cols matrix and initializes it to zero. + * + * This function does not free the currently allocated memory. To release as much as memory as possible, + * call \code mat.data().squeeze(); \endcode after resizing it. + * * \sa resizeNonZeros(Index), reserve(), setZero() */ void resize(Index rows, Index cols) |