Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Abstract class of complex numbers.
0002 
0003 #ifndef _CL_COMPLEX_CLASS_H
0004 #define _CL_COMPLEX_CLASS_H
0005 
0006 #include "cln/number.h"
0007 
0008 namespace cln {
0009 
0010 class cl_N : public cl_number {
0011 public:
0012 // Default constructor.
0013     cl_N ();
0014 // Copy constructor.
0015     cl_N (const cl_N&);
0016 // Converters.
0017 // Assignment operators.
0018     cl_N& operator= (const cl_N&);
0019 // Constructors and assignment operators from C numeric types.
0020     cl_N (const int);       // |argument| must be < 2^29
0021     cl_N (const unsigned int);  // argument must be < 2^29
0022     cl_N (const long);
0023     cl_N (const unsigned long);
0024     cl_N (const long long);
0025     cl_N (const unsigned long long);
0026     cl_N (const float);
0027     cl_N (const double);
0028     cl_N& operator= (const int);        // |argument| must be < 2^29
0029     cl_N& operator= (const unsigned int);   // argument must be < 2^29
0030     cl_N& operator= (const long);
0031     cl_N& operator= (const unsigned long);
0032     cl_N& operator= (const float);
0033     cl_N& operator= (const double);
0034     cl_N& operator= (const long long);
0035     cl_N& operator= (const unsigned long long);
0036 // Other constructors.
0037     cl_N (const char *);
0038 // Private constructor.
0039     cl_N (cl_private_thing);
0040     cl_N (struct cl_heap_complex *);
0041 public: // Ability to place an object at a given address.
0042     void* operator new (size_t size) { return malloc_hook(size); }
0043     void* operator new (size_t size, void* ptr) { (void)size; return ptr; }
0044     void operator delete (void* ptr) { free_hook(ptr); }
0045 private:
0046 // Friend declarations. They are for the compiler. Just ignore them.
0047 };
0048 
0049 // Private constructors.
0050 inline cl_N::cl_N (cl_private_thing ptr) : cl_number (ptr) {}
0051 // The assignment operators:
0052 CL_DEFINE_ASSIGNMENT_OPERATOR(cl_N, cl_N)
0053 // The default constructors.
0054 inline cl_N::cl_N ()
0055     : cl_number ((cl_private_thing) cl_combine(cl_FN_tag,0)) {}
0056 // The copy constructors.
0057 CL_DEFINE_COPY_CONSTRUCTOR2(cl_N,cl_number)
0058 // Constructors and assignment operators from C numeric types.
0059 CL_DEFINE_INT_CONSTRUCTORS(cl_N)
0060 CL_DEFINE_INT_ASSIGNMENT_OPERATORS(cl_N)
0061 CL_DEFINE_LONG_CONSTRUCTORS(cl_N)
0062 CL_DEFINE_LONG_ASSIGNMENT_OPERATORS(cl_N)
0063 CL_DEFINE_LONGLONG_CONSTRUCTORS(cl_N)
0064 CL_DEFINE_LONGLONG_ASSIGNMENT_OPERATORS(cl_N)
0065 CL_DEFINE_FLOAT_CONSTRUCTOR(cl_N)
0066 CL_DEFINE_DOUBLE_CONSTRUCTOR(cl_N)
0067 
0068 }  // namespace cln
0069 
0070 #endif /* _CL_COMPLEX_CLASS_H */