]> www.ginac.de Git - cln.git/commitdiff
Enable modifying operators by default.
authorRichard Kreckel <kreckel@ginac.de>
Wed, 6 Feb 2008 23:58:21 +0000 (23:58 +0000)
committerRichard Kreckel <kreckel@ginac.de>
Wed, 6 Feb 2008 23:58:21 +0000 (23:58 +0000)
doc/cln.texi
include/cln/complex.h
include/cln/dfloat.h
include/cln/ffloat.h
include/cln/float.h
include/cln/integer.h
include/cln/lfloat.h
include/cln/rational.h
include/cln/real.h
include/cln/sfloat.h

index 7d60d9f794ee432465cd90991a2401e324f8910e..47a3bcc57b4cce2dc5eae19d0903464262414806 100644 (file)
@@ -157,7 +157,7 @@ Functions on numbers
 * Functions on floating-point numbers::  
 * Conversion functions::        
 * Random number generators::    
-* Obfuscating operators::       
+* Modifying operators::       
 
 Constructing numbers
 
@@ -931,7 +931,7 @@ objects of type @code{cl_I}, it should @code{#include <cln/integer.h>}.
 * Functions on floating-point numbers::  
 * Conversion functions::        
 * Random number generators::    
-* Obfuscating operators::       
+* Modifying operators::       
 @end menu
 
 @node Constructing numbers
@@ -2501,22 +2501,13 @@ if @code{n} is a float.
 @end table
 
 
-@node Obfuscating operators
-@section Obfuscating operators
+@node Modifying operators
+@section Modifying operators
 @cindex modifying operators
 
 The modifying C/C++ operators @code{+=}, @code{-=}, @code{*=}, @code{/=},
 @code{&=}, @code{|=}, @code{^=}, @code{<<=}, @code{>>=}
-are not available by default because their
-use tends to make programs unreadable. It is trivial to get away without
-them. However, if you feel that you absolutely need these operators
-to get happy, then add
-@example
-#define WANT_OBFUSCATING_OPERATORS
-@end example
-@cindex @code{WANT_OBFUSCATING_OPERATORS}
-to the beginning of your source files, before the inclusion of any CLN
-include files. This flag will enable the following operators:
+are all available.
 
 For the classes @code{cl_N}, @code{cl_R}, @code{cl_RA},
 @code{cl_F}, @code{cl_SF}, @code{cl_FF}, @code{cl_DF}, @code{cl_LF}:
@@ -2569,7 +2560,7 @@ The prefix operator @code{--x}.
 The postfix operator @code{x--}.
 @end table
 
-Note that by using these obfuscating operators, you wouldn't gain efficiency:
+Note that by using these modifying operators, you don't gain efficiency:
 In CLN @samp{x += y;} is exactly the same as  @samp{x = x+y;}, not more
 efficient.
 
index dc4aaccf1745edb0909ad35c3e50e22c839cd04e..fe74aa46712f809e41f99407d254a6f0e60656c1 100644 (file)
@@ -138,7 +138,6 @@ extern const cl_N acos (const cl_N& z);
 extern const cl_N acosh (const cl_N& z);
 
 
-#ifdef WANT_OBFUSCATING_OPERATORS
 // This could be optimized to use in-place operations.
 inline cl_N& operator+= (cl_N& x, const cl_N& y) { return x = x + y; }
 inline cl_N& operator++ /* prefix */ (cl_N& x) { return x = plus1(x); }
@@ -148,7 +147,6 @@ inline cl_N& operator-- /* prefix */ (cl_N& x) { return x = minus1(x); }
 inline void operator-- /* postfix */ (cl_N& x, int dummy) { (void)dummy; x = minus1(x); }
 inline cl_N& operator*= (cl_N& x, const cl_N& y) { return x = x * y; }
 inline cl_N& operator/= (cl_N& x, const cl_N& y) { return x = x / y; }
-#endif
 
 
 // Runtime typing support.
index de1053817f90627ec2df0106763fff4ac11f5c0b..edb8574ad0ee3cd05f8c0ee71ac45fb2cdab2c9b 100644 (file)
@@ -293,7 +293,6 @@ extern float float_approx (const cl_DF& x);
 extern double double_approx (const cl_DF& x);
 
 
-#ifdef WANT_OBFUSCATING_OPERATORS
 // This could be optimized to use in-place operations.
 inline cl_DF& operator+= (cl_DF& x, const cl_DF& y) { return x = x + y; }
 inline cl_DF& operator+= (cl_DF& x, const double y) { return x = x + y; }
@@ -307,7 +306,6 @@ inline cl_DF& operator*= (cl_DF& x, const cl_DF& y) { return x = x * y; }
 inline cl_DF& operator*= (cl_DF& x, const double y) { return x = x * y; }
 inline cl_DF& operator/= (cl_DF& x, const cl_DF& y) { return x = x / y; }
 inline cl_DF& operator/= (cl_DF& x, const double y) { return x = x / y; }
-#endif
 
 
 /* */
index 1e98cfcb61cb30fbfdd4bd94e3699fad07176279..9c150bfae5b00fff50f8912d11f4e8ecc07c438e 100644 (file)
@@ -293,7 +293,6 @@ extern float float_approx (const cl_FF& x);
 extern double double_approx (const cl_FF& x);
 
 
-#ifdef WANT_OBFUSCATING_OPERATORS
 // This could be optimized to use in-place operations.
 inline cl_FF& operator+= (cl_FF& x, const cl_FF& y) { return x = x + y; }
 inline cl_FF& operator+= (cl_FF& x, const float y) { return x = x + y; }
@@ -307,7 +306,6 @@ inline cl_FF& operator*= (cl_FF& x, const cl_FF& y) { return x = x * y; }
 inline cl_FF& operator*= (cl_FF& x, const float y) { return x = x * y; }
 inline cl_FF& operator/= (cl_FF& x, const cl_FF& y) { return x = x / y; }
 inline cl_FF& operator/= (cl_FF& x, const float y) { return x = x / y; }
-#endif
 
 
 CL_REQUIRE(cl_ieee)
index 6bfd2bb1ad750cf61e34ce98d04a1810440833a0..1ab2d3d2c5feac32f6ef4bf6be0b0cdd4e7ad093 100644 (file)
@@ -716,7 +716,6 @@ inline const cl_F random_F (const cl_F& n)
        { return random_F(default_random_state,n); }
 
 
-#ifdef WANT_OBFUSCATING_OPERATORS
 // This could be optimized to use in-place operations.
 inline cl_F& operator+= (cl_F& x, const cl_F& y) { return x = x + y; }
 inline cl_F& operator+= (cl_F& x, const float y) { return x = x + y; }
@@ -734,7 +733,6 @@ inline cl_F& operator*= (cl_F& x, const double y) { return x = x * y; }
 inline cl_F& operator/= (cl_F& x, const cl_F& y) { return x = x / y; }
 inline cl_F& operator/= (cl_F& x, const float y) { return x = x / y; }
 inline cl_F& operator/= (cl_F& x, const double y) { return x = x / y; }
-#endif
 
 // Thrown when a floating-point exception occurs.
 class floating_point_exception : public runtime_exception {
index d9c3795bbd5194fd5ff45730f0d2ac631dc920a0..2aaf9135475cdbd6069c449457c76b1ca1e7dd8d 100644 (file)
@@ -193,12 +193,10 @@ inline const cl_I operator& (const cl_I& x, const cl_I& y)
        { return logand(x,y); }
 inline const cl_I operator~ (const cl_I& x)
        { return lognot(x); }
-#ifdef WANT_OBFUSCATING_OPERATORS
 // This could be optimized to use in-place operations.
 inline cl_I& operator|= (cl_I& x, const cl_I& y) { return x = x | y; }
 inline cl_I& operator^= (cl_I& x, const cl_I& y) { return x = x ^ y; }
 inline cl_I& operator&= (cl_I& x, const cl_I& y) { return x = x & y; }
-#endif
 
 
 // Addition/Subtraktion von Integers
@@ -616,7 +614,6 @@ inline const cl_I testrandom_I ()
        { return testrandom_I(default_random_state); }
 
 
-#ifdef WANT_OBFUSCATING_OPERATORS
 // This could be optimized to use in-place operations.
 inline cl_I& operator+= (cl_I& x, const cl_I& y) { return x = x + y; }
 inline cl_I& operator+= (cl_I& x, const int y) { return x = x + y; }
@@ -651,7 +648,6 @@ inline const cl_I operator% (const cl_I& x, const cl_I& y) { return rem(x,y); }
 inline cl_I& operator/= (cl_I& x, const cl_I& y) { return x = x / y; }
 inline cl_I& operator%= (cl_I& x, const cl_I& y) { return x = x % y; }
 #endif
-#endif
 
 
 // Runtime typing support.
index 5327ba4613614e672cf1615c8ba1992a55e8208f..80801c894401b09d663c5599b199ec8db7e0fe5b 100644 (file)
@@ -407,7 +407,6 @@ extern float float_approx (const cl_LF& x);
 extern double double_approx (const cl_LF& x);
 
 
-#ifdef WANT_OBFUSCATING_OPERATORS
 // This could be optimized to use in-place operations.
 inline cl_LF& operator+= (cl_LF& x, const cl_LF& y) { return x = x + y; }
 inline cl_LF& operator++ /* prefix */ (cl_LF& x) { return x = plus1(x); }
@@ -417,7 +416,6 @@ inline cl_LF& operator-- /* prefix */ (cl_LF& x) { return x = minus1(x); }
 inline void operator-- /* postfix */ (cl_LF& x, int dummy) { (void)dummy; x = minus1(x); }
 inline cl_LF& operator*= (cl_LF& x, const cl_LF& y) { return x = x * y; }
 inline cl_LF& operator/= (cl_LF& x, const cl_LF& y) { return x = x / y; }
-#endif
 
 
 // Runtime typing support.
index d6864a783a390618aab3512823bfe2f03ba18a62..08e558a81bb34ffbb86b8a52078b65753b53f1ad 100644 (file)
@@ -315,7 +315,6 @@ extern float float_approx (const cl_RA& x);
 extern double double_approx (const cl_RA& x);
 
 
-#ifdef WANT_OBFUSCATING_OPERATORS
 // This could be optimized to use in-place operations.
 inline cl_RA& operator+= (cl_RA& x, const cl_RA& y) { return x = x + y; }
 inline cl_RA& operator+= (cl_RA& x, const int y) { return x = x + y; }
@@ -341,7 +340,6 @@ inline cl_RA& operator-- /* prefix */ (cl_RA& x) { return x = minus1(x); }
 inline void operator-- /* postfix */ (cl_RA& x, int dummy) { (void)dummy; x = minus1(x); }
 inline cl_RA& operator*= (cl_RA& x, const cl_RA& y) { return x = x * y; }
 inline cl_RA& operator/= (cl_RA& x, const cl_RA& y) { return x = x / y; }
-#endif
 
 
 // Runtime typing support.
index eede270a464eb7d65fd9ad7f193363d3b8ecdce3..cfcc631f0706b24d29425812a12ed4d9364e683b 100644 (file)
@@ -525,7 +525,6 @@ inline const cl_R random_R (const cl_R& n)
        { return random_R(default_random_state,n); }
 
 
-#ifdef WANT_OBFUSCATING_OPERATORS
 // This could be optimized to use in-place operations.
 inline cl_R& operator+= (cl_R& x, const cl_R& y) { return x = x + y; }
 inline cl_F& operator+= (cl_F& x, const cl_R& y) { return x = x + y; }
@@ -608,7 +607,6 @@ inline cl_F& operator/= (cl_F& x, const unsigned long y) { return x = x / y; }
 inline cl_F& operator/= (cl_F& x, const long long y) { return x = x / y; }
 inline cl_F& operator/= (cl_F& x, const unsigned long long y) { return x = x / y; }
 #endif
-#endif
 
 
 // Complex operations, trivial for reals
index 396c8da1a5192f94e2a7f7973f54c7fb819663ea..20348b751620579ef658967147d9408c806355ee 100644 (file)
@@ -273,7 +273,6 @@ extern float float_approx (const cl_SF& x);
 extern double double_approx (const cl_SF& x);
 
 
-#ifdef WANT_OBFUSCATING_OPERATORS
 // This could be optimized to use in-place operations.
 inline cl_SF& operator+= (cl_SF& x, const cl_SF& y) { return x = x + y; }
 inline cl_SF& operator++ /* prefix */ (cl_SF& x) { return x = plus1(x); }
@@ -283,7 +282,6 @@ inline cl_SF& operator-- /* prefix */ (cl_SF& x) { return x = minus1(x); }
 inline void operator-- /* postfix */ (cl_SF& x, int dummy) { (void)dummy; x = minus1(x); }
 inline cl_SF& operator*= (cl_SF& x, const cl_SF& y) { return x = x * y; }
 inline cl_SF& operator/= (cl_SF& x, const cl_SF& y) { return x = x / y; }
-#endif
 
 
 // Runtime typing support.