EADST

C++: Get A Normal Distribution Random Number

C++: Get A Normal Distribution Random Number

#include  < random>

using namespace std;

int GetRamdomNumber(double std=2)
{   
    //work with VS2017, cannot compile in Linux
    random_device rd;
    mt19937 generator(rd());
    std::normal_distribution distribution(0, std);
    double rand_num = distribution(generator);
    //double rand_num = GenerateGaussianNoise(0, std);
    if (rand_num > 3 * std)
    {
        rand_num = 3 * std;
    }
    else if (rand_num < -3 * std)
    {
        rand_num = -3 * std;
    }
    /*int number = std::lround(rand_num);*/
    return rand_num;
}
相关标签
C++
About Me
XD
Goals determine what you are going to be.
Category
标签云
论文 Vmess Password PDF BF16 v2ray GPT4 SQL Pytorch Git Ptyhon FP16 Jupyter Template Linux 域名 LoRA Plotly 腾讯云 GoogLeNet icon 签证 Tiktoken XGBoost Quantize RGB Diagram Tracking Algorithm 强化学习 OpenAI Quantization Pillow DeepStream CUDA 音频 SPIE Knowledge Distillation logger Sklearn Website TTS 继承 PIP llama.cpp TSV LLAMA Transformers 飞书 Paper CSV Disk 图标 UI Tensor Numpy GPTQ Bipartite 顶会 Django API CEIR 关于博主 git Magnet SAM Qwen Card Miniforge Video ONNX NLTK SQLite uWSGI ModelScope PyTorch News CTC Clash Permission RAR CAM 阿里云 Input Zip 第一性原理 FlashAttention QWEN Claude Use 财报 NLP ChatGPT WAN LeetCode Review Dataset Pandas XML 算法题 PDB Cloudreve DeepSeek PyCharm Math SVR WebCrawler 多进程 ResNet-50 GGML Bert Excel 递归学习法 OCR Windows FastAPI 云服务器 GIT CC OpenCV Hungarian Datetime Qwen2.5 Plate VPN Domain HuggingFace YOLO TensorRT HaggingFace git-lfs Augmentation 版权 BeautifulSoup TensorFlow Freesound 搞笑 Hilton Random Proxy 多线程 COCO Firewall VGG-16 Color Mixtral 论文速读 报税 transformers Baidu Llama Translation Interview Docker Land VSCode 图形思考法 Gemma Paddle Github CLAP torchinfo LaTeX Bin BTC Base64 Streamlit Agent Image2Text NameSilo v0.dev Heatmap Rebuttal Food C++ scipy hf Safetensors Breakpoint FP32 Google InvalidArgumentError LLM Animate AI Statistics Hotel 公式 Nginx Bitcoin UNIX Jetson Crawler diffusers EXCEL mmap printf CV 净利润 tqdm Michelin MD5 Web uwsgi Logo Qwen2 Data Ubuntu 证件照 Shortcut Markdown FP8 Search FP64 IndexTTS2 Attention Pickle Vim JSON Conda Anaconda tar Python
站点统计

本站现有博文328篇,共被浏览852828

本站已经建立2560天!

热门文章
文章归档
回到顶部