Source
xxxxxxxxxx
// cout << "itsMajorDone="<<itsMajorDone<<" itsIterDone="<<itsIterDone<< " itsInitPeakResidual="<<itsInitPeakResidual<<" itsPeakResidual="<<itsPeakResidual <<" itsPrevPeakResidual : " << itsPrevPeakResidual << " itsStopFlag="<<itsStopFlag<<endl;
//# SIIterBot.cc: This file contains the implementation of the SIIterBot class.
//#
//# CASA - Common Astronomy Software Applications (http://casa.nrao.edu/)
//# Copyright (C) Associated Universities, Inc. Washington DC, USA 2011, All rights reserved.
//# Copyright (C) European Southern Observatory, 2011, All rights reserved.
//#
//# This library is free software; you can redistribute it and/or
//# modify it under the terms of the GNU Lesser General Public
//# License as published by the Free software Foundation; either
//# version 2.1 of the License, or (at your option) any later version.
//#
//# This library is distributed in the hope that it will be useful,
//# but WITHOUT ANY WARRANTY, without even the implied warranty of
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
//# Lesser General Public License for more details.
//#
//# You should have received a copy of the GNU Lesser General Public
//# License along with this library; if not, write to the Free Software
//# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
//# MA 02111-1307 USA
//# $Id: $
/* Include file for the lock guard */
/* Records Interface */
// For FLT_MAX
using namespace casacore;
namespace casa { //# NAMESPACE CASA - BEGIN
////////////////////////////////////
/// SIIterBot_callback implementation ///
////////////////////////////////////
void SIIterBot_callback::interactionRequired( bool val ) {
std::lock_guard<std::recursive_mutex> guard(mutex);
if ( adaptor != 0 )
adaptor->interactionRequired(val);
}
void SIIterBot_callback::addHandler( SIIterBot_adaptor *adapt ) {
std::lock_guard<std::recursive_mutex> guard(mutex);
if ( adaptor == 0 )
adaptor = adapt;
}
void SIIterBot_callback::removeHandler( SIIterBot_adaptor *adapt ) {
std::lock_guard<std::recursive_mutex> guard(mutex);
if ( adaptor == adapt )
adaptor = 0;
}
////////////////////////////////////
/// SIIterBot_state implementation ///
////////////////////////////////////
// All SIIterBot_states must have 'type' and 'name' defined.
SIIterBot_state::SIIterBot_state( std::shared_ptr<SIIterBot_callback> cb ) :
itsDescription("no description is currently available..."),
itsMinPsfFraction(0.05),
itsMaxPsfFraction(0.8),
itsMaxPsfSidelobe(0.0),
itsPeakResidual(0.0),
itsPrevPeakResidual(-1.0),
itsInitPeakResidual(0.0),
itsMinPeakResidual(1e+9),
itsMinorCyclePeakResidual(0.0),
itsPeakResidualNoMask(0.0),
itsPrevPeakResidualNoMask(-1.0),
itsMinPeakResidualNoMask(1e+9),
itsNsigma(0.0),
itsNsigmaThreshold(0.0),
itsMadRMS(0.0),
itsMaskSum(-1.0),
itsPrevMajorCycleCount(0),
itsControllerCount(0),
itsNiter(0),
itsCycleNiter(0),
itsInteractiveNiter(0),
itsThreshold(0),
itsCycleThreshold(0.0),
itsInteractiveThreshold(0.0),
itsIsCycleThresholdAuto(true),