* #v = 0#, but more obvious and faster.
*/
void clear ();
+
/**
* U(0-N) = s . Fill all components
*/
const double c, const dVector& X);
/**
- * U=s*U . Scaling
+ * Scale each element of the vector by the
+ * given factor. This function was
+ * previously called #equ(double)#, which
+ * in my eyes is an extremely unintuitive
+ * naming and was thus replaced.
*/
- void equ (const double s);
+ void scale (const double factor);
/**
* U=a*V . Replacing
Assert (cols != 0, ExcMatrixNotInitialized());
Assert (cols == matrix.cols, ExcDifferentSparsityPatterns());
- for (unsigned int i = 0 ; i<cols->vec_len; i++)
+ for (unsigned int i = 0 ; i<cols->vec_len; ++i)
val[i] = matrix.val[i];
return *this;
Assert (cols != 0, ExcMatrixNotInitialized());
Assert (cols == matrix.cols, ExcDifferentSparsityPatterns());
- for (unsigned int i = 0 ; i<cols->vec_len; i++)
+ for (unsigned int i = 0 ; i<cols->vec_len; ++i)
val[i] += factor*matrix.val[i];
};
Assert(m() == dst.n(), ExcDimensionsDontMatch(m(),dst.n()));
Assert(n() == src.n(), ExcDimensionsDontMatch(n(),src.n()));
- for (unsigned int i=0;i<m();i++)
+ for (unsigned int i=0; i<m(); ++i)
{
double s = 0.;
- for (unsigned int j=cols->rowstart[i]; j < cols->rowstart[i+1] ;j++)
- {
- int p = cols->colnums[j];
- s += val[j] * src(p);
- }
+ for (unsigned int j=cols->rowstart[i]; j<cols->rowstart[i+1]; ++j)
+ s += val[j] * src(cols->colnums[j]);
dst(i) = s;
}
}