pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

    <small id='uz3Tj'></small><noframes id='uz3Tj'>

    1. <tfoot id='uz3Tj'></tfoot>
    2. <i id='uz3Tj'><tr id='uz3Tj'><dt id='uz3Tj'><q id='uz3Tj'><span id='uz3Tj'><b id='uz3Tj'><form id='uz3Tj'><ins id='uz3Tj'></ins><ul id='uz3Tj'></ul><sub id='uz3Tj'></sub></form><legend id='uz3Tj'></legend><bdo id='uz3Tj'><pre id='uz3Tj'><center id='uz3Tj'></center></pre></bdo></b><th id='uz3Tj'></th></span></q></dt></tr></i><div class="xvlblr7" id='uz3Tj'><tfoot id='uz3Tj'></tfoot><dl id='uz3Tj'><fieldset id='uz3Tj'></fieldset></dl></div>
      <legend id='uz3Tj'><style id='uz3Tj'><dir id='uz3Tj'><q id='uz3Tj'></q></dir></style></legend>

        <bdo id='uz3Tj'></bdo><ul id='uz3Tj'></ul>
      1. 改變uniform_int_distribution的范圍

        Vary range of uniform_int_distribution(改變uniform_int_distribution的范圍)
      2. <tfoot id='ds5gq'></tfoot>
          <bdo id='ds5gq'></bdo><ul id='ds5gq'></ul>

          • <legend id='ds5gq'><style id='ds5gq'><dir id='ds5gq'><q id='ds5gq'></q></dir></style></legend>
          • <small id='ds5gq'></small><noframes id='ds5gq'>

            <i id='ds5gq'><tr id='ds5gq'><dt id='ds5gq'><q id='ds5gq'><span id='ds5gq'><b id='ds5gq'><form id='ds5gq'><ins id='ds5gq'></ins><ul id='ds5gq'></ul><sub id='ds5gq'></sub></form><legend id='ds5gq'></legend><bdo id='ds5gq'><pre id='ds5gq'><center id='ds5gq'></center></pre></bdo></b><th id='ds5gq'></th></span></q></dt></tr></i><div class="5pfllxj" id='ds5gq'><tfoot id='ds5gq'></tfoot><dl id='ds5gq'><fieldset id='ds5gq'></fieldset></dl></div>

                  <tbody id='ds5gq'></tbody>

                1. 本文介紹了改變uniform_int_distribution的范圍的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  所以我有一個隨機對象:

                  So i have a Random object:

                  typedef unsigned int uint32;
                  
                  class Random {
                  public:
                      Random() = default;
                      Random(std::mt19937::result_type seed) : eng(seed) {}
                  
                  private:
                      uint32 DrawNumber();
                      std::mt19937 eng{std::random_device{}()};
                      std::uniform_int_distribution<uint32> uniform_dist{0, UINT32_MAX};
                  };
                  
                  uint32 Random::DrawNumber()
                  {
                      return uniform_dist(eng);
                  }
                  

                  我可以改變(通過另一個函數或其他方式)分布上限的最佳方法是什么?

                  What's the best way I can vary (through another function or otherwise) the upper bound of of the distribution?

                  (也愿意接受其他風格問題的建議)

                  (also willing to take advice on other style issues)

                  推薦答案

                  分發對象是輕量級的.當您需要隨機數時,只需構建一個新的分布.我在游戲引擎中使用這種方法,經過基準測試后,它可以與使用舊的 rand() 相媲美.

                  Distribution objects are lightweight. Simply construct a new distribution when you need a random number. I use this approach in a game engine, and, after benchmarking, it's comparable to using good old rand().

                  此外,我在 GoingNative 2013 直播中詢問了如何改變分發范圍,標準委員會成員 Stephen T. Lavavej 建議簡單地創建新分發,因為它不應該是表演問題.

                  Also, I've asked how to vary the range of distribution on GoingNative 2013 live stream, and Stephen T. Lavavej, a member of the standard committee, suggested to simply create new distributions, as it shouldn't be a performance issue.

                  以下是我將如何編寫您的代碼:

                  Here's how I would write your code:

                  using uint32 = unsigned int;
                  
                  class Random {
                  public:
                      Random() = default;
                      Random(std::mt19937::result_type seed) : eng(seed) {}
                      uint32 DrawNumber(uint32 min, uint32 max);
                  
                  private:        
                      std::mt19937 eng{std::random_device{}()};
                  };
                  
                  uint32 Random::DrawNumber(uint32 min, uint32 max)
                  {
                      return std::uniform_int_distribution<uint32>{min, max}(eng);
                  }
                  

                  這篇關于改變uniform_int_distribution的范圍的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  read input files, fastest way possible?(讀取輸入文件,最快的方法?)
                  The easiest way to read formatted input in C++?(在 C++ 中讀取格式化輸入的最簡單方法?)
                  Reading from .txt file into two dimensional array in c++(從 .txt 文件讀取到 C++ 中的二維數組)
                  How to simulate a key press in C++(如何在 C++ 中模擬按鍵按下)
                  Why doesn#39;t getline(cin, var) after cin.ignore() read the first character of the string?(為什么在 cin.ignore() 之后沒有 getline(cin, var) 讀取字符串的第一個字符?)
                  What is the cin analougus of scanf formatted input?(scanf 格式輸入的 cin 類比是什么?)

                  <tfoot id='yM9Tn'></tfoot>

                    <bdo id='yM9Tn'></bdo><ul id='yM9Tn'></ul>

                    1. <legend id='yM9Tn'><style id='yM9Tn'><dir id='yM9Tn'><q id='yM9Tn'></q></dir></style></legend>

                            <tbody id='yM9Tn'></tbody>
                          <i id='yM9Tn'><tr id='yM9Tn'><dt id='yM9Tn'><q id='yM9Tn'><span id='yM9Tn'><b id='yM9Tn'><form id='yM9Tn'><ins id='yM9Tn'></ins><ul id='yM9Tn'></ul><sub id='yM9Tn'></sub></form><legend id='yM9Tn'></legend><bdo id='yM9Tn'><pre id='yM9Tn'><center id='yM9Tn'></center></pre></bdo></b><th id='yM9Tn'></th></span></q></dt></tr></i><div class="dbbn7zv" id='yM9Tn'><tfoot id='yM9Tn'></tfoot><dl id='yM9Tn'><fieldset id='yM9Tn'></fieldset></dl></div>

                          <small id='yM9Tn'></small><noframes id='yM9Tn'>

                          • 主站蜘蛛池模板: 厂房出售_厂房仓库出租_写字楼招租_土地出售-中苣招商网-中苣招商网 | 自动售货机_无人售货机_专业的自动售货机运营商_免费投放售货机-广州富宏主官网 | 广东泵阀展|阀门展-广东国际泵管阀展览会 | 丹佛斯变频器-丹佛斯压力开关-变送器-广州市风华机电设备有限公司 | 快速门厂家批发_PVC快速卷帘门_高速门_高速卷帘门-广州万盛门业 快干水泥|桥梁伸缩缝止水胶|伸缩缝装置生产厂家-广东广航交通科技有限公司 | 塑料撕碎机_编织袋撕碎机_废纸撕碎机_生活垃圾撕碎机_废铁破碎机_河南鑫世昌机械制造有限公司 | 交联度测试仪-湿漏电流测试仪-双85恒温恒湿试验箱-常州市科迈实验仪器有限公司 | 临沂招聘网_人才市场_招聘信息_求职招聘找工作请认准【马头商标】 | 祝融环境-地源热泵多恒系统高新技术企业,舒适生活环境缔造者! | 在线浊度仪_悬浮物污泥浓度计_超声波泥位计_污泥界面仪_泥水界面仪-无锡蓝拓仪表科技有限公司 | 氢氧化钙设备, 氢氧化钙生产线-淄博惠琛工贸有限公司 | 厦门ISO认证|厦门ISO9001认证|厦门ISO14001认证|厦门ISO45001认证-艾索咨询专注ISO认证行业 | 无锡网站建设-做网站-建网站-网页设计制作-阿凡达建站公司 | 石家庄网站建设|石家庄网站制作|石家庄小程序开发|石家庄微信开发|网站建设公司|网站制作公司|微信小程序开发|手机APP开发|软件开发 | 道达尔润滑油-食品级润滑油-道达尔导热油-合成导热油,深圳道达尔代理商合-深圳浩方正大官网 | 变位机,焊接变位机,焊接变位器,小型变位机,小型焊接变位机-济南上弘机电设备有限公司 | 土壤养分检测仪|土壤水分|土壤紧实度测定仪|土壤墒情监测系统-土壤仪器网 | TYPE-C厂家|TYPE-C接口|TYPE-C防水母座|TYPE-C贴片-深圳步步精 | 西点培训学校_法式西点培训班_西点师培训_西点蛋糕培训-广州烘趣西点烘焙培训学院 | 电动百叶窗,开窗器,电动遮阳百叶,电动开窗机生产厂家-徐州鑫友工控科技发展有限公司 | 微信小程序定制,广州app公众号商城网站开发公司-广东锋火 | B2B网站_B2B免费发布信息网站_B2B企业贸易平台 - 企资网 | 昆明挖掘机修理厂_挖掘机翻新再制造-昆明聚力工程机械维修有限公司 | 屏蔽泵厂家,化工屏蔽泵_维修-淄博泵业 | 金属波纹补偿器厂家_不锈钢膨胀节价格_非金属伸缩节定制-庆达补偿器 | 识禅_对禅的了解,从这里开始 | 洛阳网站建设_洛阳网站优化_网站建设平台_洛阳香河网络科技有限公司 | 考试试题_试卷及答案_诗词单词成语 - 优易学 | 低压载波电能表-单相导轨式电能表-华邦电力科技股份有限公司-智能物联网综合管理平台 | 高楼航空障碍灯厂家哪家好_航空障碍灯厂家_广州北斗星障碍灯有限公司 | 耐压仪-高压耐压仪|徐吉电气| 知网论文检测系统入口_论文查重免费查重_中国知网论文查询_学术不端检测系统 | 水冷散热器_水冷电子散热器_大功率散热器_水冷板散热器厂家-河源市恒光辉散热器有限公司 | 冷却塔降噪隔音_冷却塔噪声治理_冷却塔噪音处理厂家-广东康明冷却塔降噪厂家 | 液压升降平台_剪叉式液压/导轨式升降机_传菜机定做「宁波日腾升降机厂家」 | 变色龙PPT-国内原创PPT模板交易平台 - PPT贰零 - 西安聚讯网络科技有限公司 | 青岛侦探_青岛侦探事务所_青岛劝退小三_青岛婚外情取证-青岛王军侦探事务所 | 连续油炸机,全自动油炸机,花生米油炸机-烟台茂源食品机械制造有限公司 | 组织研磨机-高通量组织研磨仪-实验室多样品组织研磨机-东方天净 传递窗_超净|洁净工作台_高效过滤器-传递窗厂家广州梓净公司 | 快速门厂家批发_PVC快速卷帘门_高速门_高速卷帘门-广州万盛门业 快干水泥|桥梁伸缩缝止水胶|伸缩缝装置生产厂家-广东广航交通科技有限公司 | 喷播机厂家_二手喷播机租赁_水泥浆洒布机-河南青山绿水机电设备有限公司 |