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:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user