www.pudn.com > Particlefilter_code.zip > Utility.h


///////////////////////////////////////////////////////////////////////////////////////////////// 
// 
//	Header file for Utility routines, Utility.h 
// 
//		XinFan 2003.3.2 
// 
// 
#ifndef _UTILITY_H 
#define	_UTILITY_H 
 
#include "DMatrix.h" 
 
double uniform_random(void); 
double gaussian_random(void); 
double evaluate_gaussian(double val, double sigma); 
void gaussian_vector(CDVector & Vec, double sigma = 1., double mean = 0.); 
bool bi_random(double prob); 
double atan_u(double x, double y); 
 
/*swap a and b*/ 
inline void SWAP(int &a,int &b); 
 
/*Find out the point at the line segment from (x0,y0) to (x1,y1) */ 
void line_pt(int x0, int y0, int x1, int y1, int* &x, int* &y, int &nNum); 
 
/* Set Vector/Matrix by another Vector/Matrix */ 
void SetVec(float *dest, const float *src, int nNum); 
/* Set Vector/Matrix by a scarlar value */ 
void SetVec(float *dest, float value, int Num); 
 
#endif