File: fq_vec_templates.h

package info (click to toggle)
flint 2.5.2-15
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 30,216 kB
  • ctags: 16,055
  • sloc: ansic: 289,367; cpp: 11,210; python: 1,280; sh: 649; makefile: 282
file content (136 lines) | stat: -rw-r--r-- 5,868 bytes parent folder | download | duplicates (3)
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/*=============================================================================

    This file is part of FLINT.

    FLINT is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    FLINT is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with FLINT; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA

=============================================================================*/
/******************************************************************************

    Copyright (C) 2013 Mike Hansen

******************************************************************************/

#ifdef T

#include "flint.h"
#include "templates.h"
#include "ulong_extras.h"

#ifdef __cplusplus
 extern "C" {
#endif

/*  Memory management  *******************************************************/

FLINT_DLL TEMPLATE(T, struct) * _TEMPLATE(T, vec_init)(slong len, const TEMPLATE(T, ctx_t) ctx);

FLINT_DLL void _TEMPLATE(T, vec_clear)(TEMPLATE(T, struct) * vec, slong len,
                             const TEMPLATE(T, ctx_t) ctx);

/*  Randomisation  ***********************************************************/
FLINT_DLL void _TEMPLATE(T, vec_randtest)(TEMPLATE(T, struct) * f, 
                           flint_rand_t state, 
                           slong len, 
                           const TEMPLATE(T, ctx_t) ctx);

/*  Norms  *******************************************************************/

/*  Input and output  ********************************************************/
FLINT_DLL int _TEMPLATE(T, vec_fprint)(FILE * file,
                             const TEMPLATE(T, struct) * vec,
                             slong len,
                             const TEMPLATE(T, ctx_t) ctx);

FQ_VEC_TEMPLATES_INLINE
int _TEMPLATE(T, vec_print)(const TEMPLATE(T, struct) * vec, slong len,
                            const TEMPLATE(T, ctx_t) ctx)
{
    return _TEMPLATE(T, vec_fprint)(stdout, vec, len, ctx);
}

/*  Conversions  *************************************************************/

/*  Assignment and basic manipulation  ***************************************/
FLINT_DLL void _TEMPLATE(T, vec_set)(TEMPLATE(T, struct) * v,
                      const TEMPLATE(T, struct) * f, 
                      slong len, const TEMPLATE(T, ctx_t) ctx);

FLINT_DLL void _TEMPLATE(T, vec_swap)(TEMPLATE(T, struct) * vec1,
                       TEMPLATE(T, struct) * vec2,
                       slong len2, const TEMPLATE(T, ctx_t) ctx);

FLINT_DLL void _TEMPLATE(T, vec_zero)(TEMPLATE(T, struct) * v, 
                       slong len,
                       const TEMPLATE(T, ctx_t) ctx);

FLINT_DLL void _TEMPLATE(T, vec_neg)(TEMPLATE(T, struct) * vec1,
                      const TEMPLATE(T, struct) * vec2,
                      slong len2,
                      const TEMPLATE(T, ctx_t) ctx);

/*  Comparison  **************************************************************/
FLINT_DLL int _TEMPLATE(T, vec_is_zero)(const TEMPLATE(T, struct) * vec, slong len,
                          const TEMPLATE(T, ctx_t) ctx);

FLINT_DLL int _TEMPLATE(T, vec_equal)(const TEMPLATE(T, struct) * vec1,
                        const TEMPLATE(T, struct) * vec2, slong len,
                        const TEMPLATE(T, ctx_t) ctx);

/*  Sorting  *****************************************************************/

/*  Addition  ****************************************************************/

FLINT_DLL void _TEMPLATE(T, vec_add)(TEMPLATE(T, struct) * res,
                           const TEMPLATE(T, struct) * vec1, 
                           const TEMPLATE(T, struct) * vec2, 
                           slong len2,
                           const TEMPLATE(T, ctx_t) ctx);

FLINT_DLL void _TEMPLATE(T, vec_sub)(TEMPLATE(T, struct) * res,
                           const TEMPLATE(T, struct) * vec1, 
                           const TEMPLATE(T, struct) * vec2, 
                           slong len2,
                           const TEMPLATE(T, ctx_t) ctx);

FLINT_DLL void _TEMPLATE(T, TEMPLATE(vec_scalar_addmul, T))(TEMPLATE(T, struct) * poly1, 
                                             const TEMPLATE(T, struct) * poly2,
                                             slong len2,
                                             const TEMPLATE(T, t) x,
                                             const TEMPLATE(T, ctx_t) ctx);

FLINT_DLL void _TEMPLATE(T, TEMPLATE(vec_scalar_submul, T))(TEMPLATE(T, struct) * poly1, 
                                             const TEMPLATE(T, struct) * poly2,
                                             slong len2,
                                             const TEMPLATE(T, t) x,
                                             const TEMPLATE(T, ctx_t) ctx);

FLINT_DLL void _TEMPLATE3(T, vec_scalar_mul, T) (TEMPLATE(T, struct) * poly1,
                                  const TEMPLATE(T, struct) * poly2,
                                  slong len2, const TEMPLATE(T, t) x,
                                  const TEMPLATE(T, ctx_t) ctx);
     
/* ****************************************************************************/
FLINT_DLL void _TEMPLATE(T, vec_dot)(TEMPLATE(T, t) res,
                      const TEMPLATE(T, struct) * vec1,
                      const TEMPLATE(T, struct) * vec2,
                      slong len2,
                      const TEMPLATE(T, ctx_t) ctx);

#ifdef __cplusplus
 }
#endif

#endif