1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
Copyright (C) 2014 Abhinav Baid
This file is part of FLINT.
FLINT is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License (LGPL) as published
by the Free Software Foundation; either version 3 of the License, or
(at your option) any later version. See <https://www.gnu.org/licenses/>.
*/
#ifndef FMPQ_VEC_H
#define FMPQ_VEC_H
#ifdef FMPQ_VEC_INLINES_C
#define FMPQ_VEC_INLINE
#else
#define FMPQ_VEC_INLINE static inline
#endif
#include "flint.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Memory management *******************************************************/
fmpq * _fmpq_vec_init(slong len);
void _fmpq_vec_clear(fmpq * vec, slong len);
/* Randomisation ***********************************************************/
void _fmpq_vec_randtest(fmpq * f, flint_rand_t state,
slong len, flint_bitcnt_t bits);
void _fmpq_vec_randtest_uniq_sorted(fmpq * vec,
flint_rand_t state, slong len, flint_bitcnt_t bits);
/* Norms *******************************************************************/
void _fmpq_vec_max_height(fmpz_t height, const fmpq * vec, slong len);
flint_bitcnt_t _fmpq_vec_max_height_bits(const fmpq * vec, slong len);
/* Sorting ******************************************************************/
void _fmpq_vec_sort(fmpq * vec, slong len);
/* Comparison **************************************************************/
int _fmpq_vec_equal(const fmpq * vec1, const fmpq * vec2, slong len);
/* Conversions *************************************************************/
void _fmpq_vec_set_fmpz_vec(fmpq * res, const fmpz * vec, slong len);
void _fmpq_vec_get_fmpz_vec_fmpz(fmpz* num, fmpz_t den,
const fmpq * a, slong len);
void _fmpq_vec_get_fmpz_vec_fmpz(fmpz* num, fmpz_t den,
const fmpq * a, slong len);
/* Dot product **************************************************/
void _fmpq_vec_dot(fmpq_t res, const fmpq * vec1, const fmpq * vec2, slong len);
/* Input and output ********************************************************/
#ifdef FLINT_HAVE_FILE
int _fmpq_vec_fprint(FILE * file, const fmpq * vec, slong len);
#endif
int _fmpq_vec_print(const fmpq * vec, slong len);
#ifdef __cplusplus
}
#endif
#endif