1 // Simple vectors of integers.
3 #ifndef _CL_SV_INTEGER_H
4 #define _CL_SV_INTEGER_H
6 #include "cln/number.h"
7 #include "cln/SV_rational.h"
8 #include "cln/integer_class.h"
13 // A vector of integers is just a normal vector of rational numbers.
15 typedef cl_heap_SV<cl_I> cl_heap_SV_I;
17 struct cl_SV_I : public cl_SV<cl_I,cl_SV_RA> {
20 cl_SV_I () : cl_SV<cl_I,cl_SV_RA> ((cl_heap_SV_I*) (cl_heap_SV_number*) cl_null_SV_number) {};
21 cl_SV_I (const cl_SV_I&);
22 explicit cl_SV_I (std::size_t len) : cl_SV<cl_I,cl_SV_RA> ((cl_heap_SV_I*) cl_make_heap_SV_number(len)) {};
23 // Assignment operators.
24 cl_SV_I& operator= (const cl_SV_I&);
26 inline cl_SV_I::cl_SV_I (const cl_SV_I& x) : cl_SV<cl_I,cl_SV_RA> (as_cl_private_thing(x)) {}
27 CL_DEFINE_ASSIGNMENT_OPERATOR(cl_SV_I,cl_SV_I)
29 // Copy a simple vector.
30 inline const cl_SV_I copy (const cl_SV_I& vector)
32 return The(cl_SV_I) (copy((const cl_SV_RA&) vector));
36 inline void fprint (std::ostream& stream, const cl_SV_I& x)
38 extern cl_print_flags default_print_flags;
39 extern void print_vector (std::ostream& stream, const cl_print_flags& flags, void (* fun) (std::ostream&, const cl_print_flags&, const cl_number&), const cl_SV_number& vector);
40 extern void print_integer (std::ostream& stream, const cl_print_flags& flags, const cl_I& z);
41 print_vector(stream, default_print_flags,
42 (void (*) (std::ostream&, const cl_print_flags&, const cl_number&))
43 (void (*) (std::ostream&, const cl_print_flags&, const cl_I&))
47 CL_DEFINE_PRINT_OPERATOR(cl_SV_I)
51 #endif /* _CL_SV_INTEGER_H */