dirichlet_char_next
Synopsis
#include <flint/dirichlet.h>int dirichlet_char_next(dirichlet_char_t x, const dirichlet_group_t G)sourceSets x to the next element of G in the lexicographic order of the logs (the last component varying fastest), updating the number with one multiplication. Returns the index of the most significant component that changed, or -1 after the last element (when x wraps around to the principal character).
This enumerates the characters in an order that looks random in terms of the numbers. A loop over all characters:
dirichlet_char_one(chi, G);
do {
/* use chi */
} while (dirichlet_char_next(chi, G) >= 0);Guides#
Cite this page
The FLINT team, “dirichlet_char_next (dirichlet.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/dirichlet/dirichlet_char_next.html (generated 2026-10-20).
@misc{flint-doc-dirichlet-dirichlet-char-next,
author = {{The FLINT team}},
title = {{dirichlet\_char\_next (dirichlet.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/dirichlet/dirichlet_char_next.html},
note = {Generated 2026-10-20}
}