Changeset 2918
- Timestamp:
- 04/04/14 16:14:00 (11 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/STIdxIter.cpp
r2914 r2918 515 515 index_(), 516 516 unique_(), 517 pointer_() 517 pointer_(), 518 string_storage_() 518 519 { 519 520 } … … 529 530 index_(), 530 531 unique_(), 531 pointer_() 532 pointer_(), 533 string_storage_() 532 534 { 533 535 init(); … … 544 546 index_(), 545 547 unique_(), 546 pointer_() 548 pointer_(), 549 string_storage_() 547 550 { 548 551 init(); … … 640 643 addColumnToKey<Complex, TpComplex>(name); 641 644 break; 642 //case TpString:643 // addColumnToKey<String, TpString>(name);644 //break;645 case TpString: 646 addColumnToKeyTpString(name); 647 break; 645 648 default: 646 649 deallocate(); … … 662 665 pointer_.push_back(raw_storage); 663 666 } 667 668 void STIdxIter2::addColumnToKeyTpString(const string &name) 669 { 670 ROScalarColumn<String> col(table_, name); 671 String *storage = new String[num_row_]; 672 Vector<String> array(IPosition(1, num_row_), storage, TAKE_OVER); 673 col.getColumn(array); 674 sorter_.sortKey(storage, TpString, 0, Sort::Ascending); 675 string_storage_.push_back(array); 676 } 677 664 678 } // namespace 665 679 -
trunk/src/STIdxIter.h
r2911 r2918 176 176 void addSortKey(const string &name); 177 177 template<class T, DataType U> void addColumnToKey(const string &name); 178 void addColumnToKeyTpString(const string &name); 178 179 void deallocate(); 179 180 vector<string> cols_; … … 186 187 Vector<uInt> unique_; 187 188 vector<void*> pointer_; 189 vector<Vector<String> > string_storage_; 188 190 } ; 189 191 -
trunk/src/STMath.cpp
r2917 r2918 216 216 } 217 217 uInt outrowCount = 0; 218 // use STIdxIter ExAccinstead of TableIterator219 STIdxIter ExAcciter( in[0], cols ) ;218 // use STIdxIter2 instead of TableIterator 219 STIdxIter2 iter( in[0], cols ) ; 220 220 // double t2 = 0 ; 221 221 // double t3 = 0 ; … … 230 230 continue ; 231 231 } 232 Vector<uInt> current = iter.current() ; 233 String srcname = iter.getSrcName() ; 232 Record current = iter.currentValue() ; 234 233 //Table subt = iter.table(); 235 234 // copy the first row of this selection into the new table … … 336 335 static char const*const colNames1[] = { "IFNO", "BEAMNO", "POLNO" }; 337 336 //uInt const values1[] = { rec.asuInt("IFNO"), rec.asuInt("BEAMNO"), rec.asuInt("POLNO") }; 338 uInt const values1[] = { current [1], current[0], current[2]};337 uInt const values1[] = { current.asuInt("IFNO"), current.asuInt("BEAMNO"), current.asuInt("POLNO") }; 339 338 SingleTypeEqPredicate<uInt, 3> myPred(tin, colNames1, values1); 340 339 CustomTableExprNodeRep myNodeRep(tin, myPred); … … 346 345 // && tin.col("IFNO") == Int(rec.asuInt("IFNO")) 347 346 // && tin.col("POLNO") == Int(rec.asuInt("POLNO")) ); 348 Table basesubt = tin( tin.col("BEAMNO") == current [0]349 && tin.col("IFNO") == current[1] 350 && tin.col("POLNO") == current[2]);347 Table basesubt = tin( tin.col("BEAMNO") == current.asuInt("BEAMNO") 348 && tin.col("IFNO") == current.asuInt("IFNO") 349 && tin.col("POLNO") == current.asuInt("POLNO") ); 351 350 #endif 352 351 Table subt; 353 352 if ( avmode == "SOURCE") { 354 353 // subt = basesubt( basesubt.col("SRCNAME") == rec.asString("SRCNAME")); 355 subt = basesubt( basesubt.col("SRCNAME") == srcname);354 subt = basesubt( basesubt.col("SRCNAME") == current.asString("SRCNAME") ); 356 355 357 356 } else if (avmode == "SCAN") { 358 357 // subt = basesubt( basesubt.col("SRCNAME") == rec.asString("SRCNAME") 359 358 // && basesubt.col("SCANNO") == Int(rec.asuInt("SCANNO")) ); 360 subt = basesubt( basesubt.col("SRCNAME") == srcname361 && basesubt.col("SCANNO") == current[4]);359 subt = basesubt( basesubt.col("SRCNAME") == current.asString("SRCNAME") 360 && basesubt.col("SCANNO") == current.asuInt("SCANNO") ); 362 361 } else { 363 362 subt = basesubt;
Note:
See TracChangeset
for help on using the changeset viewer.