Advertisement
Guest User

Untitled

a guest
Jul 9th, 2012
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1. #include <shogun/lib/Map.h>
  2. #include <shogun/io/SGIO.h>
  3. #include <shogun/base/init.h>
  4. #include <shogun/lib/common.h>
  5. #include <shogun/mathematics/Math.h>
  6.  
  7. #include <ctime>
  8.  
  9. using namespace shogun;
  10.  
  11. #define SIZE 6
  12.  
  13. void print_message(FILE* target, const char* str)
  14. {
  15.     fprintf(target, "%s", str);
  16. }
  17.  
  18. int main(int argc, char** argv)
  19. {
  20.     init_shogun(&print_message, &print_message, &print_message);
  21.  
  22.     int v[200000];
  23.     for (int i=0; i<200000; i++)
  24.     {
  25.         v[i]=CMath::random(0,200000);
  26.     }
  27.     CMath::init_random(228);
  28.  
  29.     CMap<int32_t, int32_t>* map = new CMap<int32_t, int32_t>(200000/1024, 200000/1024);
  30.  
  31.     for (int i=0; i<200000; i++)
  32.     {
  33.         map->add(i, v[i]);
  34.     }
  35.  
  36.     SG_UNREF(map);
  37.  
  38.     exit_shogun();
  39.     return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement