LCOV - code coverage report
Current view: top level - msvis/MSVis/statistics - Vi2StatsWeightsIterator.h (source / functions) Hit Total Coverage
Test: casacpp_coverage.info Lines: 0 3 0.0 %
Date: 2024-10-10 15:00:01 Functions: 0 4 0.0 %

          Line data    Source code
       1             : // -*- mode: c++ -*-
       2             : //# Copyright (C) 1996,1997,1998,1999,2000,2002,2003,2015
       3             : //# Associated Universities, Inc. Washington DC, USA.
       4             : //#
       5             : //# This library is free software; you can redistribute it and/or modify it
       6             : //# under the terms of the GNU Library General Public License as published by
       7             : //# the Free Software Foundation; either version 2 of the License, or (at your
       8             : //# option) any later version.
       9             : //#
      10             : //# This library is distributed in the hope that it will be useful, but WITHOUT
      11             : //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
      12             : //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
      13             : //# License for more details.
      14             : //#
      15             : //# You should have received a copy of the GNU Library General Public License
      16             : //# along with this library; if not, write to the Free Software Foundation,
      17             : //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
      18             : //#
      19             : //# Correspondence concerning AIPS++ should be addressed as follows:
      20             : //#        Internet email: casa-feedback@nrao.edu.
      21             : //#        Postal address: AIPS++ Project Office
      22             : //#                        National Radio Astronomy Observatory
      23             : //#                        520 Edgemont Road
      24             : //#                        Charlottesville, VA 22903-2475 USA
      25             : //#
      26             : //
      27             : // casacore::Data provider weights iterators, based on weights column
      28             : //
      29             : #ifndef MSVIS_STATISTICS_VI2_STATS_WEIGHTS_ITERATOR_H_
      30             : #define MSVIS_STATISTICS_VI2_STATS_WEIGHTS_ITERATOR_H_
      31             : 
      32             : #include <casacore/casa/aips.h>
      33             : #include <msvis/MSVis/VisibilityIterator2.h>
      34             : #include <msvis/MSVis/VisBuffer2.h>
      35             : #include <iterator>
      36             : 
      37             : namespace casa {
      38             : 
      39             : // Vi2StatsWeightsIterator has the form of a CRTP base class to promote
      40             : // efficiency in iterator operations.
      41             : //
      42             : template<class T>
      43             : class Vi2StatsWeightsIterator
      44             :         : public std::iterator<std::input_iterator_tag,casacore::Float> {
      45             : 
      46             : public:
      47             :         Vi2StatsWeightsIterator& operator++();
      48             : 
      49             :         Vi2StatsWeightsIterator operator++(int);
      50             : 
      51             :         bool operator==(const Vi2StatsWeightsIterator& rhs);
      52             : 
      53             :         bool operator!=(const Vi2StatsWeightsIterator& rhs);
      54             : 
      55             :         casacore::Float operator*();
      56             : 
      57             :         bool atEnd();
      58             : 
      59             : protected:
      60           0 :         Vi2StatsWeightsIterator(vi::VisBuffer2 *vb2)
      61           0 :                 : vb2(vb2) {};
      62             : 
      63           0 :         Vi2StatsWeightsIterator() {};
      64             : 
      65             :         vi::VisBuffer2 *vb2;
      66             : };
      67             : 
      68             : // Weights iterator over weights cube.
      69             : class Vi2StatsWeightsCubeIterator final
      70             :         : public Vi2StatsWeightsIterator<Vi2StatsWeightsCubeIterator> {
      71             : 
      72             : public:
      73             :         Vi2StatsWeightsCubeIterator(vi::VisBuffer2 *vb2);
      74             : 
      75             :         Vi2StatsWeightsCubeIterator();
      76             : 
      77             :         Vi2StatsWeightsCubeIterator& operator++();
      78             : 
      79             :         Vi2StatsWeightsCubeIterator operator++(int);
      80             : 
      81             :         bool operator==(const Vi2StatsWeightsCubeIterator& rhs);
      82             : 
      83             :         bool operator!=(const Vi2StatsWeightsCubeIterator& rhs);
      84             : 
      85             :         casacore::Float operator*();
      86             : 
      87             :         bool atEnd();
      88             : 
      89             : protected:
      90             :         casacore::uInt correlation;
      91             :         casacore::uInt nCorrelations;
      92             :         casacore::uInt channel;
      93             :         casacore::uInt nChannels;
      94             :         casacore::rownr_t row;
      95             :         casacore::rownr_t nRows;
      96             : };
      97             : 
      98             : // Weights iterator over row weights.
      99             : class Vi2StatsWeightsRowIterator final
     100             :         : public Vi2StatsWeightsIterator<Vi2StatsWeightsRowIterator> {
     101             : 
     102             : public:
     103             :         Vi2StatsWeightsRowIterator(vi::VisBuffer2 *vb2);
     104             : 
     105             :         Vi2StatsWeightsRowIterator();
     106             : 
     107             :         Vi2StatsWeightsRowIterator& operator++();
     108             : 
     109             :         Vi2StatsWeightsRowIterator operator++(int);
     110             : 
     111             :         bool operator==(const Vi2StatsWeightsRowIterator& rhs);
     112             : 
     113             :         bool operator!=(const Vi2StatsWeightsRowIterator& rhs);
     114             : 
     115             :         casacore::Float operator*();
     116             : 
     117             :         bool atEnd();
     118             : 
     119             : protected:
     120             :         casacore::rownr_t row;
     121             :         casacore::rownr_t nRows;
     122             : };
     123             : 
     124             : } // namespace casa
     125             : 
     126             : #endif // MSVIS_STATISTICS_VI2_STATS_WEIGHTS_ITERATOR_H_

Generated by: LCOV version 1.16