Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-07 10:15:12

0001 /*
0002     Copyright (C) 2014 Abhinav Baid
0003 
0004     This file is part of FLINT.
0005 
0006     FLINT is free software: you can redistribute it and/or modify it under
0007     the terms of the GNU Lesser General Public License (LGPL) as published
0008     by the Free Software Foundation; either version 3 of the License, or
0009     (at your option) any later version.  See <https://www.gnu.org/licenses/>.
0010 */
0011 
0012 #ifndef FMPQ_VEC_H
0013 #define FMPQ_VEC_H
0014 
0015 #ifdef FMPQ_VEC_INLINES_C
0016 #define FMPQ_VEC_INLINE
0017 #else
0018 #define FMPQ_VEC_INLINE static inline
0019 #endif
0020 
0021 #include "flint.h"
0022 
0023 #ifdef __cplusplus
0024 extern "C" {
0025 #endif
0026 
0027 /*  Memory management  *******************************************************/
0028 
0029 fmpq * _fmpq_vec_init(slong len);
0030 void _fmpq_vec_clear(fmpq * vec, slong len);
0031 
0032 /*  Randomisation  ***********************************************************/
0033 
0034 void _fmpq_vec_randtest(fmpq * f, flint_rand_t state,
0035                         slong len, flint_bitcnt_t bits);
0036 
0037 void _fmpq_vec_randtest_uniq_sorted(fmpq * vec,
0038                         flint_rand_t state, slong len, flint_bitcnt_t bits);
0039 
0040 /*  Norms  *******************************************************************/
0041 
0042 void _fmpq_vec_max_height(fmpz_t height, const fmpq * vec, slong len);
0043 
0044 flint_bitcnt_t _fmpq_vec_max_height_bits(const fmpq * vec, slong len);
0045 
0046 /* Sorting  ******************************************************************/
0047 
0048 void _fmpq_vec_sort(fmpq * vec, slong len);
0049 
0050 /*  Comparison  **************************************************************/
0051 
0052 int _fmpq_vec_equal(const fmpq * vec1, const fmpq * vec2, slong len);
0053 
0054 /*  Conversions  *************************************************************/
0055 
0056 void _fmpq_vec_set_fmpz_vec(fmpq * res, const fmpz * vec, slong len);
0057 
0058 void _fmpq_vec_get_fmpz_vec_fmpz(fmpz* num, fmpz_t den,
0059                                                     const fmpq * a, slong len);
0060 
0061 void _fmpq_vec_get_fmpz_vec_fmpz(fmpz* num, fmpz_t den,
0062                                                     const fmpq * a, slong len);
0063 
0064 /*  Dot product  **************************************************/
0065 
0066 void _fmpq_vec_dot(fmpq_t res, const fmpq * vec1, const fmpq * vec2, slong len);
0067 
0068 /*  Input and output  ********************************************************/
0069 
0070 #ifdef FLINT_HAVE_FILE
0071 int _fmpq_vec_fprint(FILE * file, const fmpq * vec, slong len);
0072 #endif
0073 
0074 int _fmpq_vec_print(const fmpq * vec, slong len);
0075 
0076 #ifdef __cplusplus
0077 }
0078 #endif
0079 
0080 #endif