一个用MATLAB语言编写的摄像机标定工具箱,内容丰富

源代码在线查看: random.h

软件大小: 33616 K
上传用户: guo25621286
关键词: MATLAB 语言 编写 摄像机标定
下载地址: 免注册下载 普通下载 VIP

相关代码

				//
				// random.h
				//
				// $Id: random.h,v 1.1.1.1 2001/02/28 00:28:38 cstolte Exp $
				//
				
				#ifndef SGL_RANDOM_H
				#define SGL_RANDOM_H
				
				#include 
				
				class Vector2;
				class Vector3;
				
				class Random {
				public:
				    Random();                 // initialize from clock
				    Random(int seed);         // initialize from user seed
				    virtual ~Random();
				    
				    void init(int seed);
				
				//
				//      Marsaglia's subtract-with-borrow generator
				//      (The Annals of Applied Probability, 1991, 1(3), 462-480)
				//	  from code by J. Reeds 91/11/19.
				//
				//	Augmented by Bays & Durham's output shuffling.
				//
				    int int31();
				    int simpleInt31();
				
				//
				//	uniform random integer from 0 to n-1
				//
				    int integer(int n);
				
				//
				//	uniform distribution in [0, 1.0)
				//
				    double uniform();
				    double uniform() const { return ((Random *)this)->uniform(); }
				
				//
				//	uniform points in unit disk
				//      (first version returns xp^2 + yp^2)
				//
				    double disk(double *xp, double *yp);
				    Vector2 disk();
				
				//
				//	normal distribution
				//
				    double normal(double sigma, double mean);
				
				//
				//	random 2D unit vector
				//
				    void vector2(double *x, double *y);
				    Vector2 vector2();
				
				//
				//	random 3D unit vector
				//
				    void vector3(double *x, double *y, double *z);
				    Vector3 vector3();
				
				    double exponential(double mu);
				    double gamma(double a);
				    double beta(double a, double b);
				    double chi(double nu);
				    double Fdist(double nu1, double nu2);
				    double tdist(double nu);
				    int geometric(double p);
				    int binomial(double p, int trials);
				    int poisson(double mu);
				
				protected:
				//
				//  physically-random initial state
				//
				    int vec[48];
				    int feed, tap, borrow;
				    int V[571], Y;
				};
				
				#endif // SGL_RANDOM_H
							

相关资源