1
0
Fork 0
mirror of https://github.com/gwm17/catima.git synced 2024-11-22 18:28:51 -05:00

energytable interpolator

This commit is contained in:
hrocho 2017-07-26 23:25:14 +02:00
parent 49e9f6ab24
commit f146d72966

View File

@ -66,10 +66,9 @@ namespace catima{
template<int N>
int EnergyTable_index(const EnergyTable<N> &table, double val){
val = log(val)/M_LN10;
double lxval = log(val)/M_LN10;
if(val<table.values[0] || val>table.values[table.num-1])return -1;
int i = (int)val/table.step;
//double x = 1.0 - ((val - table.valuesp[i])/table.step);
int i = (int)lxval/table.step;
return i;
}