mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-22 04:44:25 +08:00
backport d97d307fcfc9c9421562705db7bf734865dfd53b
This commit is contained in:
parent
e43d630d80
commit
3b8938ee1a
@ -259,9 +259,11 @@ class SparseMatrix
|
|||||||
m_data.resize(k,0);
|
m_data.resize(k,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Resizes the matrix to a \a rows x \a cols matrix and initializes it to zero
|
||||||
|
* \sa resizeNonZeros(int), reserve(), setZero()
|
||||||
|
*/
|
||||||
void resize(int rows, int cols)
|
void resize(int rows, int cols)
|
||||||
{
|
{
|
||||||
// std::cerr << this << " resize " << rows << "x" << cols << "\n";
|
|
||||||
const int outerSize = IsRowMajor ? rows : cols;
|
const int outerSize = IsRowMajor ? rows : cols;
|
||||||
m_innerSize = IsRowMajor ? cols : rows;
|
m_innerSize = IsRowMajor ? cols : rows;
|
||||||
m_data.clear();
|
m_data.clear();
|
||||||
@ -270,8 +272,8 @@ class SparseMatrix
|
|||||||
delete[] m_outerIndex;
|
delete[] m_outerIndex;
|
||||||
m_outerIndex = new int [outerSize+1];
|
m_outerIndex = new int [outerSize+1];
|
||||||
m_outerSize = outerSize;
|
m_outerSize = outerSize;
|
||||||
memset(m_outerIndex, 0, (m_outerSize+1)*sizeof(int));
|
|
||||||
}
|
}
|
||||||
|
memset(m_outerIndex, 0, (m_outerSize+1)*sizeof(int));
|
||||||
}
|
}
|
||||||
void resizeNonZeros(int size)
|
void resizeNonZeros(int size)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user