Advertisement
Guest User

Untitled

a guest
Jul 8th, 2013
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.89 KB | None | 0 0
  1.  
  2. #include <shogun/io/SGIO.h>
  3. #include <shogun/base/init.h>
  4. #include <shogun/lib/SGString.h>
  5. #include <shogun/lib/SGVector.h>
  6. #include <shogun/lib/DynamicObjectArray.h>
  7. #include <shogun/labels/StructuredLabels.h>
  8. #include <shogun/lib/List.h>
  9.  
  10. using namespace shogun;
  11.  
  12. #include <iostream>
  13. using namespace std;
  14.  
  15. int main(int argc, char** argv)
  16. {
  17.     init_shogun_with_defaults();
  18.  
  19.     CList* ll1 = new CList(true);
  20.     CList* ll2 = new CList(true);
  21.  
  22.     CDynamicObjectArray* darr = new CDynamicObjectArray(100);
  23.     SG_REF(darr);
  24.     cout << darr->get_num_elements() << endl;
  25.  
  26.     darr->push_back(ll1);
  27.     darr->push_back(ll2);
  28.  
  29.     cout << darr->get_num_elements() << endl;
  30.     cout << dynamic_cast<CList*>(darr->get_element(0))->get_name() << endl;
  31.     cout << dynamic_cast<CList*>(darr->get_element(1))->get_name() << endl;
  32.  
  33.     SG_UNREF(darr);
  34.     //SG_UNREF(ll1);
  35.     //SG_UNREF(ll2);
  36.  
  37.     exit_shogun();
  38.     return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement