]> www.ginac.de Git - cln.git/blobdiff - src/complex/cl_C.h
INSTALL.CMake: proper installation command
[cln.git] / src / complex / cl_C.h
index f3c22bed7f62bf2beaaed52c0731d767508028d4..abbf12279000997efc2b535fdd2157c74fbc037f 100644 (file)
@@ -3,14 +3,16 @@
 #ifndef _CL_C_H
 #define _CL_C_H
 
-#include "cl_number.h"
-#include "cl_complex.h"
-#include "cl_sfloat_class.h"
-#include "cl_ffloat_class.h"
-#include "cl_dfloat_class.h"
-#include "cl_lfloat_class.h"
-#include "cl_macros.h"
-#include "cl_malloc.h"
+#include "cln/number.h"
+#include "cln/complex.h"
+#include "cln/sfloat_class.h"
+#include "cln/ffloat_class.h"
+#include "cln/dfloat_class.h"
+#include "cln/lfloat_class.h"
+#include "base/cl_macros.h"
+#include "cln/malloc.h"
+
+namespace cln {
 
 struct cl_heap_complex : cl_heap {
        cl_R realpart;
@@ -24,7 +26,7 @@ inline cl_heap_complex* TheComplex (const cl_number& obj)
 
 inline cl_heap_complex* allocate_complex (const cl_R& real, const cl_R& imag)
 {
-       cl_heap_complex* p = (cl_heap_complex*) cl_malloc_hook(sizeof(cl_heap_complex));
+       cl_heap_complex* p = (cl_heap_complex*) malloc_hook(sizeof(cl_heap_complex));
        p->refcount = 1;
        p->type = &cl_class_complex;
        p->realpart.pointer = real.pointer;     cl_inc_refcount(real);
@@ -46,28 +48,28 @@ inline cl_N::cl_N (cl_heap_complex* ptr)
 #endif
 
 // Type tests
-inline cl_boolean realp (const cl_N& x)
+inline bool realp (const cl_N& x)
 {
        if (x.pointer_p())
                if (x.heappointer->type == &cl_class_complex)
-                       return cl_false;
-       return cl_true;
+                       return false;
+       return true;
 }
-inline cl_boolean complexp (const cl_N& x)
+inline bool complexp (const cl_N& x)
 {
        if (x.pointer_p())
                if (x.heappointer->type == &cl_class_complex)
-                       return cl_true;
-       return cl_false;
+                       return true;
+       return false;
 }
 
 // Comparison with a fixnum.
-inline cl_boolean eq (const cl_N& x, sint32 y)
+inline bool eq (const cl_N& x, sint32 y)
 {
-       return (cl_boolean)(x.word == cl_combine(cl_FN_tag,y));
+       return x.word == cl_combine(cl_FN_tag,y);
 }
 
-inline cl_boolean exact_zerop (const cl_N& x)
+inline bool exact_zerop (const cl_N& x)
 {
        return eq(x,0);
 }
@@ -80,10 +82,10 @@ class cl_C : public cl_N {
 public:
 };
 
-inline cl_boolean realp (const cl_C& x)
-       { unused x; return cl_false; }
-inline cl_boolean complexp (const cl_C& x)
-       { unused x; return cl_true; }
+inline bool realp (const cl_C& x)
+       { cl_unused x; return false; }
+inline bool complexp (const cl_C& x)
+       { cl_unused x; return true; }
 
 
 // Liefert zu reellen Zahlen a und b /= Fixnum 0 die komplexe Zahl a+bi.
@@ -91,7 +93,7 @@ inline cl_boolean complexp (const cl_C& x)
 extern const cl_N complex_C (const cl_R& a, const cl_R& b);
 
 // realpart(x) liefert den Realteil der Zahl x.
-// imagpart(x) liefert den Imaginärteil der Zahl x.
+// imagpart(x) liefert den Imaginärteil der Zahl x.
 inline const cl_R& realpart (const cl_C& x)
 {
        return TheComplex(x)->realpart;
@@ -180,11 +182,12 @@ struct cl_C_R {
        cl_C_R (const cl_R& re, const cl_R& im) : realpart(re), imagpart(im) {}
 };
 
-// Hilfsfunktion für atanh und atan: u+iv := artanh(x+iy). Liefert cl_C_R(u,v).
+// Hilfsfunktion für atanh und atan: u+iv := artanh(x+iy). Liefert cl_C_R(u,v).
 extern const cl_C_R atanh (const cl_R& x, const cl_R& y);
 
-// Hilfsfunktion für asinh und asin: u+iv := arsinh(x+iy). Liefert cl_C_R(u,v).
+// Hilfsfunktion für asinh und asin: u+iv := arsinh(x+iy). Liefert cl_C_R(u,v).
 extern const cl_C_R asinh (const cl_R& x, const cl_R& y);
 
+}  // namespace cln
 
 #endif /* _CL_C_H */