1 // General vectors of modular integers.
3 #ifndef _CL_GV_MODINTEGER_H
4 #define _CL_GV_MODINTEGER_H
6 #include "cln/modinteger.h"
7 #include "cln/GV_integer.h"
11 // A vector of modular integers (over the same modular integer ring)
12 // is just a normal vector of integers, with maxbits() operation.
14 #ifdef HAVE_TEMPLATE_NULL
17 struct cl_heap_GV<_cl_MI> : cl_heap {
18 cl_GV_inner<_cl_MI> v;
19 // here room for the elements
21 typedef cl_heap_GV<_cl_MI> cl_heap_GV_MI;
23 struct cl_GV_MI : public cl_GV<_cl_MI,cl_GV_any> {
27 cl_GV_MI (const cl_GV_MI&);
28 // Create a vector of modular integers.
29 cl_GV_MI (uintL len, cl_heap_modint_ring* R);
30 // Assignment operators.
31 cl_GV_MI& operator= (const cl_GV_MI&);
32 // Number m of bits allowed per element (-1 if unconstrained).
33 sintL maxbits () const
35 return ((const cl_heap_GV_I *) pointer)->maxbits();
38 inline cl_GV_MI::cl_GV_MI (const cl_GV_MI& x) : cl_GV<_cl_MI,cl_GV_any> (as_cl_private_thing(x)) {}
39 CL_DEFINE_ASSIGNMENT_OPERATOR(cl_GV_MI,cl_GV_MI)
40 inline cl_GV_MI::cl_GV_MI ()
41 : cl_GV<_cl_MI,cl_GV_any> ((cl_heap_GV_MI*) (cl_heap_GV_I*) cl_null_GV_I) {}
42 inline cl_GV_MI::cl_GV_MI (uintL len, cl_heap_modint_ring* R)
43 : cl_GV<_cl_MI,cl_GV_any> ((cl_heap_GV_MI*) cl_make_heap_GV_I(len,R->bits)) {}
46 inline const cl_GV_MI copy (const cl_GV_MI& vector)
48 return The(cl_GV_MI) (copy((const cl_GV_I&) vector));
53 #endif /* _CL_GV_MODINTEGER_H */