90 uint64_t len, cap, max, rt_max, *primes, num_primes, modulus, small_primes;
94 int64_t (*h_fn)(uint64_t p, uint64_t pp, uint64_t e, uint64_t m);
95 const int64_t *h_vals;
113bool nut_PfIt_init_fn(
nut_PfIt *self, uint64_t max, uint64_t modulus, uint64_t small_primes, int64_t (*h_fn)(uint64_t p, uint64_t pp, uint64_t e, uint64_t m));
138 int64_t (*f_fn)(uint64_t p, uint64_t pp, uint64_t e, uint64_t m), int64_t (*g_fn)(uint64_t p, uint64_t pp, uint64_t e, uint64_t m)
148#define NUT_PfIt_INIT(self, max, modulus, small_primes, h) _Generic((h), int64_t (*)(uint64_t, uint64_t, uint64_t, uint64_t): nut_PfIt_init_fn, int64_t*: nut_PfIt_init_hvals)((self), (max), (modulus), (small_primes), (h))
215void nut_series_div(uint64_t n, int64_t m, int64_t h[restrict static n], int64_t f[restrict static n], int64_t g[restrict static n]);
217#define NUT_DIRI_H_FN 0
218#define NUT_DIRI_H_VALS 1
219#define NUT_DIRI_H_SEQS 2
bool nut_PfIt_init_hvals(nut_PfIt *restrict self, uint64_t max, uint64_t modulus, uint64_t small_primes, const int64_t *restrict h_vals)
Set up a powerful iterator that uses a table of values for h (when h(p^e) depends only on e)
bool nut_Diri_sum_adjusted(int64_t *restrict out, const nut_Diri *restrict g_tbl, nut_PfIt *pf_it)
Compute the sum of f = g <*> h (from 1 up to g_tbl->x), where f(p) = g(p) The modulus used to reduce ...
void nut_PfIt_destroy(nut_PfIt *self)
Delete backing arrays for a powerful number iterator.
bool nut_PfStack_push(nut_PfIt *restrict self, const nut_PfStackEnt *restrict ent)
Mainly for internal use Push an entry into the internal stack of a powerful number iterator Doing thi...
bool nut_PfIt_next(nut_PfIt *restrict self, nut_PfStackEnt *restrict out)
Get the next entry from a powerful number iterator This entry will have out->n set to a powerful numb...
bool nut_PfIt_init_fn(nut_PfIt *self, uint64_t max, uint64_t modulus, uint64_t small_primes, int64_t(*h_fn)(uint64_t p, uint64_t pp, uint64_t e, uint64_t m))
Set up a powerful iterator that uses a callback function to compute h.
void nut_series_div(uint64_t n, int64_t m, int64_t h[restrict static n], int64_t f[restrict static n], int64_t g[restrict static n])
Compute the series quotient h = f / g for two (finite) power series In other words,...
bool nut_PfIt_init_hseqs(nut_PfIt *restrict self, uint64_t max, uint64_t modulus, uint64_t small_primes, int64_t(*f_fn)(uint64_t p, uint64_t pp, uint64_t e, uint64_t m), int64_t(*g_fn)(uint64_t p, uint64_t pp, uint64_t e, uint64_t m))
Set up a powerful iterator that automatically computes h values given f and g (when a closed form for...
bool nut_Diri_sum_u_adjusted(int64_t *restrict out, nut_PfIt *pf_it)
Compute the sum of f = u <*> h (from 1 up to pf_it->max), where f(p) = g(p) The modulus used to reduc...
bool nut_PfStack_pop(nut_PfIt *restrict self, nut_PfStackEnt *restrict out)
Mainly for internal use Pop an entry from the internal stack of a powerful number iterator Doing this...
#define NUT_ATTR_ACCESS(...)
Wrapper for gcc's access function annotation - no clang equivalent, and currently disabled because it...
#define NUT_ATTR_NONNULL(...)
Wrapper for gnu::nonnull attr.
Wrapper to hold values of some multiplicative function.
Iterator to find all powerful numbers and evaluate a function h at them See NUT_PfIt_INIT,...