Changeset 2545 for branches


Ignore:
Timestamp:
05/22/12 18:03:02 (12 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: No

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No?

Module(s): Module Names change impacts.

Description: Describe your changes here...

Do not resize Vector everytime when new element is added.
Instead, we can allocate enough memory first.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/hpc33/src/STMath.cpp

    r2544 r2545  
    143143  ROScalarColumn<Int> scanIDCol;
    144144
    145   Vector<uInt> rowstodelete;
     145  //Vector<uInt> rowstodelete;
     146  Block<uInt> rowstodelB( in[0]->nrow() ) ;
     147  uInt nrowdel = 0 ;
    146148
    147149//   Block<String> cols(3);
     
    360362    const Vector<Bool>& msk = acc.getMask();
    361363    if ( allEQ(msk, False) ) {
    362       uint n = rowstodelete.nelements();
    363       rowstodelete.resize(n+1, True);
    364       rowstodelete[n] = i;
     364      //uint n = rowstodelete.nelements();
     365      //rowstodelete.resize(n+1, True);
     366      //rowstodelete[n] = i;
     367      rowstodelB[nrowdel] = i ;
     368      nrowdel++ ;
    365369      continue;
    366370    }
     
    404408  }
    405409
    406   if (rowstodelete.nelements() > 0) {
     410  //if (rowstodelete.nelements() > 0) {
     411  if ( nrowdel > 0 ) {
     412    Vector<uInt> rowstodelete( IPosition(1,nrowdel), rowstodelB.storage(), SHARE ) ;
    407413    os << rowstodelete << LogIO::POST ;
    408414    tout.removeRow(rowstodelete);
Note: See TracChangeset for help on using the changeset viewer.