Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

misc.h

Go to the documentation of this file.
00001 /*-*-c++-*-*****************************************************************
00002                           misc.h  -  description
00003                              -------------------
00004     begin                : Wed May 8 2000
00005     copyright            : (C) 2002 by Peter Haase,  T. May, 
00006                            (C) 2004 Christian Stimming
00007     email                : mail@p-haase.de
00008  ***************************************************************************/
00009 
00010 /***************************************************************************
00011  *                                                                         *
00012  *   This library is free software; you can redistribute it and/or         *
00013  *   modify it under the terms of the GNU Lesser General Public            *
00014  *   License as published by the Free Software Foundation; either          *
00015  *   version 2.1 of the License, or (at your option) any later version.    *
00016  *                                                                         *
00017  *   This library is distributed in the hope that it will be useful,       *
00018  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00019  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00020  *   Lesser General Public License for more details.                       *
00021  *                                                                         *
00022  *   You should have received a copy of the GNU Lesser General Public      *
00023  *   License along with this library; if not, write to the Free Software   *
00024  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston,                 *
00025  *   MA  02111-1307  USA                                                   *
00026  *                                                                         *
00027  ***************************************************************************/
00028 
00040 #ifndef MY_MISC_HEADER
00041 #define MY_MISC_HEADER
00042 
00043 
00044 #include <complex>
00045 #include <cmath>
00046 
00049 #ifndef DEBUG
00050 #  ifndef NDEBUG
00051 #    define DEBUG    0
00052 #  else
00053 #    if NDEBUG == 0
00054 #      define DEBUG 1
00055 #    else
00056 #      define DEBUG 0
00057 #   endif
00058 # endif
00059 #endif
00060 
00061 #ifndef SECURITY
00062 
00069 #  define SECURITY 1
00070 #endif
00071 
00072 
00073 namespace simth
00074 {
00075 
00080   typedef std::complex<double> Complex;
00081 
00088 #ifndef M_PI
00089 
00090 #  define M_PI           3.14159265358979323846  
00091 #endif
00092 #ifndef M_SQRT2
00093 
00094 #  define M_SQRT2        1.41421356237309504880  
00095 #endif
00096 #ifndef M_SQRT1_2
00097 
00098 #  define M_SQRT1_2      0.70710678118654752440
00099 #endif
00100 
00101 
00105   const double PI = M_PI;
00107   const double PI2 = 2.0 * PI;
00108 
00111   const long double ZERO_THRESHOLD = 1.0E-10;
00112 
00119   const unsigned int  MAX_BITS_PER_SYMBOL = 8;
00120 
00128   const unsigned int  MAX_STATES_PER_SYMBOL = 1<<MAX_BITS_PER_SYMBOL;
00129 
00131   const unsigned int MAX_GENERATOR_POLYNOM = 10000;
00133 
00153 
00154 
00162   template <class Type>
00163   inline Type sqr(Type a)
00164   {
00165     return a * a;
00166   }
00167 
00169 
00170 } // namespace
00171 
00172 #endif // MY_MISC_HEADER

Generated on Mon Apr 24 21:19:19 2006 for simthetic by  doxygen 1.4.1