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

📄 t-eorng.cpp

📁 这是linux下的进化计算的源代码。 === === === === === === === === === === === ===== check latest news at http:
💻 CPP
字号:
//-----------------------------------------------------------------------------// t-rng.cpp//-----------------------------------------------------------------------------// This file really needs to be implementes usign some stringent tests, for now// we simply check that the impementation of some methods does generally work...#ifdef HAVE_CONFIG_H#include <config.h>#endif#include <iostream>#include <eo>#include <utils/eoRNG.h>using namespace std;int main(){    const size_t num(10000);    double mean(100.);    double sigma(5.);    double sum(0.);    for(size_t i=0; i<num; ++i)        sum += abs(rng.normal(sigma));    sum /= double(num);    if(sum > sigma / 0.68) {        cerr << "Normal distribution seems out of bounds; "             << "rerun to make sure it wasn't a statistical outlier" << endl;        return -1;    }    sum = 0.;    for(size_t i=0; i<num; ++i)        sum += abs(rng.normal(mean, sigma) - mean);    sum /= double(num);    if(sum > sigma / 0.68) {        cerr << "Normal distribution seems out of bounds; "             << "rerun to make sure it wasn't a statistical outlier" << endl;        return -1;    }  return 0;}// Local Variables:// coding: iso-8859-1// mode: C++// c-file-offsets: ((c . 0))// c-file-style: "Stroustrup"// fill-column: 80// End:

⌨️ 快捷键说明

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