FLINT3.7.0-dev

fexpr_replace, fexpr_replace2, fexpr_replace_vec

Synopsis#include <flint/fexpr.h>
int fexpr_replace(fexpr_t res, const fexpr_t expr, const fexpr_t x, const fexpr_t y)source
int fexpr_replace2(fexpr_t res, const fexpr_t expr, const fexpr_t x1, const fexpr_t y1, const fexpr_t x2, const fexpr_t y2)source
int fexpr_replace_vec(fexpr_t res, const fexpr_t expr, const fexpr_vec_t xs, const fexpr_vec_t ys)source

Sets res to expr with every occurrence of the subexpression x replaced by y (or of the entries of xs by the corresponding entries of ys, which must have the same length), simultaneously and without rescanning the replacements. Returns whether any replacement was made. res may be the same object as expr but not as the other inputs.

Guides#

Cite this page

The FLINT team, “fexpr_replace, fexpr_replace2, fexpr_replace_vec (fexpr.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/fexpr/fexpr_replace.html (generated 2026-10-20).