Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

defs.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------
00002 //               The Motion Strategy Library (MSL)
00003 //----------------------------------------------------------------------
00004 //
00005 // Copyright (c) University of Illinois and Steven M. LaValle.  
00006 // All Rights Reserved.
00007 // 
00008 // Permission to use, copy, and distribute this software and its 
00009 // documentation is hereby granted free of charge, provided that 
00010 // (1) it is not a component of a commercial product, and 
00011 // (2) this notice appears in all copies of the software and
00012 //     related documentation. 
00013 // 
00014 // The University of Illinois and the author make no representations
00015 // about the suitability or fitness of this software for any purpose.  
00016 // It is provided "as is" without express or implied warranty.
00017 //----------------------------------------------------------------------
00018 #ifndef MSL_DEFS_H
00019 #define MSL_DEFS_H
00020 
00021 #ifndef PI
00022 #define PI 3.1415926535897932385
00023 #endif 
00024 #ifndef INFINITY
00025 #define INFINITY 1.0e40
00026 #endif
00027 #ifndef sqr
00028 #define sqr(x) ((x)*(x))
00029 #endif
00030 #ifndef min
00031 #define min(x,y) ((x<y) ? x : y)
00032 #endif
00033 #ifndef max
00034 #define max(x,y) ((x>y) ? x : y)
00035 #endif
00036 
00037 #ifndef MSL_GLOBAL_VARS
00038 #define MSL_GLOBAL_VARS
00039         #ifdef WIN32
00040                 #include <fstream>
00041                 #include <iostream>
00042                 using namespace std;
00043         #else
00044                 #include <iostream.h>
00045                 #include <fstream.h>
00046         #endif
00047 static std::ifstream _msl_fin;
00048 #endif
00049 
00050 #define READ_OPTIONAL_PARAMETER(F)\
00051 _msl_fin.clear();\
00052 _msl_fin.open((FilePath+""#F"").c_str());\
00053 if (_msl_fin) {_msl_fin >> F;}\
00054 _msl_fin.close();\
00055 
00056 #define READ_PARAMETER_OR_DEFAULT(F,D)\
00057 _msl_fin.clear();\
00058 _msl_fin.open((FilePath+""#F"").c_str());\
00059 if (_msl_fin) {_msl_fin >> F;}\
00060 else F = D;\
00061 _msl_fin.close();\
00062 
00063 #define READ_PARAMETER_OR_ERROR(F)\
00064 _msl_fin.clear();\
00065 _msl_fin.open((FilePath+""#F"").c_str());\
00066 if (_msl_fin) {_msl_fin >> F; _msl_fin.close();}\
00067 else {cerr << "Error reading "#F"\n"; exit(-1);}\
00068 _msl_fin.close();\
00069   
00070 // Convenient list iterator
00071 #define forall(x,S)\
00072 for (x = S.begin(); x != S.end(); x++)\
00073 
00074 #endif
00075 
00076 
00077 
Motion Strategy Library


Web page maintained by Steve LaValle
Partial support provided by NSF CAREER Award IRI-970228 (LaValle), Honda Research.
Contributors: Anna Atramentov, Peng Cheng, James Kuffner, Steve LaValle, and Libo Yang.