LCOV - code coverage report
Current view: top level - msvis/MSVis - IteratingParameters.cc (source / functions) Hit Total Coverage
Test: casacpp_coverage.info Lines: 31 41 75.6 %
Date: 2024-12-11 20:54:31 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          32 :   chunkInterval_p(0.0),
      32          32 :   sortColumns_p(SortColumns()),
      33          32 :   weightScaling_p(0)
      34          32 : {}
      35             : 
      36        1415 : IteratingParameters::IteratingParameters(Double chunkInterval, 
      37             :                                          const SortColumns& sortColumns, 
      38        1415 :                                          WeightScaling * weightScaling) :
      39        1415 :   chunkInterval_p(chunkInterval),
      40        1415 :   sortColumns_p(sortColumns),
      41        1415 :   weightScaling_p(weightScaling)
      42             : {
      43        1415 :   validate();
      44        1415 : }
      45             :   
      46        1416 : IteratingParameters::IteratingParameters(const IteratingParameters& other)
      47             : {
      48        1416 :   *this = other;
      49        1416 : }
      50             : 
      51        1434 : IteratingParameters& IteratingParameters::operator=(const IteratingParameters& other)
      52             : {
      53        1434 :   if (this != &other) {
      54        1434 :     chunkInterval_p = other.chunkInterval_p;
      55        1434 :     sortColumns_p = other.sortColumns_p;
      56        1434 :     weightScaling_p = other.weightScaling_p;
      57        1434 :     validate();
      58             :   }
      59        1434 :   return *this;
      60             : }
      61             : 
      62        1425 : Double IteratingParameters::getChunkInterval() const
      63             : {
      64        1425 :   return chunkInterval_p;
      65             : }
      66        1425 : const SortColumns& IteratingParameters::getSortColumns() const
      67             : {
      68        1425 :   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        2849 : void IteratingParameters::validate()
      92             : {
      93        2849 :   Assert(chunkInterval_p>=0.0);
      94        2849 : }
      95             : 
      96             : } //# NAMESPACE VI - END
      97             : } //# NAMESPACE CASA - END
      98             : 
      99             : 

Generated by: LCOV version 1.16