mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-28 02:00: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; }
|
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
|
void
|
||||||
csrmatrix_zero(struct CSRMatrix *A);
|
csrmatrix_zero(struct CSRMatrix *A);
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
/* v = zeros([n, 1]) */
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
void
|
||||||
|
vector_zero(size_t n, double *v);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user