You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.8 KiB

25 years ago
  1. // General vectors of real numbers.
  2. #ifndef _CL_GV_REAL_H
  3. #define _CL_GV_REAL_H
  4. #include "cl_number.h"
  5. #include "cl_GV_complex.h"
  6. #include "cl_real_class.h"
  7. #include "cl_io.h"
  8. // A vector of real numbers is just a normal vector of numbers.
  9. typedef cl_heap_GV<cl_R> cl_heap_GV_R;
  10. struct cl_GV_R : public cl_GV<cl_R,cl_GV_N> {
  11. public:
  12. // Constructors.
  13. cl_GV_R ();
  14. cl_GV_R (const cl_GV_R&);
  15. explicit cl_GV_R (uintL len);
  16. // Assignment operators.
  17. cl_GV_R& operator= (const cl_GV_R&);
  18. // Private pointer manipulations.
  19. cl_GV_R (cl_heap_GV_R* p) : cl_GV<cl_R,cl_GV_N> (p) {}
  20. cl_GV_R (cl_private_thing p) : cl_GV<cl_R,cl_GV_N> (p) {}
  21. };
  22. inline cl_GV_R::cl_GV_R (const cl_GV_R& x) : cl_GV<cl_R,cl_GV_N> (as_cl_private_thing(x)) {}
  23. CL_DEFINE_ASSIGNMENT_OPERATOR(cl_GV_R,cl_GV_R)
  24. inline cl_GV_R::cl_GV_R (uintL len)
  25. : cl_GV<cl_R,cl_GV_N> ((cl_heap_GV_R*) cl_make_heap_GV_number(len)) {}
  26. inline cl_GV_R::cl_GV_R ()
  27. : cl_GV<cl_R,cl_GV_N> ((cl_heap_GV_R*) (cl_heap_GV_number*) cl_null_GV_number) {}
  28. // Copy a vector.
  29. inline const cl_GV_R copy (const cl_GV_R& vector)
  30. {
  31. return The(cl_GV_R) (copy((const cl_GV_N&) vector));
  32. }
  33. // Output.
  34. inline void fprint (cl_ostream stream, const cl_GV_R& x)
  35. {
  36. extern cl_print_flags cl_default_print_flags;
  37. 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_GV_number& vector);
  38. extern void print_real (cl_ostream stream, const cl_print_flags& flags, const cl_R& z);
  39. print_vector(stream, cl_default_print_flags,
  40. (void (*) (cl_ostream, const cl_print_flags&, const cl_number&))
  41. (void (*) (cl_ostream, const cl_print_flags&, const cl_R&))
  42. &print_real,
  43. x);
  44. }
  45. CL_DEFINE_PRINT_OPERATOR(cl_GV_R)
  46. #endif /* _CL_GV_REAL_H */