mathdefs.h

Go to the documentation of this file.
00001 
00002 // matrix.h
00003 // Creation : 20/01/2000
00004 // Author   : Leonardo FLOREZ VALENCIA
00005 //               l-florez@uniandes.edu.co
00006 //               lflorez@creatis.insa-lyon.fr
00007 // Copyright (C) 2000-2002 Leonardo FLOREZ VALENCIA
00008 //
00009 // This program is free software; you can redistribute it and/or
00010 // modify it under the terms of the GNU General Public License
00011 // as published by the Free Software Foundation; either version 2
00012 // of the License, or (at your option) any later version.
00013 //
00014 // This program is distributed in the hope that it will be useful,
00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 // GNU General Public License for more details.
00018 //
00019 // You should have received a copy of the GNU General Public License
00020 // along with this program; if not, write to the Free Software
00021 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00023 
00024 #ifndef GTMLIB__MATH__MATHDEFS__HXX
00025 #define GTMLIB__MATH__MATHDEFS__HXX
00026 
00027 #include <math.h>
00028 
00030 #define GTM_PI  3.14159265359
00032 #define GTM_PI2 6.28318530717
00034 #define GTM_NE  2.71828182846
00035 
00037 #define GTM_MIN( a, b ) ( ( ( a ) < ( b ) )? ( a ): ( b ) )
00039 #define GTM_MAX( a, b ) ( ( ( a ) > ( b ) )? ( a ): ( b ) )
00040 #define GTM_POW2( a ) ( ( a ) * ( a ) )
00041 
00042 // Useful typedefs.
00043 typedef unsigned char  uchar;
00044 typedef unsigned short ushort;
00045 typedef unsigned int   uint;
00046 
00047 namespace gtm
00048 {
00049 
00054     inline
00055     double round( double n )
00056     {
00057         double tmp;
00058         tmp = floor( n );
00059         if ( ( n - tmp ) < 0.5 )
00060             return( tmp );
00061         else
00062             return( ceil( n ) );
00063 
00064     }
00065 
00066 }
00067 
00068 #endif // GTMLIB__MATH__MATHDEFS__HXX
00069 
00070 // EOF - mathdefs.h

Generated on 18 Mar 2010 for creaMaracasVisu_lib by  doxygen 1.6.1