From 506dda6d022f21976d9c6cbbdeca807f73b5d20c Mon Sep 17 00:00:00 2001 From: Lamar Moore <lamar.moore@stfc.ac.uk> Date: Tue, 10 Nov 2015 10:54:46 +0000 Subject: [PATCH] Re #14291 Added clang formatting to code --- .../inc/MantidAlgorithms/AddLogDerivative.h | 3 +- .../inc/MantidAlgorithms/CalculateDIFC.h | 6 ++- Framework/Algorithms/src/AddLogDerivative.cpp | 6 +-- Framework/Algorithms/src/CalculateDIFC.cpp | 39 +++++++++---------- Framework/Algorithms/src/CalculateZscore.cpp | 2 +- Framework/Algorithms/src/ChopData.cpp | 11 +++--- 6 files changed, 33 insertions(+), 34 deletions(-) diff --git a/Framework/Algorithms/inc/MantidAlgorithms/AddLogDerivative.h b/Framework/Algorithms/inc/MantidAlgorithms/AddLogDerivative.h index 32197537396..b8a093260fd 100644 --- a/Framework/Algorithms/inc/MantidAlgorithms/AddLogDerivative.h +++ b/Framework/Algorithms/inc/MantidAlgorithms/AddLogDerivative.h @@ -54,7 +54,8 @@ public: virtual const std::string category() const { return "DataHandling\\Logs"; } static Mantid::Kernel::TimeSeriesProperty<double> * - makeDerivative(API::Progress &progress, Mantid::Kernel::TimeSeriesProperty<double> *input, + makeDerivative(API::Progress &progress, + Mantid::Kernel::TimeSeriesProperty<double> *input, const std::string &name, int numDerivatives); private: diff --git a/Framework/Algorithms/inc/MantidAlgorithms/CalculateDIFC.h b/Framework/Algorithms/inc/MantidAlgorithms/CalculateDIFC.h index c7c57ccc62a..4aaaaa0e5b2 100644 --- a/Framework/Algorithms/inc/MantidAlgorithms/CalculateDIFC.h +++ b/Framework/Algorithms/inc/MantidAlgorithms/CalculateDIFC.h @@ -57,8 +57,10 @@ private: void exec(); /// Calculate the DIFC for every pixel - void calculate(API::Progress &progress, API::MatrixWorkspace_sptr &outputWs, DataObjects::OffsetsWorkspace_sptr &offsetsWs, - double l1, double beamlineNorm, Kernel::V3D &beamline, Kernel::V3D &samplePos, detid2det_map &allDetectors); + void calculate(API::Progress &progress, API::MatrixWorkspace_sptr &outputWs, + DataObjects::OffsetsWorkspace_sptr &offsetsWs, double l1, + double beamlineNorm, Kernel::V3D &beamline, + Kernel::V3D &samplePos, detid2det_map &allDetectors); }; } // namespace Algorithms diff --git a/Framework/Algorithms/src/AddLogDerivative.cpp b/Framework/Algorithms/src/AddLogDerivative.cpp index 9dd883c01a2..448e0a27705 100644 --- a/Framework/Algorithms/src/AddLogDerivative.cpp +++ b/Framework/Algorithms/src/AddLogDerivative.cpp @@ -56,8 +56,8 @@ void AddLogDerivative::init() { * @return */ Mantid::Kernel::TimeSeriesProperty<double> *AddLogDerivative::makeDerivative( - API::Progress &progress, Mantid::Kernel::TimeSeriesProperty<double> *input, const std::string &name, - int numDerivatives) { + API::Progress &progress, Mantid::Kernel::TimeSeriesProperty<double> *input, + const std::string &name, int numDerivatives) { if (input->size() < numDerivatives + 1) throw std::runtime_error( "Log " + input->name() + " only has " + @@ -91,7 +91,7 @@ Mantid::Kernel::TimeSeriesProperty<double> *AddLogDerivative::makeDerivative( times = dTime; values = dVal; - progress.report("Add Log Derivative"); + progress.report("Add Log Derivative"); } if (times.empty()) diff --git a/Framework/Algorithms/src/CalculateDIFC.cpp b/Framework/Algorithms/src/CalculateDIFC.cpp index 1e500898a6f..02c60b51c7c 100644 --- a/Framework/Algorithms/src/CalculateDIFC.cpp +++ b/Framework/Algorithms/src/CalculateDIFC.cpp @@ -5,15 +5,6 @@ namespace Mantid { namespace Algorithms { -//using Mantid::API::MatrixWorkspace; -//using Mantid::API::WorkspaceProperty; -//using Mantid::DataObjects::OffsetsWorkspace; -//using Mantid::DataObjects::OffsetsWorkspace_sptr; -//using Mantid::DataObjects::SpecialWorkspace2D; -//using Mantid::DataObjects::SpecialWorkspace2D_sptr; -//using Mantid::Geometry::Instrument_const_sptr; -//using Mantid::Kernel::Direction; - // Register the algorithm into the AlgorithmFactory DECLARE_ALGORITHM(CalculateDIFC) @@ -65,17 +56,19 @@ void CalculateDIFC::init() { /** Execute the algorithm. */ void CalculateDIFC::exec() { - - DataObjects::OffsetsWorkspace_sptr offsetsWs = getProperty("OffsetsWorkspace"); - API::MatrixWorkspace_sptr inputWs = getProperty("InputWorkspace"); - API::MatrixWorkspace_sptr outputWs = boost::dynamic_pointer_cast<MatrixWorkspace>(SpecialWorkspace2D_sptr( + + DataObjects::OffsetsWorkspace_sptr offsetsWs = + getProperty("OffsetsWorkspace"); + API::MatrixWorkspace_sptr inputWs = getProperty("InputWorkspace"); + API::MatrixWorkspace_sptr outputWs = + boost::dynamic_pointer_cast<MatrixWorkspace>(SpecialWorkspace2D_sptr( new SpecialWorkspace2D(inputWs->getInstrument()))); - + outputWs->setTitle("DIFC workspace"); Instrument_const_sptr instrument = inputWs->getInstrument(); - double l1; + double l1; Kernel::V3D beamline, samplePos; double beamlineNorm; @@ -86,14 +79,18 @@ void CalculateDIFC::exec() { instrument->getDetectors(allDetectors); API::Progress progress(this, 0, 1, allDetectors.size()); - calculate(progress, outputWs, offsetsWs, l1, beamlineNorm, beamline, samplePos, allDetectors); + calculate(progress, outputWs, offsetsWs, l1, beamlineNorm, beamline, + samplePos, allDetectors); setProperty("OutputWorkspace", outputWs); } -void CalculateDIFC::calculate(API::Progress &progress, API::MatrixWorkspace_sptr &outputWs, DataObjects::OffsetsWorkspace_sptr &offsetsWS, - double l1, double beamlineNorm, Kernel::V3D &beamline, Kernel::V3D &samplePos, detid2det_map &allDetectors) -{ +void CalculateDIFC::calculate(API::Progress &progress, + API::MatrixWorkspace_sptr &outputWs, + DataObjects::OffsetsWorkspace_sptr &offsetsWS, + double l1, double beamlineNorm, + Kernel::V3D &beamline, Kernel::V3D &samplePos, + detid2det_map &allDetectors) { SpecialWorkspace2D_sptr localWS = boost::dynamic_pointer_cast<SpecialWorkspace2D>(outputWs); @@ -110,10 +107,10 @@ void CalculateDIFC::calculate(API::Progress &progress, API::MatrixWorkspace_sptr double difc = Geometry::Instrument::calcConversion( l1, beamline, beamlineNorm, samplePos, det, offset); difc = 1. / difc; // calcConversion gives 1/DIFC - localWS->setValue(detID, difc); + localWS->setValue(detID, difc); } - progress.report("Calculate DIFC"); + progress.report("Calculate DIFC"); } } diff --git a/Framework/Algorithms/src/CalculateZscore.cpp b/Framework/Algorithms/src/CalculateZscore.cpp index 0fbec49c88a..173bda3482c 100644 --- a/Framework/Algorithms/src/CalculateZscore.cpp +++ b/Framework/Algorithms/src/CalculateZscore.cpp @@ -112,7 +112,7 @@ void CalculateZscore::exec() { vecY = yzscores; vecE = ezscores; - progress.report("Calculating Z Score"); + progress.report("Calculating Z Score"); } // ENDFOR // 4. Set the output diff --git a/Framework/Algorithms/src/ChopData.cpp b/Framework/Algorithms/src/ChopData.cpp index 0082a18b0d0..e91cfd667fd 100644 --- a/Framework/Algorithms/src/ChopData.cpp +++ b/Framework/Algorithms/src/ChopData.cpp @@ -58,7 +58,7 @@ void ChopData::exec() { if (rLower != EMPTY_DBL() && rUpper != EMPTY_DBL() && monitorWi != EMPTY_INT()) { - progress = boost::make_shared<Progress>(this, 0, 1, chops * 2); + progress = boost::make_shared<Progress>(this, 0, 1, chops * 2); // Select the spectrum that is to be used to compare the sections of the // workspace @@ -87,16 +87,15 @@ void ChopData::exec() { lowest = i; } - progress->report(); + progress->report(); } std::map<int, double>::iterator nlow = intMap.find(lowest - 1); if (nlow != intMap.end() && intMap[lowest] < (0.1 * nlow->second)) { prelow = nlow->first; } - } - else - progress = boost::make_shared<Progress>(this, 0, 1, chops); + } else + progress = boost::make_shared<Progress>(this, 0, 1, chops); int wsCounter(1); @@ -158,7 +157,7 @@ void ChopData::exec() { workspaces.push_back(workspace); - progress->report(); + progress->report(); } // Create workspace group that holds output workspaces -- GitLab