Advertisement
Guest User

Untitled

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