⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme.mc

📁 伪随机数生成器
💻 MC
字号:
	Monte Carlo Integrator   V1.4	This class defines an object that performs a Monte Carlo integration.	The class is designed to perform the definite integral over any number	of dimensions, but a limitation in the present version of the random	number generator (see below) limits the number of dimensions to no	more than 52 (the limit of the generator itself).	The function to integrate should have the prototype:		float function(float *x);	where the array x represents a vector of point to evaluate the function	at.	The class methods:		MonteIntegrator(Function f,const int d)			Declares the integrator to work with function f		and to integrate in d dimensions.  The number of dimensions		defaults to 1.		void iterations(const unsigned long int it)			Sets the number of iterations to use in the integration		(if not used, the integrator defaults to 10,000 iterations).		void minmax(const float min, const float max)			This method allows the user to inform the object of the		known minimum and maximum of the function to integrate.  If		this method is not called, the object will try to determine the		exterema on its own.  THIS IS AN OBSOLETE METHOD that is present		for backwards compatibility with older versions of this class,		it does not do anything.		float integral(const float a, const float b, const unsigned long it)			Does the integral between the limits a and b for 		1-dimensional integrals.  If the parameter it is supplied, then		that number of iterations is performed.		float integral(const float* a, const float* b,						 const unsigned long it)			Does the integral between the limits a[] and b[] for 		n-dimensional integrals.  If the parameter it is supplied, then		that number of iterations is performed.		By changing the definition of Real in monteint.hpp to double,		the object can work with doubles instead of floats.	The Random Number generator:	The random number generator used by this class generates QUASI-RANDOM	numbers.  Quasi-random numbers give up any attempt at independence of	successive values in order to obtain as uniform a coverage of the domain	as possible.  This type of coverage improves the convergence rate for	Monte Carlo integration.  Instead of the 1/Sqrt(N) convergence obtained	by the use of pseudo-random numbers, one gets (log(N))^d / N (slightly	slower than 1/N) convergence with quasi-random numbers (d is the number	of dimensions).	The implementation is my C++ version of the FORTRAN code described in the	Numerical Recipes column (by W.H. Press and S.A. Teukolsky) in the	Nov/Dec 1989 (V.3 No. 6) issue.	The Quasi-random number generator is presently (V1.5) set up for generating	data in up to 52 dimensions, but this can be extended if necessary.	(see the Press and Teukolsky article for details).	 Everett (Skip) Carter          Phone: 408-641-0645 FAX:  408-394-5561 Taygeta Scientific Inc.        INTERNET: skip@taygeta.com 1340 Munras Ave., Suite 223    UUCP:     ...!uunet!taygeta!skip Monterey, CA. 93940            WWW: http://www.taygeta.com/skip.html

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -