- Timestamp:
- 02/09/12 16:20:49 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/fitsdump.cc
r12877 r12883 398 398 out << "#" << endl; 399 399 400 401 vector<const void*> ptrs; 402 for (auto namesIt=listNamesOnly.begin(); namesIt!=listNamesOnly.end(); namesIt++) 403 { 404 ptrs.push_back(fFile->SetPtrAddress(*namesIt)); 405 } 406 400 407 while (fFile->GetNextRow()) 401 408 { … … 405 412 406 413 rangesIt = ranges.begin(); 407 408 for (vector<string>::const_iterator in=listNamesOnly.begin(); in!=listNamesOnly.end(); in++, rangesIt++) 414 auto ptrsIt=ptrs.begin(); 415 416 for (vector<string>::const_iterator in=listNamesOnly.begin(); in!=listNamesOnly.end(); in++, rangesIt++, ptrsIt++) 409 417 { 410 const void *ptr = fFile->SetPtrAddress(*in);418 const void *ptr = *ptrsIt; 411 419 412 420 const fits::Table::Column &cCol = fColMap.find(*in)->second; … … 623 631 vector<minMaxStruct> statData(names.size()); 624 632 633 vector<const void*> ptrs; 634 for (auto namesIt=names.begin(); namesIt!=names.end(); namesIt++) 635 { 636 ptrs.push_back(fFile->SetPtrAddress(*namesIt)); 637 } 638 625 639 // Loop over all columns in our list of requested columns 626 640 while (fFile->GetNextRow()) … … 632 646 auto rangesIt = ranges.begin(); 633 647 auto statsIt = statData.begin(); 634 635 for (auto in=names.begin(); in!=names.end(); in++, rangesIt++, statsIt++) 648 auto ptrsIt = ptrs.begin(); 649 650 for (auto in=names.begin(); in!=names.end(); in++, rangesIt++, statsIt++, ptrsIt++) 636 651 { 637 const void *ptr = fFile->SetPtrAddress(*in);652 const void *ptr = *ptrsIt; 638 653 639 654 const fits::Table::Column &cCol = fColMap.find(*in)->second; … … 966 981 { 967 982 if (numElems%2 == 0) 968 out << "Med: " << double(val[ numElems/2] + val[numElems/2+1])/2 << '\n';983 out << "Med: " << double(val[(numElems-1)/2] + val[(numElems-1)/2+1])/2 << '\n'; 969 984 else 970 985 out << "Med: " << double(val[numElems/2+1]) << '\n'; … … 1018 1033 statData.push_back(new char[(rangesIt->second - rangesIt->first)*cCol.size*fFile->GetNumRows()]); 1019 1034 } 1035 vector<const void*> ptrs; 1036 for (auto namesIt=names.begin(); namesIt!=names.end(); namesIt++) 1037 { 1038 ptrs.push_back(fFile->SetPtrAddress(*namesIt)); 1039 } 1020 1040 1021 1041 while (fFile->GetNextRow()) … … 1027 1047 rangesIt = ranges.begin(); 1028 1048 auto statsIt = statData.begin(); 1029 1030 for (auto in=names.begin(); in!=names.end(); in++, rangesIt++, statsIt++) 1049 auto ptrsIt = ptrs.begin(); 1050 1051 for (auto in=names.begin(); in!=names.end(); in++, rangesIt++, statsIt++, ptrsIt++) 1031 1052 { 1032 const void *ptr = fFile->SetPtrAddress(*in);1053 const void *ptr = *ptrsIt; 1033 1054 1034 1055 const fits::Table::Column &cCol = fColMap.find(*in)->second;
Note:
See TracChangeset
for help on using the changeset viewer.