Guest User

Untitled

a guest
Jul 9th, 2012
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.85 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 <shogun/lib/Time.h>
  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.     //const char* v[SIZE] = {"Russia", "England", "Germany", "USA", "France", "Spain"};
  22.  
  23.     int v[200000];
  24.     for (int i=0; i<200000; i++)
  25.     {
  26.         v[i]=CMath::random(0,200000);
  27.     }
  28.     CMath::init_random(228);
  29.  
  30.     CMap<int32_t, int32_t>* map = new CMap<int32_t, int32_t>(200000/1024, 200000/1024);
  31.  
  32.     CTime t;
  33.     for (int i=0; i<200000; i++)
  34.     {
  35.         map->add(i, v[i]);
  36.     }
  37.     t.cur_time_diff(true);
  38.  
  39.     SG_UNREF(map);
  40.  
  41.     exit_shogun();
  42.     return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment