Ignore:
Timestamp:
01/06/05 13:52:30 (19 years ago)
Author:
kil064
Message:

Modify SDMath to be a class rather than just a namespace

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDMathWrapper.cc

    r169 r170  
    3232
    3333#include "SDMathWrapper.h"
     34#include "SDMath.h"
     35
    3436
    3537using namespace asap;
     
    3941                                          const SDMemTableWrapper& off)
    4042{
    41     return SDMemTableWrapper(SDMath::quotient(on.getCP(),
    42                                             off.getCP()));
     43    SDMath sdm;
     44    return SDMemTableWrapper(sdm.quotient(on.getCP(), off.getCP()));
    4345}
    4446
    4547
    46 void SDMathWrapper::scaleInSitu(SDMemTableWrapper& in, casa::Float factor, casa::Bool doAll)
     48void SDMathWrapper::scaleInSitu(SDMemTableWrapper& in, float factor, bool doAll)
    4749{
    4850  SDMemTable* pIn = in.getPtr();
    4951  const uInt what = 0;
    50   SDMemTable* pOut = SDMath::simpleOperate (*pIn, factor, doAll, what);
     52//
     53  SDMath sdm;
     54  SDMemTable* pOut = sdm.simpleOperate (*pIn, Float(factor), Bool(doAll), what);
    5155  *pIn = *pOut;
    5256   delete pOut;
     
    5458
    5559SDMemTableWrapper SDMathWrapper::scale(const SDMemTableWrapper& in,
    56                           casa::Float factor, casa::Bool doAll)
     60                          float factor, bool doAll)
    5761{
    5862  const CountedPtr<SDMemTable>& pIn = in.getCP();
    5963  const uInt what = 0;
    60   return CountedPtr<SDMemTable>(SDMath::simpleOperate(*pIn, factor, doAll, what));
     64  SDMath sdm;
     65  return CountedPtr<SDMemTable>(sdm.simpleOperate(*pIn, Float(factor), Bool(doAll), what));
    6166}
    6267
    6368
    6469
    65 void SDMathWrapper::addInSitu(SDMemTableWrapper& in, casa::Float offset, casa::Bool doAll)
     70void SDMathWrapper::addInSitu(SDMemTableWrapper& in, float offset, bool doAll)
    6671{
    6772  SDMemTable* pIn = in.getPtr();
    6873  const uInt what = 1;
    69   SDMemTable* pOut = SDMath::simpleOperate (*pIn, offset, doAll, what);
     74//
     75  SDMath sdm;
     76  SDMemTable* pOut = sdm.simpleOperate (*pIn, Float(offset), Bool(doAll), what);
    7077  *pIn = *pOut;
    7178   delete pOut;
     
    7380
    7481SDMemTableWrapper SDMathWrapper::add(const SDMemTableWrapper& in,
    75                                      casa::Float offset, casa::Bool doAll)
     82                                     float offset, bool doAll)
    7683{
    7784  const CountedPtr<SDMemTable>& pIn = in.getCP();
    7885  const uInt what = 1;
    79   return CountedPtr<SDMemTable>(SDMath::simpleOperate(*pIn, offset, doAll, what));
     86  SDMath sdm;
     87  return CountedPtr<SDMemTable>(sdm.simpleOperate(*pIn, Float(offset), Bool(doAll), what));
    8088}
    8189
     
    8391SDMemTableWrapper SDMathWrapper::hanning(const SDMemTableWrapper& in)
    8492{
    85   return SDMemTableWrapper(SDMath::hanning(in.getCP()));
     93  SDMath sdm;
     94  return SDMemTableWrapper(sdm.hanning(in.getCP()));
    8695}
    8796
     
    9099{
    91100  SDMemTable* pIn = in.getPtr();
    92   SDMemTable* pOut = SDMath::bin (*pIn, Int(width));
     101  SDMath sdm;
     102  SDMemTable* pOut = sdm.bin (*pIn, Int(width));
    93103  *pIn = *pOut;
    94104   delete pOut;
     
    99109{
    100110  const CountedPtr<SDMemTable>& pIn = in.getCP();
    101   return CountedPtr<SDMemTable>(SDMath::bin(*pIn, Int(width)));
     111  SDMath sdm;
     112  return CountedPtr<SDMemTable>(sdm.bin(*pIn, Int(width)));
    102113}
    103114
     
    106117{
    107118  SDMemTable* pIn = in.getPtr();
    108   SDMemTable* pOut = SDMath::averagePol (*pIn, mask);
     119  SDMath sdm;
     120  SDMemTable* pOut = sdm.averagePol (*pIn, mask);
    109121  *pIn = *pOut;
    110122   delete pOut;
     
    115127{
    116128  const CountedPtr<SDMemTable>& pIn = in.getCP();
    117   return CountedPtr<SDMemTable>(SDMath::averagePol(*pIn, mask));
     129  SDMath sdm;
     130  return CountedPtr<SDMemTable>(sdm.averagePol(*pIn, mask));
    118131}
    119132
     
    123136                                            const std::string& which)
    124137{
    125   return SDMath::statistic(in.getCP(), mask, which);
     138  SDMath sdm;
     139  return sdm.statistic(in.getCP(), mask, which);
    126140}
Note: See TracChangeset for help on using the changeset viewer.