1 | // I/O of complex numbers. |
2 | |
3 | #ifndef _CL_COMPLEX_IO_H |
4 | #define _CL_COMPLEX_IO_H |
5 | |
6 | #include "cln/number_io.h" |
7 | #include "cln/complex.h" |
8 | |
9 | namespace cln { |
10 | |
11 | // Undocumented input functions |
12 | |
13 | extern const cl_N read_complex (const cl_read_flags& flags, const char * string, const char * string_limit, const char * * end_of_parse); |
14 | extern const cl_N read_complex (std::istream& stream, const cl_read_flags& flags); |
15 | |
16 | // Documented input functions |
17 | |
18 | inline std::istream& operator>> (std::istream& stream, cl_N& result) |
19 | { |
20 | extern cl_read_flags cl_N_read_flags; |
21 | result = read_complex(stream,cl_N_read_flags); |
22 | return stream; |
23 | } |
24 | |
25 | |
26 | // Undocumented output functions |
27 | |
28 | |
29 | // Documented output functions |
30 | |
31 | // Gibt eine komplexe Zahl aus. |
32 | // print_complex(stream,z); |
33 | // > z: komplexe Zahl |
34 | // > stream: Stream |
35 | extern void print_complex (std::ostream& stream, const cl_print_flags& flags, const cl_N& z); |
36 | extern void print_complex (std::ostream& stream, const cl_print_number_flags& flags, const cl_N& z); |
37 | |
38 | inline void fprint (std::ostream& stream, const cl_N& x) |
39 | { |
40 | extern cl_print_flags default_print_flags; |
41 | print_complex(stream,default_print_flags,x); |
42 | } |
43 | |
44 | CL_DEFINE_PRINT_OPERATOR(cl_N) |
45 | |
46 | } // namespace cln |
47 | |
48 | #endif /* _CL_COMPLEX_IO_H */ |
49 | |