Hexadroid

Untitled

Feb 28th, 2021
589
311 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <algorithm>
  3. #include <iostream>
  4. #include <vector>
  5. #include <random>
  6.  
  7. int qmini, qitem;
  8.  
  9. std::vector<int> minibatch { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 25, 17 }; //for: random order the 15 minibatches
  10.  
  11. std::vector<int> item { 1, 2, 3, 4, 5, 6, 7, 88, 9 }; //for: random order the 9 items in the minibatch
  12.  
  13.  
  14.  
  15.  
  16.  
  17. int _tmain(int argc, _TCHAR* argv[])
  18. {
  19.  
  20.   std::random_device rd;
  21.   std::mt19937 gh(rd());
  22.  
  23. //cycle randomly through all minibatches
  24. std::shuffle ( minibatch.begin(), minibatch.end(), gh);  // in place no extra array
  25.                           for (std::vector<int>::iterator x=minibatch.begin(); x!=(minibatch.end()); ++x)
  26.                           {
  27.                                qmini = int(*x);
  28.  
  29.                                //cycle randomly through all items of current minibatch
  30.                                std::shuffle ( item.begin(), item.end(), gh);  // in place no extra array
  31.                                for (std::vector<int>::iterator y=item.begin(); y!=(item.end()); ++y)
  32.                                     {
  33.                                         qitem = int(*y);
  34.                                         printf("\nminibatch : %d  , item %d", qmini,qitem);
  35.  
  36.                                     }
  37.  
  38.  
  39.  
  40.  
  41.  
  42.                           }
  43.  
  44.  
  45.     scanf("%d",&qmini); //prevents console window closing
  46.  
  47.     return 0;
  48. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×