mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-04 18:54:00 +08:00
Improve documentation.
This commit is contained in:
parent
869b4443ac
commit
b114e6fd3b
@ -538,7 +538,12 @@ class SparseMatrix
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Resizes the matrix to a \a rows x \a cols matrix leaving old values untouched.
|
/** Resizes the matrix to a \a rows x \a cols matrix leaving old values untouched.
|
||||||
* \sa reserve(), setZero()
|
*
|
||||||
|
* If the sizes of the matrix are decreased, then the matrix is turned to \b uncompressed-mode
|
||||||
|
* and the storage of the out of bounds coefficients is kept and reserved.
|
||||||
|
* Call makeCompressed() to pack the entries and squeeze extra memory.
|
||||||
|
*
|
||||||
|
* \sa reserve(), setZero(), makeCompressed()
|
||||||
*/
|
*/
|
||||||
void conservativeResize(Index rows, Index cols)
|
void conservativeResize(Index rows, Index cols)
|
||||||
{
|
{
|
||||||
|
@ -205,17 +205,30 @@ class SparseVector
|
|||||||
|
|
||||||
inline void finalize() {}
|
inline void finalize() {}
|
||||||
|
|
||||||
|
/** \copydoc SparseMatrix::prune(const Scalar&,const RealScalar&) */
|
||||||
void prune(const Scalar& reference, const RealScalar& epsilon = NumTraits<RealScalar>::dummy_precision())
|
void prune(const Scalar& reference, const RealScalar& epsilon = NumTraits<RealScalar>::dummy_precision())
|
||||||
{
|
{
|
||||||
m_data.prune(reference,epsilon);
|
m_data.prune(reference,epsilon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Resizes the sparse vector to \a rows x \a cols
|
||||||
|
*
|
||||||
|
* This method is provided for compatibility with matrices.
|
||||||
|
* For a column vector, \a cols must be equal to 1.
|
||||||
|
* For a row vector, \a rows must be equal to 1.
|
||||||
|
*
|
||||||
|
* \sa resize(Index)
|
||||||
|
*/
|
||||||
void resize(Index rows, Index cols)
|
void resize(Index rows, Index cols)
|
||||||
{
|
{
|
||||||
eigen_assert((IsColVector ? cols : rows)==1 && "Outer dimension must equal 1");
|
eigen_assert((IsColVector ? cols : rows)==1 && "Outer dimension must equal 1");
|
||||||
resize(IsColVector ? rows : cols);
|
resize(IsColVector ? rows : cols);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Resizes the sparse vector to \a newSize
|
||||||
|
* This method deletes all entries, thus leaving an empty sparse vector
|
||||||
|
*
|
||||||
|
* \sa conservativeResize(), setZero() */
|
||||||
void resize(Index newSize)
|
void resize(Index newSize)
|
||||||
{
|
{
|
||||||
m_size = newSize;
|
m_size = newSize;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user