]> www.ginac.de Git - cln.git/blob - include/cl_SV_real.h
Make @exec_prefix@ usable in shell scripts.
[cln.git] / include / cl_SV_real.h
1 // Simple vectors of real numbers.
2
3 #ifndef _CL_SV_REAL_H
4 #define _CL_SV_REAL_H
5
6 #include "cl_number.h"
7 #include "cl_SV_complex.h"
8 #include "cl_real_class.h"
9 #include "cl_io.h"
10
11 // A vector of real numbers is just a normal vector of numbers.
12
13 typedef cl_heap_SV<cl_R> cl_heap_SV_R;
14
15 struct cl_SV_R : public cl_SV<cl_R,cl_SV_N> {
16 public:
17         // Constructors.
18         cl_SV_R () : cl_SV<cl_R,cl_SV_N> ((cl_heap_SV_R*) (cl_heap_SV_number*) cl_null_SV_number) {};
19         cl_SV_R (const cl_SV_R&);
20         explicit cl_SV_R (uintL len) : cl_SV<cl_R,cl_SV_N> ((cl_heap_SV_R*) cl_make_heap_SV_number(len)) {};
21         // Assignment operators.
22         cl_SV_R& operator= (const cl_SV_R&);
23         // Private pointer manipulations.
24         cl_SV_R (cl_heap_SV_R* p) : cl_SV<cl_R,cl_SV_N> (p) {}
25         cl_SV_R (cl_private_thing p) : cl_SV<cl_R,cl_SV_N> (p) {}
26 };
27 inline cl_SV_R::cl_SV_R (const cl_SV_R& x) : cl_SV<cl_R,cl_SV_N> (as_cl_private_thing(x)) {}
28 CL_DEFINE_ASSIGNMENT_OPERATOR(cl_SV_R,cl_SV_R)
29
30 // Copy a simple vector.
31 inline const cl_SV_R copy (const cl_SV_R& vector)
32 {
33         return The(cl_SV_R) (copy((const cl_SV_N&) vector));
34 }
35
36 // Output.
37 inline void fprint (cl_ostream stream, const cl_SV_R& x)
38 {
39         extern cl_print_flags cl_default_print_flags;
40         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);
41         extern void print_real (cl_ostream stream, const cl_print_flags& flags, const cl_R& z);
42         print_vector(stream, cl_default_print_flags,
43                      (void (*) (cl_ostream, const cl_print_flags&, const cl_number&))
44                      (void (*) (cl_ostream, const cl_print_flags&, const cl_R&))
45                      &print_real,
46                      x);
47 }
48 CL_DEFINE_PRINT_OPERATOR(cl_SV_R)
49
50 #endif /* _CL_SV_REAL_H */