|
double VF_i = LinearInterpolation(data::NR_Data[i - 1][K_INDEX], data::NR_Data[i - i][j - 1 + 1], data::NR_Data[i][0], data::NR_Data[i][j - 1 + 1], K); |
ReShaper C++ is showing a potential issue ("Both sides of operator are equivalent [misc-redundant-expression]") with this line:
data::NR_Data[i - i]
I think this is a typo and it should read i-1
But the more I look at this code the more I think there is a general issue (could be wrong)
Looking at a test input of
Result res{};
Main(1, 1.5, 1000, 1200, 0.01, &res);
and putting a breakpoint on the NakagamiRice function I think there are cases when the index goes negative (j == 0 so data::P[j - 1] is an issue)
You can better trap this by converting to use std::array or std::vector and running in debug and the debugger traps the issue