Commit 70c9a033 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

performance tweaks

parent 4af2e7ec
......@@ -499,7 +499,7 @@ template<typename T> class Helper
int iu0, iv0; // start index of the current visibility
int bu0, bv0; // start index of the current buffer
void NOINLINE update(T u_in, T v_in)
NOINLINE void update(T u_in, T v_in)
{
auto u = fmodulo(u_in, T(1))*nu;
iu0 = int(u-w*0.5 + 1 + nu) - nu;
......@@ -508,13 +508,17 @@ template<typename T> class Helper
iv0 = int(v-w*0.5 + 1 + nv) - nv;
if (iv0+w>nv+nsafe) iv0 = nv+nsafe-w;
T xw=T(2)/w;
auto x0 = xw*(iu0-u);
auto y0 = xw*(iv0-v);
for (int i=0; i<w; ++i)
{
kernel[i ] = xw*(iu0+i-u);
kernel[i+w] = xw*(iv0+i-v);
auto x = x0+i*xw;
kernel[i ] = beta*sqrt(T(1)-x*x);
auto y = y0+i*xw;
kernel[i+w] = beta*sqrt(T(1)-y*y);
}
for (auto &k : kernel)
k = exp(beta*sqrt(T(1)-k*k));
k = exp(k);
}
bool need_to_move() const
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment