Eliminate use of 'memset'

This commit is contained in:
Ray Speth 2015-07-27 17:45:23 -04:00
parent c3c80f79fb
commit 09207eacfb
2 changed files with 2 additions and 18 deletions

View file

@ -237,14 +237,7 @@ public:
//! Set all of the entries to zero
void zero() {
size_t nn = m_nrows * m_ncols;
if (nn > 0) {
/*
* Using memset is the fastest way to zero a contiguous
* section of memory.
*/
(void) memset((void*) &m_data[0], 0, nn * sizeof(doublereal));
}
m_data.assign(m_data.size(), 0.0);
}
//! Allows setting elements using the syntax A(i,j) = x.

View file

@ -91,16 +91,7 @@ int SquareMatrix::solve(doublereal* b, size_t nrhs, size_t ldb)
void SquareMatrix::zero()
{
size_t n = nRows();
if (n > 0) {
size_t nn = n * n;
double* sm = &m_data[0];
/*
* Using memset is the fastest way to zero a contiguous
* section of memory.
*/
(void) memset((void*) sm, 0, nn * sizeof(double));
}
m_data.assign(m_data.size(), 0.0);
}
void SquareMatrix::resize(size_t n, size_t m, doublereal v)