Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-19 08:08:33

0001 // Simple vectors of real numbers.
0002 
0003 #ifndef _CL_SV_REAL_H
0004 #define _CL_SV_REAL_H
0005 
0006 #include "cln/number.h"
0007 #include "cln/SV_complex.h"
0008 #include "cln/real_class.h"
0009 #include "cln/io.h"
0010 
0011 namespace cln {
0012 
0013 // A vector of real numbers is just a normal vector of numbers.
0014 
0015 typedef cl_heap_SV<cl_R> cl_heap_SV_R;
0016 
0017 struct cl_SV_R : public cl_SV<cl_R,cl_SV_N> {
0018 public:
0019     // Constructors.
0020     cl_SV_R () : cl_SV<cl_R,cl_SV_N> ((cl_heap_SV_R*) (cl_heap_SV_number*) cl_null_SV_number) {};
0021     cl_SV_R (const cl_SV_R&);
0022     explicit cl_SV_R (std::size_t len) : cl_SV<cl_R,cl_SV_N> ((cl_heap_SV_R*) cl_make_heap_SV_number(len)) {};
0023     // Assignment operators.
0024     cl_SV_R& operator= (const cl_SV_R&);
0025     // Private pointer manipulations.
0026     cl_SV_R (cl_heap_SV_R* p) : cl_SV<cl_R,cl_SV_N> (p) {}
0027     cl_SV_R (cl_private_thing p) : cl_SV<cl_R,cl_SV_N> (p) {}
0028 };
0029 inline cl_SV_R::cl_SV_R (const cl_SV_R& x) : cl_SV<cl_R,cl_SV_N> (as_cl_private_thing(x)) {}
0030 CL_DEFINE_ASSIGNMENT_OPERATOR(cl_SV_R,cl_SV_R)
0031 
0032 // Copy a simple vector.
0033 inline const cl_SV_R copy (const cl_SV_R& vector)
0034 {
0035     return The(cl_SV_R) (copy((const cl_SV_N&) vector));
0036 }
0037 
0038 // Output.
0039 inline void fprint (std::ostream& stream, const cl_SV_R& x)
0040 {
0041     extern cl_print_flags default_print_flags;
0042     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);
0043     extern void print_real (std::ostream& stream, const cl_print_flags& flags, const cl_R& z);
0044     print_vector(stream, default_print_flags,
0045                  (void (*) (std::ostream&, const cl_print_flags&, const cl_number&))
0046                  (void (*) (std::ostream&, const cl_print_flags&, const cl_R&))
0047                  &print_real,
0048                  x);
0049 }
0050 CL_DEFINE_PRINT_OPERATOR(cl_SV_R)
0051 
0052 }  // namespace cln
0053 
0054 #endif /* _CL_SV_REAL_H */