00001 
00002        
00003       
00004      
00005     
00006    
00007   
00008  
00009 
00010 
00014 
00015 
00016 
00017 
00018 
00019 #include "hdyn.h"
00020 
00021 #ifndef TOOLBOX
00022 
00023 void reset_counters(hdyn *bi)
00024 {
00025     bi->inc_steps(-bi->get_steps());            
00026     bi->inc_direct_force(-bi->get_direct_force());
00027     bi->inc_indirect_force(-bi->get_indirect_force());
00028 }
00029 
00030 #else
00031 
00032 main(int argc, char ** argv)
00033 {
00034     bool  c_flag = FALSE;
00035     char  *comment;
00036 
00037     check_help();
00038 
00039     extern char *poptarg;
00040     int c;
00041     char* param_string = "c:";
00042 
00043     while ((c = pgetopt(argc, argv, param_string)) != -1)
00044         switch(c) {
00045 
00046             case 'c': c_flag = TRUE;
00047                       comment = poptarg;
00048                       break;
00049             case '?': params_to_usage(cerr, argv[0], param_string);
00050                       get_help();
00051                       exit(1);
00052         }
00053 
00054     hdyn *b;
00055 
00056     while (b = get_hdyn(cin)) {
00057 
00058         if (c_flag == TRUE)
00059             b->log_comment(comment);
00060         b->log_history(argc, argv);
00061 
00062         for_all_nodes(hdyn, b, bi)
00063             reset_counters(bi);
00064         put_dyn(cout, *b);      
00065         delete b;
00066     }
00067 }
00068 
00069 #endif