MCPcopy Create free account
hub / github.com/ErrorAtLine0/infinipaint / conservativeResize

Function conservativeResize

include/Eigen/src/SparseCore/SparseVector.h:246–253  ·  view source on GitHub ↗

Resizes the sparse vector to \a newSize, while leaving old values untouched. * * If the size of the vector is decreased, then the storage of the out-of bounds coefficients is kept and reserved. * Call .data().squeeze() to free extra memory. * * \sa reserve(), setZero() */

Source from the content-addressed store, hash-verified

244 * \sa reserve(), setZero()
245 */
246 void conservativeResize(Index newSize) {
247 if (newSize < m_size) {
248 Index i = 0;
249 while (i < m_data.size() && m_data.index(i) < newSize) ++i;
250 m_data.resize(i);
251 }
252 m_size = newSize;
253 }
254
255 void resizeNonZeros(Index size) { m_data.resize(size); }
256

Callers 2

removeOuterVectorsMethod · 0.70

Calls 3

sizeMethod · 0.45
indexMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected