LCOV - code coverage report
Current view: top level - msvis/MSVis - IteratingParameters.cc (source / functions) Hit Total Coverage
Test: ctest_coverage.info Lines: 27 37 73.0 %
Date: 2023-11-06 10:06:49 Functions: 8 11 72.7 %

          Line data    Source code
       1             : //# IteratingParameters.cc: Implementation of the IteratingParameters class
       2             : //#
       3             : //#  CASA - Common Astronomy Software Applications (http://casa.nrao.edu/)
       4             : //#  Copyright (C) Associated Universities, Inc. Washington DC, USA 2015, All rights reserved.
       5             : //#  Copyright (C) European Southern Observatory, 2015, All rights reserved.
       6             : //#
       7             : //#  This library is free software; you can redistribute it and/or
       8             : //#  modify it under the terms of the GNU Lesser General Public
       9             : //#  License as published by the Free software Foundation; either
      10             : //#  version 2.1 of the License, or (at your option) any later version.
      11             : //#
      12             : //#  This library is distributed in the hope that it will be useful,
      13             : //#  but WITHOUT ANY WARRANTY, without even the implied warranty of
      14             : //#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      15             : //#  Lesser General Public License for more details.
      16             : //#
      17             : //#  You should have received a copy of the GNU Lesser General Public
      18             : //#  License along with this library; if not, write to the Free Software
      19             : //#  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
      20             : //#  MA 02111-1307  USA
      21             : //# $Id: $
      22             : 
      23             : #include <msvis/MSVis/IteratingParameters.h>
      24             : #include <stdcasa/UtilJ.h>
      25             : 
      26             : using namespace casacore;
      27             : namespace casa { //# NAMESPACE CASA - BEGIN
      28             : namespace vi { //# NAMESPACE VI - BEGIN
      29             : 
      30          32 : IteratingParameters::IteratingParameters() :
      31             :   chunkInterval_p(0.0),
      32             :   sortColumns_p(SortColumns()),
      33          32 :   weightScaling_p(0)
      34          32 : {}
      35             : 
      36        1400 : IteratingParameters::IteratingParameters(Double chunkInterval, 
      37             :                                          const SortColumns& sortColumns, 
      38        1400 :                                          WeightScaling * weightScaling) :
      39             :   chunkInterval_p(chunkInterval),
      40             :   sortColumns_p(sortColumns),
      41        1400 :   weightScaling_p(weightScaling)
      42             : {
      43        1400 :   validate();
      44        1400 : }
      45             :   
      46        1401 : IteratingParameters::IteratingParameters(const IteratingParameters& other)
      47             : {
      48        1401 :   *this = other;
      49        1401 : }
      50             : 
      51        1419 : IteratingParameters& IteratingParameters::operator=(const IteratingParameters& other)
      52             : {
      53        1419 :   if (this != &other) {
      54        1419 :     chunkInterval_p = other.chunkInterval_p;
      55        1419 :     sortColumns_p = other.sortColumns_p;
      56        1419 :     weightScaling_p = other.weightScaling_p;
      57        1419 :     validate();
      58             :   }
      59        1419 :   return *this;
      60             : }
      61             : 
      62        1410 : Double IteratingParameters::getChunkInterval() const
      63             : {
      64        1410 :   return chunkInterval_p;
      65             : }
      66        1410 : const SortColumns& IteratingParameters::getSortColumns() const
      67             : {
      68        1410 :   return sortColumns_p;
      69             : }
      70           9 : WeightScaling* IteratingParameters::getWeightScaling() const
      71             : {
      72           9 :   return weightScaling_p;
      73             : }
      74             :   
      75             : 
      76           0 : void IteratingParameters::setChunkInterval(Double chunkInterval)
      77             : {
      78           0 :   ThrowIf (chunkInterval>=0, "chunkInterval must be >= 0.0");
      79           0 :   chunkInterval_p=chunkInterval;
      80           0 : }
      81             : 
      82           0 : void IteratingParameters::setSortColumns(const SortColumns& sortColumns)
      83             : {
      84           0 :   sortColumns_p=sortColumns;
      85           0 : }
      86           0 : void IteratingParameters::setWeightScaling(WeightScaling* weightScaling)
      87             : {
      88           0 :   weightScaling_p = weightScaling;
      89           0 : }
      90             :   
      91        2819 : void IteratingParameters::validate()
      92             : {
      93        2819 :   Assert(chunkInterval_p>=0.0);
      94        2819 : }
      95             : 
      96             : } //# NAMESPACE VI - END
      97             : } //# NAMESPACE CASA - END
      98             : 
      99             : 

Generated by: LCOV version 1.16