Changeset 66


Ignore:
Timestamp:
07/19/04 10:57:50 (20 years ago)
Author:
mmarquar
Message:

Replaced class and statics with a namespace. Functions now global in the namespace SDMath

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDMath.cc

    r48 r66  
    6262
    6363using namespace atnf_sd;
    64 
    65 static CountedPtr<SDMemTable> SDMath::average(const CountedPtr<SDMemTable>& in) {
     64//using namespace atnf_sd::SDMath;
     65
     66CountedPtr<SDMemTable> SDMath::average(const CountedPtr<SDMemTable>& in) {
    6667  Table t = in->table();
    6768  ROArrayColumn<Float> tsys(t, "TSYS"); 
     
    122123}
    123124
    124 static CountedPtr<SDMemTable>
     125CountedPtr<SDMemTable>
    125126SDMath::quotient(const CountedPtr<SDMemTable>& on,
    126127                 const CountedPtr<SDMemTable>& off) {
     
    160161}
    161162
    162 static CountedPtr<SDMemTable>
     163CountedPtr<SDMemTable>
    163164SDMath::multiply(const CountedPtr<SDMemTable>& in, Float factor) {
    164165  SDMemTable* sdmt = new SDMemTable(*in);
     
    175176}
    176177
    177 static bool SDMath::fit(Vector<Float>& thefit, const Vector<Float>& data,
    178                       const Vector<Bool>& mask,
    179                       const std::string& fitexpr) {
     178bool SDMath::fit(Vector<Float>& thefit, const Vector<Float>& data,
     179                const Vector<Bool>& mask,
     180                const std::string& fitexpr) {
    180181
    181182  LinearFit<Float> fitter;
     
    193194}
    194195
    195 static CountedPtr<SDMemTable>
     196CountedPtr<SDMemTable>
    196197SDMath::baseline(const CountedPtr<SDMemTable>& in,
    197198                 const std::string& fitexpr,
     
    238239
    239240
    240 static CountedPtr<SDMemTable>
     241CountedPtr<SDMemTable>
    241242SDMath::hanning(const CountedPtr<SDMemTable>& in) {
    242243
     
    281282}
    282283
    283 static CountedPtr<SDMemTable>
     284CountedPtr<SDMemTable>
    284285SDMath::averages(const Block<CountedPtr<SDMemTable> >& in,
    285286                 const Vector<Bool>& mask) {
     
    348349}
    349350
    350 static CountedPtr<SDMemTable>
     351CountedPtr<SDMemTable>
    351352SDMath::averagePol(const CountedPtr<SDMemTable>& in,
    352353                   const Vector<Bool>& mask) {
     
    412413
    413414
    414 static Float SDMath::rms(const CountedPtr<SDMemTable>& in,
     415Float SDMath::rms(const CountedPtr<SDMemTable>& in,
    415416                         const std::vector<bool>& mask) {
    416417  Float rmsval;
     
    441442}
    442443
    443 static CountedPtr<SDMemTable> SDMath::bin(const CountedPtr<SDMemTable>& in,
     444CountedPtr<SDMemTable> SDMath::bin(const CountedPtr<SDMemTable>& in,
    444445                                          Int width) {
    445446 
  • trunk/src/SDMath.h

    r48 r66  
    4040class SDMemTable;
    4141
    42 class SDMath {
    43 public:
    44   static CountedPtr<SDMemTable> average(const CountedPtr<SDMemTable>& in);
    45   static CountedPtr<SDMemTable> quotient(const CountedPtr<SDMemTable>& on,
     42namespace SDMath {
     43  //public:
     44  CountedPtr<SDMemTable> average(const CountedPtr<SDMemTable>& in);
     45  CountedPtr<SDMemTable> quotient(const CountedPtr<SDMemTable>& on,
    4646                                         const CountedPtr<SDMemTable>& off);
    47   static CountedPtr<SDMemTable> multiply(const CountedPtr<SDMemTable>& in,
     47  CountedPtr<SDMemTable> multiply(const CountedPtr<SDMemTable>& in,
    4848                                         Float factor);
    4949 
    50   static CountedPtr<SDMemTable> baseline(const CountedPtr<SDMemTable>& in,
     50  CountedPtr<SDMemTable> baseline(const CountedPtr<SDMemTable>& in,
    5151                                         const std::string& fitexpr,
    5252                                         const std::vector<bool>& mask);
    53   static CountedPtr<SDMemTable> hanning(const CountedPtr<SDMemTable>& in);
     53  CountedPtr<SDMemTable> hanning(const CountedPtr<SDMemTable>& in);
    5454
    55   static CountedPtr<SDMemTable>
     55  CountedPtr<SDMemTable>
    5656  averages(const Block<CountedPtr<SDMemTable> >& in,
    5757           const Vector<Bool>& mask);
    5858
    59   static CountedPtr<SDMemTable>
     59  CountedPtr<SDMemTable>
    6060  averagePol(const CountedPtr<SDMemTable>& in, const Vector<Bool>& mask);
    6161
    62   static Float rms(const CountedPtr<SDMemTable>& in,
     62  Float rms(const CountedPtr<SDMemTable>& in,
    6363                   const std::vector<bool>& mask);
    6464 
    65   static CountedPtr<SDMemTable> bin(const CountedPtr<SDMemTable>& in,
    66                                     Int width);
     65  CountedPtr<SDMemTable> bin(const CountedPtr<SDMemTable>& in,
     66                             Int width);
    6767 
    68 private:
    69   static bool fit(Vector<Float>& thefit, const Vector<Float>& data,
     68  bool fit(Vector<Float>& thefit, const Vector<Float>& data,
    7069                  const Vector<Bool>& mask, const std::string& fitexpr);
    7170 
Note: See TracChangeset for help on using the changeset viewer.