mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-26 17:20:59 -06:00
Move implementation of vector_zero() to central location.
There is no need for each file to contain a separate, though trivial, implementation of this feature.
This commit is contained in:
parent
ef4d884d12
commit
edd470dd7d
13
sparse_sys.c
13
sparse_sys.c
@ -192,3 +192,16 @@ csrmatrix_zero(struct CSRMatrix *A)
|
||||
|
||||
for (i = 0; i < A->nnz; i++) { A->sa[i] = 0.0; }
|
||||
}
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/* v = zeros([n, 1]) */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
void
|
||||
vector_zero(size_t n, double *v)
|
||||
/* ---------------------------------------------------------------------- */
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < n; i++) { v[i] = 0.0; }
|
||||
}
|
||||
|
@ -72,6 +72,12 @@ csrmatrix_delete(struct CSRMatrix *A);
|
||||
void
|
||||
csrmatrix_zero(struct CSRMatrix *A);
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/* v = zeros([n, 1]) */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
void
|
||||
vector_zero(size_t n, double *v);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user