MCPcopy Create free account
hub / github.com/cvxpy/cvxpy / setZero

Method setZero

cvxpy/cvxcore/include/Eigen/src/SparseCore/SparseMatrix.h:253–259  ·  view source on GitHub ↗

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() */

Source from the content-addressed store, hash-verified

251 * \sa resize(Index,Index), data()
252 */
253 inline void setZero()
254 {
255 m_data.clear();
256 memset(m_outerIndex, 0, (m_outerSize+1)*sizeof(StorageIndex));
257 if(m_innerNonZeros)
258 memset(m_innerNonZeros, 0, (m_outerSize)*sizeof(StorageIndex));
259 }
260
261 /** Preallocates \a reserveSize non zeros.
262 *

Callers 3

assignDiagonalMethod · 0.45
set_from_tripletsFunction · 0.45
SparseMatrix.hFile · 0.45

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected