replace std::fill with std::fill_n where appropriate

more expressive
This commit is contained in:
Arne Morten Kvarving committed 2026-02-23 10:23:45 +01:00
1 parent f00ab30268
commit 5e13b84f9c
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -138,7 +138,7 @@ void csrPatternToCsc(const int* CSRColIndices,
int nnz = CSRRowPointers[Nb];
// compute number of nnzs per column
std::fill(CSCColPointers, CSCColPointers + Nb, 0);
std::fill_n(CSCColPointers, Nb, 0);
for (int n = 0; n < nnz; ++n) {
CSCColPointers[CSRColIndices[n]]++;
+2 -2
View File
@@ -108,7 +108,7 @@ calcInjCoeff(const RegionId r, const int pvtRegionIdx, Coeff& coeff) const
const int io = phaseIdx<FluidSystem>(FluidSystem::oilPhaseIdx);
const int ig = phaseIdx<FluidSystem>(FluidSystem::gasPhaseIdx);
std::fill(& coeff[0], & coeff[0] + FluidSystem::numActivePhases(), 0.0);
std::fill_n(&coeff[0], FluidSystem::numActivePhases(), 0.0);
if (FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx)) {
// q[w]_r = q[w]_s / bw
@@ -184,7 +184,7 @@ calcCoeff(const int pvtRegionIdx,
const int io = phaseIdx<FluidSystem>(FluidSystem::oilPhaseIdx);
const int ig = phaseIdx<FluidSystem>(FluidSystem::gasPhaseIdx);
std::fill(& coeff[0], & coeff[0] + FluidSystem::numActivePhases(), 0.0);
std::fill_n(&coeff[0], FluidSystem::numActivePhases(), 0.0);
// Determinant of 'R' matrix
const Scalar detRw = 1.0 - (Rsw * Rvw);