Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into 11617_calculate_chi…
Browse files Browse the repository at this point in the history
…_squared_over_dof

Conflicts:
	Code/Mantid/Framework/CurveFitting/src/Fit.cpp
Re #11617.
  • Loading branch information
mantid-roman committed Jun 1, 2015
2 parents c226493 + 6d83253 commit e502a50
Show file tree
Hide file tree
Showing 221 changed files with 2,791 additions and 2,143 deletions.
473 changes: 271 additions & 202 deletions Code/Mantid/Build/CMake/WindowsNSIS.cmake

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Code/Mantid/Framework/API/inc/MantidAPI/BoxController.h
Expand Up @@ -37,6 +37,7 @@ class DLLExport BoxController {
m_fileIO(boost::shared_ptr<API::IBoxControllerIO>()) {
// TODO: Smarter ways to determine all of these values
m_maxDepth = 5;
m_numEventsAtMax = 0;
m_addingEvents_eventsPerTask = 1000;
m_significantEventsNumber = 10000000;
m_addingEvents_numTasksPerBlock =
Expand Down
9 changes: 5 additions & 4 deletions Code/Mantid/Framework/API/inc/MantidAPI/IFunction.h
Expand Up @@ -247,16 +247,17 @@ class MANTID_API_DLL IFunction {
explicit Attribute(const std::string &str, bool quoteValue = false)
: m_data(str), m_quoteValue(quoteValue) {}
/// Create int attribute
explicit Attribute(const int &i) : m_data(i) {}
explicit Attribute(const int &i) : m_data(i), m_quoteValue(false) {}
/// Create double attribute
explicit Attribute(const double &d) : m_data(d) {}
explicit Attribute(const double &d) : m_data(d), m_quoteValue(false) {}
/// Create bool attribute
explicit Attribute(const bool &b) : m_data(b) {}
explicit Attribute(const bool &b) : m_data(b), m_quoteValue(false) {}
/// Create string attribute
explicit Attribute(const char *c)
: m_data(std::string(c)), m_quoteValue(false) {}
/// Create vector attribute
explicit Attribute(const std::vector<double> &v) : m_data(v) {}
explicit Attribute(const std::vector<double> &v)
: m_data(v), m_quoteValue(false) {}

/// Apply an attribute visitor
template <typename T> T apply(AttributeVisitor<T> &v) {
Expand Down
15 changes: 9 additions & 6 deletions Code/Mantid/Framework/API/src/Algorithm.cpp
Expand Up @@ -75,8 +75,9 @@ Algorithm::Algorithm()
m_isInitialized(false), m_isExecuted(false), m_isChildAlgorithm(false),
m_recordHistoryForChild(false), m_alwaysStoreInADS(false),
m_runningAsync(false), m_running(false), m_rethrow(false),
m_isAlgStartupLoggingEnabled(true), m_algorithmID(this),
m_singleGroup(-1), m_groupsHaveSimilarNames(false) {}
m_isAlgStartupLoggingEnabled(true), m_startChildProgress(0.),
m_endChildProgress(0.), m_algorithmID(this), m_singleGroup(-1),
m_groupsHaveSimilarNames(false) {}

/// Virtual destructor
Algorithm::~Algorithm() {
Expand Down Expand Up @@ -884,7 +885,8 @@ IAlgorithm_sptr Algorithm::fromString(const std::string &input) {
} catch (boost::bad_lexical_cast &) {
}
}
IAlgorithm_sptr alg = AlgorithmManager::Instance().createUnmanaged(algName, version);
IAlgorithm_sptr alg =
AlgorithmManager::Instance().createUnmanaged(algName, version);
alg->initialize();
if (boost::regex_search(input, what, propExp, boost::match_not_null)) {
std::string _propStr = what[1];
Expand Down Expand Up @@ -1305,11 +1307,12 @@ bool Algorithm::processGroups() {
outputBaseName += ws->name();

// Set the property using the name of that workspace
if (Property *prop = dynamic_cast<Property *>(m_inputWorkspaceProps[iwp])) {
if (Property *prop =
dynamic_cast<Property *>(m_inputWorkspaceProps[iwp])) {
alg->setPropertyValue(prop->name(), ws->name());
} else {
throw std::logic_error(
"Found a Workspace property which doesn't inherit from Property.");
throw std::logic_error("Found a Workspace property which doesn't "
"inherit from Property.");
}
} // not an empty (i.e. optional) input
} // for each InputWorkspace property
Expand Down
22 changes: 12 additions & 10 deletions Code/Mantid/Framework/API/src/BoxController.cpp
Expand Up @@ -36,8 +36,11 @@ BoxController *BoxController::clone() const {
/*Private Copy constructor used in cloning */
BoxController::BoxController(const BoxController &other)
: nd(other.nd), m_maxId(other.m_maxId),
m_SplitThreshold(other.m_SplitThreshold), m_maxDepth(other.m_maxDepth),
m_splitInto(other.m_splitInto), m_splitTopInto(other.m_splitTopInto), m_numSplit(other.m_numSplit),
m_SplitThreshold(other.m_SplitThreshold),
m_significantEventsNumber(other.m_significantEventsNumber),
m_maxDepth(other.m_maxDepth), m_numEventsAtMax(other.m_numEventsAtMax),
m_splitInto(other.m_splitInto), m_splitTopInto(other.m_splitTopInto),
m_numSplit(other.m_numSplit), m_numTopSplit(other.m_numTopSplit),
m_addingEvents_eventsPerTask(other.m_addingEvents_eventsPerTask),
m_addingEvents_numTasksPerBlock(other.m_addingEvents_numTasksPerBlock),
m_numMDBoxes(other.m_numMDBoxes),
Expand Down Expand Up @@ -166,13 +169,10 @@ std::string BoxController::toXMLString() const {
pBoxElement->appendChild(element);

element = pDoc->createElement("SplitTopInto");
if (m_splitTopInto)
{
if (m_splitTopInto) {
vecStr = Kernel::Strings::join(this->m_splitTopInto.get().begin(),
this->m_splitTopInto.get().end(), ",");
}
else
{
} else {
vecStr = "";
}
text = pDoc->createTextNode(vecStr);
Expand Down Expand Up @@ -249,9 +249,11 @@ void BoxController::fromXMLString(const std::string &xml) {
s = pBoxElement->getChildElement("SplitInto")->innerText();
this->m_splitInto = splitStringIntoVector<size_t>(s);

// Need to make sure that we handle box controllers which did not have the SplitTopInto
// attribute
Poco::AutoPtr<NodeList> nodes = pBoxElement->getElementsByTagName("SplitTopInto");
// Need to make sure that we handle box controllers which did not have the
// SplitTopInto
// attribute
Poco::AutoPtr<NodeList> nodes =
pBoxElement->getElementsByTagName("SplitTopInto");
if (nodes->length() > 0) {
s = pBoxElement->getChildElement("SplitTopInto")->innerText();
if (s.empty()) {
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/API/src/CompositeFunction.cpp
Expand Up @@ -27,7 +27,7 @@ using std::size_t;
DECLARE_FUNCTION(CompositeFunction)

/// Default constructor
CompositeFunction::CompositeFunction() : IFunction(), m_nParams(0) {
CompositeFunction::CompositeFunction() : IFunction(), m_nParams(0), m_iConstraintFunction(false) {
declareAttribute("NumDeriv", Attribute(false));
}

Expand Down
4 changes: 3 additions & 1 deletion Code/Mantid/Framework/API/src/FunctionFactory.cpp
Expand Up @@ -219,7 +219,9 @@ CompositeFunction_sptr FunctionFactoryImpl::createComposite(
}
}

cfun->applyTies();
if (cfun) {
cfun->applyTies();
}
return cfun;
}

Expand Down
5 changes: 4 additions & 1 deletion Code/Mantid/Framework/API/src/IPowderDiffPeakFunction.cpp
Expand Up @@ -21,7 +21,10 @@ int IPowderDiffPeakFunction::s_peakRadius = 5;
* property
*/
IPowderDiffPeakFunction::IPowderDiffPeakFunction()
: LATTICEINDEX(9999), HEIGHTINDEX(9999) {
: m_centre(0.), m_dcentre(0.), m_fwhm(0.), m_hasNewParameterValue(false),
m_cellParamValueChanged(false), m_sortedProfileParameterNames(),
m_unitCell(), m_unitCellSize(0.), m_parameterValid(false), mH(0), mK(0),
mL(0), mHKLSet(false), LATTICEINDEX(9999), HEIGHTINDEX(9999) {
// Set peak's radius from configuration
int peakRadius;
if (Kernel::ConfigService::Instance().getValue("curvefitting.peakRadius",
Expand Down
23 changes: 13 additions & 10 deletions Code/Mantid/Framework/API/src/SpectrumDetectorMapping.cpp
Expand Up @@ -8,8 +8,8 @@ namespace API {
* @throws std::invalid_argument if a null workspace pointer is passed in
*/
SpectrumDetectorMapping::SpectrumDetectorMapping(
const MatrixWorkspace *const workspace,
bool useSpecNoIndex): m_indexIsSpecNo(useSpecNoIndex) {
const MatrixWorkspace *const workspace, bool useSpecNoIndex)
: m_indexIsSpecNo(useSpecNoIndex) {
if (!workspace) {
throw std::invalid_argument(
"SpectrumDetectorMapping: Null workspace pointer passed");
Expand All @@ -19,7 +19,7 @@ SpectrumDetectorMapping::SpectrumDetectorMapping(
auto spectrum = workspace->getSpectrum(i);

int index;
if(m_indexIsSpecNo)
if (m_indexIsSpecNo)
index = spectrum->getSpectrumNo();
else
index = static_cast<int>(i);
Expand All @@ -36,8 +36,8 @@ SpectrumDetectorMapping::SpectrumDetectorMapping(
SpectrumDetectorMapping::SpectrumDetectorMapping(
const std::vector<specid_t> &spectrumNumbers,
const std::vector<detid_t> &detectorIDs,
const std::vector<detid_t> &ignoreDetIDs):
m_indexIsSpecNo(true) {
const std::vector<detid_t> &ignoreDetIDs)
: m_indexIsSpecNo(true) {
if (spectrumNumbers.size() != detectorIDs.size()) {
throw std::invalid_argument("SpectrumDetectorMapping: Different length "
"spectrum number & detector ID array passed");
Expand All @@ -52,7 +52,8 @@ SpectrumDetectorMapping::SpectrumDetectorMapping(
*/
SpectrumDetectorMapping::SpectrumDetectorMapping(
const specid_t *const spectrumNumbers, const detid_t *const detectorIDs,
size_t arrayLengths): m_indexIsSpecNo(true) {
size_t arrayLengths)
: m_indexIsSpecNo(true) {
if (spectrumNumbers == NULL || detectorIDs == NULL) {
throw std::invalid_argument(
"SpectrumDetectorMapping: Null array pointer passed");
Expand Down Expand Up @@ -85,7 +86,8 @@ void SpectrumDetectorMapping::fillMapFromVector(
}
}
/// Default constructor;
SpectrumDetectorMapping::SpectrumDetectorMapping() {}
SpectrumDetectorMapping::SpectrumDetectorMapping()
: m_indexIsSpecNo(false), m_mapping() {}

/// Destructor
SpectrumDetectorMapping::~SpectrumDetectorMapping() {}
Expand All @@ -102,14 +104,15 @@ std::set<specid_t> SpectrumDetectorMapping::getSpectrumNumbers() const {

const std::set<detid_t> &SpectrumDetectorMapping::getDetectorIDsForSpectrumNo(
const specid_t spectrumNo) const {
if(!m_indexIsSpecNo)
if (!m_indexIsSpecNo)
throw std::runtime_error("Indicies are in spectrum index, not number.");
return m_mapping.at(spectrumNo);
}

const std::set<detid_t> &SpectrumDetectorMapping::getDetectorIDsForSpectrumIndex(
const std::set<detid_t> &
SpectrumDetectorMapping::getDetectorIDsForSpectrumIndex(
const size_t spectrumIndex) const {
if(m_indexIsSpecNo)
if (m_indexIsSpecNo)
throw std::runtime_error("Indicies are in spectrum number, not index.");
return m_mapping.at(static_cast<int>(spectrumIndex));
}
Expand Down
Expand Up @@ -134,7 +134,7 @@ class DLLExport AbsorptionCorrection : public API::Algorithm {
double m_scattering; ///< The scattering cross-section in 1/m
int64_t n_lambda; ///< The number of points in wavelength, the rest is
/// interpolated linearly
int64_t x_step; ///< The step in bin number between adjacent points
int64_t m_xStep; ///< The step in bin number between adjacent points
int64_t m_emode; ///< The energy mode: 0 - elastic, 1 - direct, 2 - indirect
double m_lambdaFixed; ///< The wavelength corresponding to the fixed energy,
/// if provided
Expand Down
Expand Up @@ -30,7 +30,7 @@ namespace Algorithms {
class DLLExport ConvertSpectrumAxis2 : public API::Algorithm {
public:
/// (Empty) Constructor
ConvertSpectrumAxis2() : API::Algorithm() {}
ConvertSpectrumAxis2();
/// Virtual destructor
virtual ~ConvertSpectrumAxis2() {}
/// Algorithm's name
Expand Down
Expand Up @@ -33,8 +33,8 @@ const double CHOPPER_LOCATION[4] = {5700., 7800., 9497., 9507.};

class DLLExport EQSANSTofStructure : public API::Algorithm {
public:
/// (Empty) Constructor
EQSANSTofStructure() : API::Algorithm() {}
/// Default constructor
EQSANSTofStructure();
/// Virtual destructor
virtual ~EQSANSTofStructure() {}
/// Algorithm's name
Expand Down
Expand Up @@ -54,7 +54,7 @@ File change history is stored at: <https://github.com/mantidproject/mantid>
class DLLExport ExponentialCorrection : public UnaryOperation {
public:
/// Default constructor
ExponentialCorrection() : UnaryOperation(){};
ExponentialCorrection();
/// Destructor
virtual ~ExponentialCorrection(){};
/// Algorithm's name for identification
Expand Down
Expand Up @@ -89,9 +89,6 @@ class DLLExport ExtractMaskToTable : public API::Algorithm {
void addToTableWorkspace(DataObjects::TableWorkspace_sptr outws,
std::vector<detid_t> maskeddetids, double xmin,
double xmax, std::vector<detid_t> prevmaskedids);

/// Input workspace type
bool m_inputIsMask;
};

} // namespace Algorithms
Expand Down
Expand Up @@ -72,8 +72,6 @@ class DLLExport FFTSmooth : public API::Algorithm {
API::MatrixWorkspace_sptr m_unfilteredWS;
/// Temporary workspace for keeping the filtered spectrum
API::MatrixWorkspace_sptr m_filteredWS;
/// Variable for storing the lowest x value
double m_x0;
};

} // namespace Algorithm
Expand Down
Expand Up @@ -74,11 +74,6 @@ class DLLExport FFTSmooth2 : public API::Algorithm {
API::MatrixWorkspace_sptr m_unfilteredWS;
/// Temporary workspace for keeping the filtered spectrum
API::MatrixWorkspace_sptr m_filteredWS;
/// Variable for storing the lowest x value
double m_x0;

/// Will we Allow Any X Bins?
bool IgnoreXBins;
};

} // namespace Algorithm
Expand Down
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 @@ -92,7 +92,6 @@ class DLLExport GeneralisedSecondDifference : public API::Algorithm {
/// Contains the value of the property m
int m_m;
/// Progress reporting
API::Progress *m_progress;
};

} // Namespace Algorithms
Expand Down
Expand Up @@ -206,8 +206,8 @@ class DLLExport GenerateEventsFilter : public API::Algorithm {
/// Processing algorithm type
bool m_useParallel;

std::vector<std::vector<Kernel::DateAndTime>> vecSplitterTimeSet;
std::vector<std::vector<int>> vecGroupIndexSet;
std::vector<std::vector<Kernel::DateAndTime>> m_vecSplitterTimeSet;
std::vector<std::vector<int>> m_vecGroupIndexSet;
};

} // namespace Algorithms
Expand Down
Expand Up @@ -147,8 +147,8 @@ class DLLExport GetDetOffsetsMultiPeaks : public API::Algorithm {
/// Input workspace
API::MatrixWorkspace_sptr m_inputWS;
/// Input EventWorkspace (from m_inputWS)
DataObjects::EventWorkspace_const_sptr eventW;
bool isEvent;
DataObjects::EventWorkspace_const_sptr m_eventW;
bool m_isEvent;

/// Background type
std::string m_backType;
Expand All @@ -165,18 +165,18 @@ class DLLExport GetDetOffsetsMultiPeaks : public API::Algorithm {

/// Input resolution
API::MatrixWorkspace_const_sptr m_inputResolutionWS;
/// Flag of use input resolution WS
/// Flag of use input resolution
bool m_hasInputResolution;
/// Lower boundary of allowed peak width as resolution
double m_minResFactor;
/// Upper boundary of allowed peak width as resolution
double m_maxResFactor;

DataObjects::OffsetsWorkspace_sptr outputW;
DataObjects::OffsetsWorkspace_sptr m_outputW;
/// Output workspace for debugging purpose
DataObjects::OffsetsWorkspace_sptr outputNP;
DataObjects::OffsetsWorkspace_sptr m_outputNP;
/// Output Mask workspace
API::MatrixWorkspace_sptr maskWS;
API::MatrixWorkspace_sptr m_maskWS;

DataObjects::TableWorkspace_sptr m_infoTableWS;
DataObjects::TableWorkspace_sptr m_peakOffsetTableWS;
Expand Down
Expand Up @@ -70,14 +70,13 @@ class DLLExport GetDetectorOffsets : public API::Algorithm {
API::MatrixWorkspace_sptr inputW; ///< A pointer to the input workspace
DataObjects::OffsetsWorkspace_sptr
outputW; ///< A pointer to the output workspace
double Xmin; ///< The start of the X range for fitting
double Xmax; ///< The end of the X range for fitting
double maxOffset; ///< The maximum absolute value of offsets
double dreference; ///< The expected peak position in d-spacing (?)
double dideal; ///< The known peak centre value from the NIST standard
double m_Xmin; ///< The start of the X range for fitting
double m_Xmax; ///< The end of the X range for fitting
double m_maxOffset; ///< The maximum absolute value of offsets
double m_dreference; ///< The expected peak position in d-spacing (?)
double m_dideal; ///< The known peak centre value from the NIST standard
/// information
double step; ///< The step size
int64_t nspec; ///< The number of spectra in the input workspace
double m_step; ///< The step size
};

} // namespace Algorithm
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

0 comments on commit e502a50

Please sign in to comment.