Changeset 1398 for trunk/src


Ignore:
Timestamp:
10/24/07 15:57:31 (17 years ago)
Author:
Malte Marquarding
Message:

made n_ unsigned integer (from float) to maybe speed things up a bit

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/RowAccumulator.cpp

    r1352 r1398  
    4444    Vector<Bool> dummymsk(m.nelements(), True);
    4545    spectrum_.setData(dummy, dummymsk);
    46     n_.setData(Vector<Float>(v.nelements(), 0.0), dummymsk);
     46    n_.setData(Vector<uInt>(v.nelements(), 0), dummymsk);
    4747    weightSum_.setData(Vector<Float>(v.nelements(), 0.0), dummymsk);
    4848    tsysSum_.resize(tsys.nelements()); tsysSum_=0.0;
     
    7979  weightSum_ += wadd;
    8080  spectrum_ += data;
    81   const MaskedArray<Float> inc(Vector<Float>(m.nelements(),1.0), m);
     81  const MaskedArray<uInt> inc(Vector<uInt>(m.nelements(),1), m);
    8282  n_ += inc;
    8383}
     
    125125casa::Double asap::RowAccumulator::getTime( ) const
    126126{
    127   Float n = max(n_);
    128   if (n < 1.0) n = 1.0;
    129   return timeSum_/n;
     127  uInt n = max(n_);
     128  return timeSum_/Float(n);
    130129}
    131130
     
    138137{
    139138  // Return the "total" mask - False where no points have been accumulated.
    140   return (n_.getArray() > Float(0.0));
     139  return (n_.getArray() > uInt(0));
    141140}
    142141
     
    144143{
    145144  // @fixme this assumes tsys.nelements() == 1
    146   return tsysSum_/max(n_);
     145  return tsysSum_/Float(max(n_));
    147146}
    148147
  • trunk/src/RowAccumulator.h

    r1353 r1398  
    9999  //these are Vectors
    100100  casa::MaskedArray<casa::Float> spectrum_;
    101   casa::MaskedArray<casa::Float> n_, weightSum_;
     101  casa::MaskedArray<casa::Float> weightSum_;
     102  casa::MaskedArray<casa::uInt> n_;
    102103
    103104  casa::Vector<casa::Bool> userMask_;
Note: See TracChangeset for help on using the changeset viewer.