00001
00006
00007 #include "dyn.h"
00008
00009 #ifdef TOOLBOX
00010
00011 main(int argc, char** argv)
00012 {
00013 dyn *root, *ni;
00014
00015 check_help();
00016
00017 extern char *poptarg;
00018 int c;
00019 char* param_string = "p:";
00020
00021 int p = STD_PRECISION;
00022
00023 while ((c = pgetopt(argc, argv, param_string)) != -1)
00024 switch(c)
00025 {
00026 case 'p': p = atoi(poptarg);
00027 break;
00028 case '?': params_to_usage(cerr, argv[0], param_string);
00029 get_help();
00030 exit(1);
00031 }
00032
00033 cerr.precision(p);
00034 int i = 0;
00035
00036 while (root = get_dyn(cin)) {
00037
00038 for_all_daughters(dyn, root, ni) {
00039
00040 cerr << ++i << " "
00041 << ni->get_index() << " "
00042 << ni->get_mass() << " "
00043 << abs(ni->get_pos()) << endl;
00044
00045 }
00046
00047 rmtree(root);
00048 }
00049 }
00050
00051 #endif