MCPcopy Create free account
hub / github.com/numpy/numpy / calc_first_half

Function calc_first_half

numpy/fft/_pocketfft.c:124–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122 }
123
124NOINLINE static void calc_first_half(size_t n, double * restrict res)
125 {
126 int ndone=(n+1)>>1;
127 double * p = res+n-1;
128 calc_first_octant(n<<2, p);
129 int i4=0, in=n, i=0;
130 for (; i4<=in-i4; ++i, i4+=4) // octant 0
131 {
132 res[2*i] = p[2*i4]; res[2*i+1] = p[2*i4+1];
133 }
134 for (; i4-in <= 0; ++i, i4+=4) // octant 1
135 {
136 int xm = in-i4;
137 res[2*i] = p[2*xm+1]; res[2*i+1] = p[2*xm];
138 }
139 for (; i4<=3*in-i4; ++i, i4+=4) // octant 2
140 {
141 int xm = i4-in;
142 res[2*i] = -p[2*xm+1]; res[2*i+1] = p[2*xm];
143 }
144 for (; i<ndone; ++i, i4+=4) // octant 3
145 {
146 int xm = 2*in-i4;
147 res[2*i] = -p[2*xm]; res[2*i+1] = p[2*xm+1];
148 }
149 }
150
151NOINLINE static void fill_first_quadrant(size_t n, double * restrict res)
152 {

Callers 1

sincos_2pibyn_halfFunction · 0.85

Calls 1

calc_first_octantFunction · 0.85

Tested by

no test coverage detected