www.pudn.com > Particlefilter_code.zip > Macro.h, change:2003-06-12,size:904b
//////////////////////////////////////////////////////////////////////////////////////
//
// Define the Macroes Used in the CvrDemo Project
//
// XinFan 2003.6.4
#ifndef _MACRO_H
#define _MACRO_H
/******************************NULL pointer****************************/
#ifndef NULL
#define NULL 0
#endif
/***************************** PI ************************************/
#ifndef PI
#define PI 3.1415926
#endif
/***************************** MIN & MAX *****************************/
#ifndef MAX
#define MAX((a),(b)) (((a)>(b))?(a):(b))
#endif
#ifndef MIN
#define MIN((a),(b)) (((a)<(b))?(a):(b))
#endif
inline int BOUND(int a, int lower_bound, int upper_bound)
{
a = MIN(a, upper_bound);
return (MAX(a, lower_bound));
}
inline float BOUND(float a, int lower_bound, int upper_bound)
{
a = MIN(a , upper_bound);
return (MAX(a, lower_bound));
}
#endif