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

Method setZero

include/Eigen/Eigen/src/SparseCore/SparseMatrix.h:288–295  ·  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

286 * \sa resize(Index,Index), data()
287 */
288 inline void setZero()
289 {
290 m_data.clear();
291 std::fill_n(m_outerIndex, m_outerSize + 1, StorageIndex(0));
292 if(m_innerNonZeros) {
293 std::fill_n(m_innerNonZeros, m_outerSize, StorageIndex(0));
294 }
295 }
296
297 /** Preallocates \a reserveSize non zeros.
298 *

Callers 3

assignDiagonalMethod · 0.45
SparseMatrix.hFile · 0.45
deserializeMethod · 0.45

Calls 1

clearMethod · 0.80

Tested by

no test coverage detected