Update helm.cpp

fix bug allowing integer iat to be used before being set.  two lines of code were swapped to fix the problem.
This commit is contained in:
Aaron Dotter
2025-06-12 16:46:33 -04:00
committed by GitHub
parent 0ab6af4840
commit 324602226c

View File

@@ -355,8 +355,8 @@ namespace serif::eos::helmholtz {
// hash the table location in t, rho:
jat = (log10(T) - tlo)*tstpi;
jat = max(0, min(jat, table.jmax-1)); // bounds
iat = max(0, min(iat, table.imax-1)); // bounds
iat = (log10(din)-dlo)*dstpi;
iat = max(0, min(iat, table.imax-1)); // bounds
//using the indices, access the table:
fi[0] = table.f[iat][jat];