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