Skip to content

Commit

Permalink
finishing coverity uninits in algorithms, 1075454...1075488, re #11829
Browse files Browse the repository at this point in the history
  • Loading branch information
FedeMPouzols committed May 27, 2015
1 parent d0ea5f9 commit b897353
Show file tree
Hide file tree
Showing 21 changed files with 45 additions and 79 deletions.
Expand Up @@ -130,12 +130,12 @@ class DLLExport FilterEvents : public API::Algorithm {
std::vector<double> m_detTofOffsets;
std::vector<double> m_detTofShifts;

bool mFilterByPulseTime;
bool m_FilterByPulseTime;

DataObjects::TableWorkspace_sptr m_informationWS;
bool m_hasInfoWS;

double mProgress;
double m_progress;

void getTimeSeriesLogNames(std::vector<std::string> &lognames);

Expand Down
Expand Up @@ -91,6 +91,8 @@ class DLLExport GeneralisedSecondDifference : public API::Algorithm {
int m_z;
/// Contains the value of the property m
int m_m;
/// Progress reporting
API::Progress *m_progress;
};

} // Namespace Algorithms
Expand Down
Expand Up @@ -86,21 +86,11 @@ class DLLExport Integration : public API::Algorithm {
API::MatrixWorkspace_const_sptr getInputWorkspace();
/// Create the outputworkspace
API::MatrixWorkspace_sptr
getOutputWorkspace(API::MatrixWorkspace_const_sptr inWS);
getOutputWorkspace(API::MatrixWorkspace_const_sptr inWS, const int minSpec,
const int maxSpec);

/// Input event workspace
DataObjects::EventWorkspace_const_sptr inputEventWS;

/// The value in X to start the integration from
double m_MinRange;
/// The value in X to finish the integration at
double m_MaxRange;
/// The spectrum to start the integration from
int m_MinSpec;
/// The spectrum to finish the integration at
int m_MaxSpec;
/// Flag for including partial bins
bool m_IncPartBins;
};

} // namespace Algorithm
Expand Down
13 changes: 1 addition & 12 deletions Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/MaxMin.h
Expand Up @@ -57,7 +57,7 @@ namespace Algorithms {
class DLLExport MaxMin : public API::Algorithm {
public:
/// Default constructor
MaxMin() : API::Algorithm(){};
MaxMin() : API::Algorithm() {};
/// Destructor
virtual ~MaxMin(){};
/// Algorithm's name for identification overriding a virtual method
Expand All @@ -76,17 +76,6 @@ class DLLExport MaxMin : public API::Algorithm {
// Overridden Algorithm methods
void init();
void exec();

/// The flag to show minimum
bool showMin;
/// The value in X to start the search from
double m_MinRange;
/// The value in X to finish the search at
double m_MaxRange;
/// The spectrum to start the integration from
int m_MinSpec;
/// The spectrum to finish the integration at
int m_MaxSpec;
};

} // namespace Algorithm
Expand Down
Expand Up @@ -72,12 +72,8 @@ namespace Algorithms {
*/
class DLLExport ModeratorTzero : public Mantid::API::Algorithm {
public:
/// (Empty) Constructor
ModeratorTzero()
: Mantid::API::Algorithm(),
m_convfactor(0.5e+12 * Mantid::PhysicalConstants::NeutronMass /
Mantid::PhysicalConstants::meV),
m_niter(1), m_t1min(200.0) {}
/// Default constructor
ModeratorTzero();
/// Virtual destructor
virtual ~ModeratorTzero() {}
/// Algorithm's name
Expand Down
Expand Up @@ -79,8 +79,8 @@ namespace Algorithms {
*/
class DLLExport ModeratorTzeroLinear : public API::Algorithm {
public:
/// (Empty) Constructor
ModeratorTzeroLinear() : API::Algorithm() {}
/// Default constructor
ModeratorTzeroLinear();
/// Virtual destructor
virtual ~ModeratorTzeroLinear() {}
/// Algorithm's name
Expand Down
Expand Up @@ -66,10 +66,6 @@ class DLLExport MultiplyRange : public API::Algorithm {
void init();
/// Execution code
void exec();

int m_startBin; ///< start bin
int m_endBin; ///< end bin
double m_factor; ///<factor
};

} // namespace Algorithms
Expand Down
Expand Up @@ -54,7 +54,7 @@ File change history is stored at: <https://github.com/mantidproject/mantid>
class DLLExport OneMinusExponentialCor : public UnaryOperation {
public:
/// Default constructor
OneMinusExponentialCor() : UnaryOperation(){};
OneMinusExponentialCor();
/// Destructor
virtual ~OneMinusExponentialCor(){};
/// Algorithm's name for identification
Expand Down
Expand Up @@ -60,7 +60,7 @@ Code Documentation is available at: <http://doxygen.mantidproject.org>
class DLLExport PlotAsymmetryByLogValue : public API::Algorithm {
public:
/// Default constructor
PlotAsymmetryByLogValue() : Algorithm(){};
PlotAsymmetryByLogValue();
/// Destructor
virtual ~PlotAsymmetryByLogValue(){};
/// Algorithm's name for identification overriding a virtual method
Expand Down
Expand Up @@ -52,7 +52,7 @@ File change history is stored at: <https://github.com/mantidproject/mantid>
class DLLExport PolynomialCorrection : public UnaryOperation {
public:
/// Default constructor
PolynomialCorrection() : UnaryOperation(){};
PolynomialCorrection();
/// Destructor
virtual ~PolynomialCorrection(){};
/// Algorithm's name for identification
Expand Down
Expand Up @@ -50,7 +50,7 @@ File change history is stored at: <https://github.com/mantidproject/mantid>
class DLLExport PowerLawCorrection : public UnaryOperation {
public:
/// Default constructor
PowerLawCorrection() : UnaryOperation(){};
PowerLawCorrection();
/// Destructor
virtual ~PowerLawCorrection(){};
/// Algorithm's name for identification
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/Q1D2.h
Expand Up @@ -39,8 +39,8 @@ namespace Algorithms {
*/
class DLLExport Q1D2 : public API::Algorithm {
public:
/// (Empty) Constructor
Q1D2() : API::Algorithm() {}
/// Default constructor
Q1D2();
/// Virtual destructor
virtual ~Q1D2() {}
/// Algorithm's name
Expand Down
Expand Up @@ -58,8 +58,6 @@ class DLLExport RealFFT : public API::Algorithm {
// Overridden Algorithm methods
void init();
void exec();

bool IgnoreXBins;
};

} // namespace Algorithm
Expand Down
Expand Up @@ -86,17 +86,15 @@ class DLLExport Rebin2D : public API::Algorithm {
boost::shared_ptr<API::Progress> m_progress;

private:
/// Flag for using a RebinnedOutput workspace
bool useFractionalArea;

/// Initialise the properties
void init();
/// Run the algorithm
void exec();
/// Setup the output workspace
API::MatrixWorkspace_sptr
createOutputWorkspace(API::MatrixWorkspace_const_sptr parent,
MantidVec &newXBins, MantidVec &newYBins) const;
MantidVec &newXBins, MantidVec &newYBins,
const bool useFractionalArea) const;
};

} // namespace Algorithms
Expand Down
Expand Up @@ -54,7 +54,7 @@ namespace Algorithms {
class DLLExport ReplaceSpecialValues : public UnaryOperation {
public:
/// Default constructor
ReplaceSpecialValues() : UnaryOperation() {}
ReplaceSpecialValues();
/// Destructor
virtual ~ReplaceSpecialValues() {}
/// Algorithm's name for identification
Expand Down
Expand Up @@ -85,7 +85,7 @@ class DLLExport SpatialGrouping : public API::Algorithm {
const size_t &noNeighbours);
/// create expanded bounding box for our purposes
void createBox(boost::shared_ptr<const Geometry::IDetector> det,
Geometry::BoundingBox &bndbox);
Geometry::BoundingBox &bndbox, double searchDist);
/// grow dimensions of our bounding box to the factor
void growBox(double &min, double &max, const double &factor);

Expand All @@ -95,8 +95,6 @@ class DLLExport SpatialGrouping : public API::Algorithm {
std::set<specid_t> m_included;
/// first and last values for each group
std::vector<std::vector<int>> m_groups;
/// number of pixels to search through for finding group
double m_pix;

/// Source workspace
Mantid::API::MatrixWorkspace_const_sptr inputWorkspace;
Expand Down
Expand Up @@ -66,10 +66,6 @@ class DLLExport SumNeighbours : public API::Algorithm {
// Overridden Algorithm methods
void init();
void exec();
/// Number to sum
int SumX;
/// Number to sum
int SumY;
};

} // namespace Algorithm
Expand Down
Expand Up @@ -58,7 +58,7 @@ namespace Algorithms {
class DLLExport SumSpectra : public API::Algorithm {
public:
/// Default constructor
SumSpectra() : API::Algorithm(){};
SumSpectra();
/// Destructor
virtual ~SumSpectra(){};
/// Algorithm's name for identification overriding a virtual method
Expand Down Expand Up @@ -100,13 +100,13 @@ class DLLExport SumSpectra : public API::Algorithm {
/// The spectrum to finish the integration at
int m_MaxSpec;
/// Set true to keep monitors
bool keepMonitors;
bool m_keepMonitors;
/// numberOfSpectra in the input
int numberOfSpectra;
int m_numberOfSpectra;
/// Blocksize of the input workspace
int yLength;
int m_yLength;
/// Set of indicies to sum
std::set<int> indices;
std::set<int> m_indices;

// if calculateing additional workspace with specially weighted averages is
// necessary
Expand Down
Expand Up @@ -35,8 +35,8 @@ namespace Algorithms {
*/
class DLLExport TOFSANSResolution : public API::Algorithm {
public:
/// (Empty) Constructor
TOFSANSResolution() : API::Algorithm() {}
/// Defatult constructor
TOFSANSResolution();
/// Virtual destructor
virtual ~TOFSANSResolution() {}
/// Algorithm's name
Expand All @@ -59,7 +59,7 @@ class DLLExport TOFSANSResolution : public API::Algorithm {
/// Return the TOF resolution for a particular wavelength
virtual double getTOFResolution(double wl);
/// Wavelength resolution (constant for all wavelengths)
double wl_resolution;
double m_wl_resolution;
};

} // namespace Algorithms
Expand Down
25 changes: 13 additions & 12 deletions Code/Mantid/Framework/Algorithms/src/AbsorptionCorrection.cpp
Expand Up @@ -22,7 +22,7 @@ AbsorptionCorrection::AbsorptionCorrection()
: API::Algorithm(), m_inputWS(), m_sampleObject(NULL), m_L1s(),
m_elementVolumes(), m_elementPositions(), m_numVolumeElements(0),
m_sampleVolume(0.0), m_refAtten(0.0), m_scattering(0), n_lambda(0),
x_step(0) {}
m_xStep(0), m_emode(0), m_lambdaFixed(0.), EXPONENTIAL() {}

void AbsorptionCorrection::init() {

Expand Down Expand Up @@ -115,13 +115,13 @@ void AbsorptionCorrection::exec() {
// If the number of wavelength points has not been given, use them all
if (isEmpty(n_lambda))
n_lambda = specSize;
x_step = specSize / n_lambda; // Bin step between points to calculate
m_xStep = specSize / n_lambda; // Bin step between points to calculate

if (x_step == 0) // Number of wavelength points >number of histogram points
x_step = 1;
if (m_xStep == 0) // Number of wavelength points >number of histogram points
m_xStep = 1;

std::ostringstream message;
message << "Numerical integration performed every " << x_step
message << "Numerical integration performed every " << m_xStep
<< " wavelength points" << std::endl;
g_log.information(message.str());
message.str("");
Expand Down Expand Up @@ -187,8 +187,8 @@ void AbsorptionCorrection::exec() {
// Get a reference to the Y's in the output WS for storing the factors
MantidVec &Y = correctionFactors->dataY(i);

// Loop through the bins in the current spectrum every x_step
for (int64_t j = 0; j < specSize; j = j + x_step) {
// Loop through the bins in the current spectrum every m_xStep
for (int64_t j = 0; j < specSize; j = j + m_xStep) {
const double lambda = (isHist ? (0.5 * (X[j] + X[j + 1])) : X[j]);
if (m_emode == 0) // Elastic
{
Expand All @@ -203,15 +203,16 @@ void AbsorptionCorrection::exec() {
Y[j] /= m_sampleVolume; // Divide by total volume of the cylinder

// Make certain that last point is calculates
if (x_step > 1 && j + x_step >= specSize && j + 1 != specSize) {
j = specSize - x_step - 1;
if (m_xStep > 1 && j + m_xStep >= specSize && j + 1 != specSize) {
j = specSize - m_xStep - 1;
}
}

if (x_step > 1) // Interpolate linearly between points separated by x_step,
// last point required
if (m_xStep >
1) // Interpolate linearly between points separated by m_xStep,
// last point required
{
VectorHelper::linearlyInterpolateY(X, Y, static_cast<double>(x_step));
VectorHelper::linearlyInterpolateY(X, Y, static_cast<double>(m_xStep));
}

prog.report();
Expand Down
4 changes: 3 additions & 1 deletion Code/Mantid/Framework/Algorithms/src/BinaryOperation.cpp
Expand Up @@ -23,7 +23,9 @@ using std::size_t;
namespace Mantid {
namespace Algorithms {
BinaryOperation::BinaryOperation()
: API::Algorithm(), m_ClearRHSWorkspace(false),
: API::Algorithm(), m_lhs(), m_elhs(), m_rhs(), m_erhs(), m_out(), m_eout(),
m_AllowDifferentNumberSpectra(false), m_ClearRHSWorkspace(false),
m_matchXSize(false), m_flipSides(false), m_keepEventWorkspace(false),
m_useHistogramForRhsEventWorkspace(false),
m_do2D_even_for_SingleColumn_on_rhs(false), m_indicesToMask(),
m_progress(NULL) {}
Expand Down

0 comments on commit b897353

Please sign in to comment.