fmpq_vec.h – vectors over rational numbers¶
Memory management¶
Randomisation¶
-
void _fmpq_vec_randtest(fmpq *f, flint_rand_t state, slong len, flint_bitcnt_t bits)¶
Sets the entries of a vector of the given length to random rationals with numerator and denominator having up to the given number of bits per entry.
-
void _fmpq_vec_randtest_uniq_sorted(fmpq *vec, flint_rand_t state, slong len, flint_bitcnt_t bits)¶
Sets the entries of a vector of the given length to random distinct rationals with numerator and denominator having up to the given number of bits per entry. The entries in the vector are sorted.
Bit sizes and heights¶
-
void _fmpq_vec_max_height(fmpz_t height, const fmpq *vec, slong len);¶
Computes the maximum of the height of any coefficient of
(vec, len)
, each height being computed byfmpq_height()
.
-
flint_bitcnt_t _fmpq_vec_max_height_bits(const fmpq *vec, slong len);¶
Computes the maximum number of bits of the height of any coefficient of
(vec, len)
, each one being computed byfmpq_height_bits()
.
Comparison¶
Sorting¶
Conversions¶
Dot product¶
Input and output¶
-
int _fmpq_vec_fprint(FILE *file, const fmpq *vec, slong len)¶
Prints the vector of given length to the stream
file
. The format is the length followed by two spaces, then a space separated list of coefficients. If the length is zero, only \(0\) is printed.In case of success, returns a positive value. In case of failure, returns a non-positive value.
-
int _fmpq_vec_print(const fmpq *vec, slong len)¶
Prints the vector of given length to
stdout
.For further details, see
_fmpq_vec_fprint()
.