mirror of
https://github.com/gwm17/catima.git
synced 2024-11-22 18:28:51 -05:00
energytable interpolator
This commit is contained in:
parent
49e9f6ab24
commit
f146d72966
|
@ -66,10 +66,9 @@ namespace catima{
|
||||||
|
|
||||||
template<int N>
|
template<int N>
|
||||||
int EnergyTable_index(const EnergyTable<N> &table, double val){
|
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;
|
if(val<table.values[0] || val>table.values[table.num-1])return -1;
|
||||||
int i = (int)val/table.step;
|
int i = (int)lxval/table.step;
|
||||||
//double x = 1.0 - ((val - table.valuesp[i])/table.step);
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user