FLINT3.7.0-dev

_fmpq_vec_dot

Synopsis#include <flint/fmpq_vec.h>
void _fmpq_vec_dot(fmpq_t res, const fmpq * vec1, const fmpq * vec2, slong len)source

Sets res to \sum_{i < \mathit{len}} \mathit{vec1}_i \, \mathit{vec2}_i, accumulated with fmpq_addmul. res must not be an entry of the input vectors.

Each step costs GCDs of the size of the partial sum. For long vectors it is faster to clear denominators with _fmpq_vec_get_fmpz_vec_fmpz and compute an integer dot product with _fmpz_vec_dot.

Cite this page

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