]> www.ginac.de Git - cln.git/blob - include/cl_SV_integer.h
- Fixed a logic error in the checks of gmp3.
[cln.git] / include / cl_SV_integer.h
1 // Simple vectors of integers.
2
3 #ifndef _CL_SV_INTEGER_H
4 #define _CL_SV_INTEGER_H
5
6 #include "cl_number.h"
7 #include "cl_SV_rational.h"
8 #include "cl_integer_class.h"
9 #include "cl_io.h"
10
11 // A vector of integers is just a normal vector of rational numbers.
12
13 typedef cl_heap_SV<cl_I> cl_heap_SV_I;
14
15 struct cl_SV_I : public cl_SV<cl_I,cl_SV_RA> {
16 public:
17         // Constructors.
18         cl_SV_I () : cl_SV<cl_I,cl_SV_RA> ((cl_heap_SV_I*) (cl_heap_SV_number*) cl_null_SV_number) {};
19         cl_SV_I (const cl_SV_I&);
20         explicit cl_SV_I (uintL len) : cl_SV<cl_I,cl_SV_RA> ((cl_heap_SV_I*) cl_make_heap_SV_number(len)) {};
21         // Assignment operators.
22         cl_SV_I& operator= (const cl_SV_I&);
23 };
24 inline cl_SV_I::cl_SV_I (const cl_SV_I& x) : cl_SV<cl_I,cl_SV_RA> (as_cl_private_thing(x)) {}
25 CL_DEFINE_ASSIGNMENT_OPERATOR(cl_SV_I,cl_SV_I)
26
27 // Copy a simple vector.
28 inline const cl_SV_I copy (const cl_SV_I& vector)
29 {
30         return The(cl_SV_I) (copy((const cl_SV_RA&) vector));
31 }
32
33 // Output.
34 inline void fprint (cl_ostream stream, const cl_SV_I& x)
35 {
36         extern cl_print_flags cl_default_print_flags;
37         extern void print_vector (cl_ostream stream, const cl_print_flags& flags, void (* fun) (cl_ostream, const cl_print_flags&, const cl_number&), const cl_SV_number& vector);
38         extern void print_integer (cl_ostream stream, const cl_print_flags& flags, const cl_I& z);
39         print_vector(stream, cl_default_print_flags,
40                      (void (*) (cl_ostream, const cl_print_flags&, const cl_number&))
41                      (void (*) (cl_ostream, const cl_print_flags&, const cl_I&))
42                      &print_integer,
43                      x);
44 }
45 CL_DEFINE_PRINT_OPERATOR(cl_SV_I)
46
47 #endif /* _CL_SV_INTEGER_H */