Skip to content

Commit

Permalink
no dereferencing indexers. they're not pointers necessarily.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahm-LANL committed Apr 19, 2024
1 parent dc5f614 commit 4ea36aa
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions singularity-eos/eos/eos_spiner.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1821,7 +1821,7 @@ SpinerEOSDependsRhoSie::FillEos(Real &rho, Real &temp, Real &energy, Real &press
}
} else {
lRho = toLog_(rho, lRhoOffset_);
if (!variadic_utils::is_nullptr(lambda)) *lambda = lRho;
if (!variadic_utils::is_nullptr(lambda)) lambda[0] = lRho;
}
if (output & thermalqs::temperature) {
lE = toLog_(energy, lEOffset_);
Expand Down Expand Up @@ -1871,7 +1871,7 @@ PORTABLE_INLINE_FUNCTION Real SpinerEOSDependsRhoSie::interpRhoT_(
const Real lRho = toLog_(rho, lRhoOffset_);
const Real lT = toLog_(T, lTOffset_);
if (!variadic_utils::is_nullptr(lambda)) {
*lambda = lRho;
lambda[0] = lRho;
}
return db.interpToReal(lRho, lT);
}
Expand All @@ -1882,7 +1882,7 @@ PORTABLE_INLINE_FUNCTION Real SpinerEOSDependsRhoSie::interpRhoSie_(
const Real lRho = toLog_(rho, lRhoOffset_);
const Real lE = toLog_(sie, lEOffset_);
if (!variadic_utils::is_nullptr(lambda)) {
*lambda = lRho;
lambda[0] = lRho;
}
return db.interpToReal(lRho, lE);
}
Expand All @@ -1903,9 +1903,9 @@ PORTABLE_INLINE_FUNCTION Real SpinerEOSDependsRhoSie::lRhoFromPlT_(
}
} else {
Real lRhoGuess = reproducible_ ? lRhoMin_ : 0.5 * (lRhoMin_ + lRhoMax_);
if (!variadic_utils::is_nullptr(lambda) && lRhoMin_ <= *lambda &&
*lambda <= lRhoMax_) {
lRhoGuess = *lambda;
if (!variadic_utils::is_nullptr(lambda) && lRhoMin_ <= lambda[0] &&
lambda[0] <= lRhoMax_) {
lRhoGuess = lambda[0];
}
const callable_interp::l_interp PFunc(dependsRhoT_.P, lT);
auto status = ROOT_FINDER(PFunc, P, lRhoGuess, lRhoMin_, lRhoMax_, robust::EPS(),
Expand All @@ -1926,7 +1926,7 @@ PORTABLE_INLINE_FUNCTION Real SpinerEOSDependsRhoSie::lRhoFromPlT_(
lRho = reproducible_ ? lRhoMin_ : lRhoGuess;
}
}
if (!variadic_utils::is_nullptr(lambda)) *lambda = lRho;
if (!variadic_utils::is_nullptr(lambda)) lambda[0] = lRho;
return lRho;
}

Expand Down

0 comments on commit 4ea36aa

Please sign in to comment.