45 #include "constants.h"
84 C[i][j] = C[i-1][j-1] + C[i-1][j];
105 static double InExClusion(
point* zero,
point* one,
int n,
int* idx,
point* PS,
struct iex* ax)
116 point* PTS = (ax->PTS);
117 int* C2P = (ax->C2P);
126 intercept(&(PTS[i+1]), one, &(PS[idx[i]]));
128 res += HV(zero, &(PTS[i]));
134 memcpy(&counts[1], &C[n][0], (n+1)*
sizeof(
int));
141 C2P[i] = counts[ones];
143 intercept(&(PTS[C2P[i]]), &(PTS[C2P[
Rbit(i)]]), &(PTS[C2P[
Rpop(i)]]));
145 res += HV(zero, &(PTS[C2P[i]]));
147 res -= HV(zero, &(PTS[C2P[i]]));
196 T = InExClusion(zero, one, n, idx, PS, ax);
204 H = HV(zero, &(ax->PTS[ax->C2P[i]]));
This returns iterators for diferent type. WARNING, these objects are singleton, so new overwrites exi...
Simple point interface. Contains simple point manipulation functions.
Inclusion Exclusion Algorithm better than HSO for high d and small n.
struct point __attribute__((aligned(16))) point
All points must be aligned for SSE2.
Point is an array of coordinates, in a struct for simple and fast copy.
double exInExClusion(point *zero, point *one, int n, int *idx, point *PS, double *exHV, struct iex *ax)