Skip to content

Commit

Permalink
merge with master #37
Browse files Browse the repository at this point in the history
  • Loading branch information
LamarMoore committed Apr 9, 2018
2 parents 553e0cb + 475f554 commit 5e0a419
Show file tree
Hide file tree
Showing 1,921 changed files with 12,040 additions and 10,169 deletions.
3 changes: 3 additions & 0 deletions Framework/API/inc/MantidAPI/Algorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ class MANTID_API_DLL Algorithm : public IAlgorithm,
/// Function to return the separator token for the category string. A default
/// implementation ';' is provided
const std::string categorySeparator() const override { return ";"; }
/// Function to return all of the seeAlso (these are not validated) algorithms
/// related to this algorithm.A default implementation is provided.
const std::vector<std::string> seeAlso() const override { return {}; };
/// function to return any aliases to the algorithm; A default implementation
/// is provided
const std::string alias() const override { return ""; }
Expand Down
11 changes: 7 additions & 4 deletions Framework/API/inc/MantidAPI/AlgorithmProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,13 @@ class MANTID_API_DLL AlgorithmProxy : public IAlgorithm,
const std::string category() const override { return m_category; }
/// Function to return all of the categories that contain this algorithm
const std::vector<std::string> categories() const override;
/// Function to return the sperator token for the category string. A default
/// Function to return the seperator token for the category string. A default
/// implementation ',' is provided
const std::string categorySeparator() const override {
return m_categorySeparator;
}
/// Function to return all of the seeAlso algorithms related to this algorithm
const std::vector<std::string> seeAlso() const override { return m_seeAlso; };
/// Aliases to the algorithm
const std::string alias() const override { return m_alias; }
/// Optional documentation URL for the real algorithm
Expand Down Expand Up @@ -183,9 +185,10 @@ class MANTID_API_DLL AlgorithmProxy : public IAlgorithm,
const std::string m_name; ///< name of the real algorithm
const std::string m_category; ///< category of the real algorithm
const std::string
m_categorySeparator; ///< category seperator of the real algorithm
const std::string m_alias; ///< alias to the algorithm
const std::string m_helpURL; ///< Optional documentation URL
m_categorySeparator; ///< category seperator of the real algorithm
const std::vector<std::string> m_seeAlso; ///< seeAlso of the real algorithm
const std::string m_alias; ///< alias to the algorithm
const std::string m_helpURL; ///< Optional documentation URL
const std::string m_summary; ///<Message to display in GUI and help.
const int m_version; ///< version of the real algorithm

Expand Down
4 changes: 2 additions & 2 deletions Framework/API/inc/MantidAPI/CompositeDomainMD.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ class MANTID_API_DLL CompositeDomainMD : public CompositeDomain {
const FunctionDomain &getDomain(size_t i) const override;

protected:
mutable IMDIterator *m_iterator; ///< IMDIterator
size_t m_totalSize; ///< The total size of the domain
mutable std::unique_ptr<IMDIterator> m_iterator; ///< IMDIterator
size_t m_totalSize; ///< The total size of the domain
mutable std::vector<FunctionDomainMD *>
m_domains; ///< smaller parts of the domain
};
Expand Down
2 changes: 1 addition & 1 deletion Framework/API/inc/MantidAPI/FunctionDomainMD.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class MANTID_API_DLL FunctionDomainMD : public FunctionDomain {

protected:
/// IMDIterator
mutable IMDIterator *m_iterator;
mutable std::unique_ptr<IMDIterator> m_iterator;
/// start of the domain, 0 <= m_startIndex < m_iterator->getDataSize()
const size_t m_startIndex;
/// track the iterator's index, 0 <= m_currentIndex < m_size.
Expand Down
2 changes: 1 addition & 1 deletion Framework/API/inc/MantidAPI/FunctionProperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class MANTID_API_DLL FunctionProperty

/// Bring in the PropertyWithValue assignment operator explicitly (avoids
/// VSC++ warning)
boost::shared_ptr<IFunction> &
FunctionProperty &
operator=(const boost::shared_ptr<IFunction> &value) override;

/// Add the value of another property
Expand Down
3 changes: 3 additions & 0 deletions Framework/API/inc/MantidAPI/IAlgorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ class MANTID_API_DLL IAlgorithm : virtual public Kernel::IPropertyManager {
/// Function to return the separator token for the category string
virtual const std::string categorySeparator() const = 0;

/// Function to return all of the seeAlso algorithms related to this algorithm
virtual const std::vector<std::string> seeAlso() const = 0;

/// function to return any aliases of the algorithm.
virtual const std::string alias() const = 0;

Expand Down
26 changes: 17 additions & 9 deletions Framework/API/inc/MantidAPI/IMDIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// Includes
//----------------------------------------------------------------------
#include "MantidAPI/DllConfig.h"
#include "MantidAPI/IMDWorkspace.h"
#include "MantidGeometry/MDGeometry/IMDDimension.h"
#include "MantidGeometry/MDGeometry/MDTypes.h"
#include "MantidKernel/VMD.h"
Expand All @@ -14,10 +13,18 @@
namespace Mantid {

namespace API {
//----------------------------------------------------------------------
// Forward declaration
//----------------------------------------------------------------------
class IMDWorkspace;

/** Enum describing different ways to normalize the signal
* in a MDWorkspace.
*/
enum MDNormalization {
/// Don't normalize = return raw counts
NoNormalization = 0,
/// Divide the signal by the volume of the box/bin
VolumeNormalization = 1,
/// Divide the signal by the number of events that contributed to it.
NumEventsNormalization = 2
};

/** This is an interface to an iterator of an IMDWorkspace
Expand Down Expand Up @@ -83,13 +90,14 @@ class MANTID_API_DLL IMDIterator {
virtual signal_t getError() const = 0;

/// Return a list of vertexes defining the volume pointed to
virtual coord_t *getVertexesArray(size_t &numVertices) const = 0;
virtual std::unique_ptr<coord_t[]>
getVertexesArray(size_t &numVertices) const = 0;

/// Return a list of vertexes defining the volume pointed to, enable masking
/// of dimensions.
virtual coord_t *getVertexesArray(size_t &numVertices,
const size_t outDimensions,
const bool *maskDim) const = 0;
virtual std::unique_ptr<coord_t[]>
getVertexesArray(size_t &numVertices, const size_t outDimensions,
const bool *maskDim) const = 0;

/// Returns the position of the center of the box pointed to.
virtual Mantid::Kernel::VMD getCenter() const = 0;
Expand Down
10 changes: 6 additions & 4 deletions Framework/API/inc/MantidAPI/IMDNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <algorithm>
#include <string>
#include <memory>
#include <vector>
#include "MantidKernel/VMD.h"
#include "MantidGeometry/MDGeometry/MDTypes.h"
Expand Down Expand Up @@ -277,10 +278,11 @@ class IMDNode {
// -------------------------------- Geometry/vertexes-Related
// -------------------------------------------
virtual std::vector<Mantid::Kernel::VMD> getVertexes() const = 0;
virtual coord_t *getVertexesArray(size_t &numVertices) const = 0;
virtual coord_t *getVertexesArray(size_t &numVertices,
const size_t outDimensions,
const bool *maskDim) const = 0;
virtual std::unique_ptr<coord_t[]>
getVertexesArray(size_t &numVertices) const = 0;
virtual std::unique_ptr<coord_t[]>
getVertexesArray(size_t &numVertices, const size_t outDimensions,
const bool *maskDim) const = 0;
virtual void transformDimensions(std::vector<double> &scaling,
std::vector<double> &offset) = 0;

Expand Down
19 changes: 3 additions & 16 deletions Framework/API/inc/MantidAPI/IMDWorkspace.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef MANTID_API_IMDWORKSPACE_H_
#define MANTID_API_IMDWORKSPACE_H_

#include "MantidAPI/IMDIterator.h"
#include "MantidAPI/ITableWorkspace_fwd.h"
#include "MantidAPI/MDGeometry.h"
#include "MantidAPI/Workspace.h"
Expand All @@ -16,20 +17,6 @@ class MDImplicitFunction;

namespace API {

class IMDIterator;

/** Enum describing different ways to normalize the signal
* in a MDWorkspace.
*/
enum MDNormalization {
/// Don't normalize = return raw counts
NoNormalization = 0,
/// Divide the signal by the volume of the box/bin
VolumeNormalization = 1,
/// Divide the signal by the number of events that contributed to it.
NumEventsNormalization = 2
};

static const signal_t MDMaskValue = std::numeric_limits<double>::quiet_NaN();

/** Basic MD Workspace Abstract Class.
Expand Down Expand Up @@ -106,7 +93,7 @@ class MANTID_API_DLL IMDWorkspace : public Workspace, public API::MDGeometry {
virtual uint64_t getNEvents() const = 0;

/// Creates a new iterator pointing to the first cell in the workspace
virtual std::vector<IMDIterator *> createIterators(
virtual std::vector<std::unique_ptr<IMDIterator>> createIterators(
size_t suggestedNumCores = 1,
Mantid::Geometry::MDImplicitFunction *function = nullptr) const = 0;

Expand All @@ -126,7 +113,7 @@ class MANTID_API_DLL IMDWorkspace : public Workspace, public API::MDGeometry {
const Mantid::Kernel::VMD &end,
Mantid::API::MDNormalization normalize) const;

IMDIterator *createIterator(
std::unique_ptr<IMDIterator> createIterator(
Mantid::Geometry::MDImplicitFunction *function = nullptr) const;

std::string getConvention() const;
Expand Down
2 changes: 1 addition & 1 deletion Framework/API/inc/MantidAPI/IndexProperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class MANTID_API_DLL IndexProperty : public Kernel::ArrayProperty<int64_t> {

bool isDefault() const override;
std::string isValid() const override;
std::string operator=(const std::string &rhs);
IndexProperty &operator=(const std::string &rhs);
operator Indexing::SpectrumIndexSet() const;
Indexing::SpectrumIndexSet getIndices() const;
Indexing::IndexInfo getFilteredIndexInfo() const;
Expand Down
4 changes: 2 additions & 2 deletions Framework/API/inc/MantidAPI/IndexTypeProperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class MANTID_API_DLL IndexTypeProperty

using PropertyWithValue<std::string>::operator=;

std::string &operator=(API::IndexType type);
IndexTypeProperty &operator=(API::IndexType type);

static std::string generatePropertyName(const std::string &name = "");

Expand All @@ -63,4 +63,4 @@ class MANTID_API_DLL IndexTypeProperty
} // namespace API
} // namespace Mantid

#endif /* MANTID_API_INDEXTYPEPROPERTY_H_ */
#endif /* MANTID_API_INDEXTYPEPROPERTY_H_ */
2 changes: 1 addition & 1 deletion Framework/API/inc/MantidAPI/MatrixWorkspace.h
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ class MANTID_API_DLL MatrixWorkspace : public IMDWorkspace,
const Mantid::API::MDNormalization &normalization) const override;
/// Create iterators. Partitions the iterators according to the number of
/// cores.
std::vector<IMDIterator *> createIterators(
std::vector<std::unique_ptr<IMDIterator>> createIterators(
size_t suggestedNumCores = 1,
Mantid::Geometry::MDImplicitFunction *function = nullptr) const override;

Expand Down
8 changes: 5 additions & 3 deletions Framework/API/inc/MantidAPI/MatrixWorkspaceMDIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ class DLLExport MatrixWorkspaceMDIterator : public IMDIterator {

signal_t getError() const override;

coord_t *getVertexesArray(size_t &numVertices) const override;
std::unique_ptr<coord_t[]>
getVertexesArray(size_t &numVertices) const override;

coord_t *getVertexesArray(size_t &numVertices, const size_t outDimensions,
const bool *maskDim) const override;
std::unique_ptr<coord_t[]>
getVertexesArray(size_t &numVertices, const size_t outDimensions,
const bool *maskDim) const override;

Mantid::Kernel::VMD getCenter() const override;

Expand Down
3 changes: 1 addition & 2 deletions Framework/API/inc/MantidAPI/WorkspaceProperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ class WorkspaceProperty

WorkspaceProperty &operator=(const WorkspaceProperty &right);

boost::shared_ptr<TYPE> &
operator=(const boost::shared_ptr<TYPE> &value) override;
WorkspaceProperty &operator=(const boost::shared_ptr<TYPE> &value) override;

WorkspaceProperty &operator+=(Kernel::Property const *) override;

Expand Down
5 changes: 3 additions & 2 deletions Framework/API/inc/MantidAPI/WorkspaceProperty.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,14 @@ operator=(const WorkspaceProperty &right) {
* @return assigned PropertyWithValue
*/
template <typename TYPE>
boost::shared_ptr<TYPE> &WorkspaceProperty<TYPE>::
WorkspaceProperty<TYPE> &WorkspaceProperty<TYPE>::
operator=(const boost::shared_ptr<TYPE> &value) {
std::string wsName = value->getName();
if (this->direction() == Kernel::Direction::Input && !wsName.empty()) {
m_workspaceName = wsName;
}
return Kernel::PropertyWithValue<boost::shared_ptr<TYPE>>::operator=(value);
Kernel::PropertyWithValue<boost::shared_ptr<TYPE>>::operator=(value);
return *this;
}

//--------------------------------------------------------------------------------------
Expand Down
7 changes: 4 additions & 3 deletions Framework/API/src/AlgorithmProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ AlgorithmProxy::AlgorithmProxy(Algorithm_sptr alg)
m_executeAsync(new Poco::ActiveMethod<bool, Poco::Void, AlgorithmProxy>(
this, &AlgorithmProxy::executeAsyncImpl)),
m_name(alg->name()), m_category(alg->category()),
m_categorySeparator(alg->categorySeparator()), m_alias(alg->alias()),
m_summary(alg->summary()), m_version(alg->version()), m_alg(alg),
m_isExecuted(), m_isLoggingEnabled(true), m_loggingOffset(0),
m_categorySeparator(alg->categorySeparator()), m_seeAlso(alg->seeAlso()),
m_alias(alg->alias()), m_summary(alg->summary()),
m_version(alg->version()), m_alg(alg), m_isExecuted(),
m_isLoggingEnabled(true), m_loggingOffset(0),
m_isAlgStartupLoggingEnabled(true), m_rethrow(false), m_isChild(false),
m_setAlwaysStoreInADS(true) {
if (!alg) {
Expand Down
4 changes: 2 additions & 2 deletions Framework/API/src/EqualBinSizesValidator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ std::string
EqualBinSizesValidator::checkValidity(const MatrixWorkspace_sptr &value) const {
if (!value)
return "Enter an existing workspace";
if (value->getNumberHistograms() == 0 || value->blocksize() == 0)
return "Enter a workspace with some data in it";
if (!value->isCommonBins())
return "The workspace must have common bin boundaries for all histograms";
if (value->getNumberHistograms() == 0 || value->blocksize() == 0)
return "Enter a workspace with some data in it";

Kernel::EqualBinsChecker checker(value->readX(0), m_errorLevel,
m_warningLevel);
Expand Down
6 changes: 3 additions & 3 deletions Framework/API/src/FunctionDomainMD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ FunctionDomainMD::FunctionDomainMD(IMDWorkspace_const_sptr ws, size_t start,

/** Destructor.
*/
FunctionDomainMD::~FunctionDomainMD() { delete m_iterator; }
FunctionDomainMD::~FunctionDomainMD() = default;

/// Reset the iterator to point to the start of the domain.
void FunctionDomainMD::reset() const {
Expand All @@ -53,14 +53,14 @@ void FunctionDomainMD::reset() const {
const IMDIterator *FunctionDomainMD::getNextIterator() const {
if (m_justReset) {
m_justReset = false;
return m_iterator;
return m_iterator.get();
}
++m_currentIndex;
if (!m_iterator->next() || m_currentIndex >= m_size) {
m_currentIndex = m_size;
return nullptr;
}
return m_iterator;
return m_iterator.get();
}

/// Returns the pointer to the original workspace
Expand Down
6 changes: 3 additions & 3 deletions Framework/API/src/FunctionProperty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ FunctionProperty &FunctionProperty::operator=(const FunctionProperty &right) {
* @param value :: The value to set to
* @return assigned PropertyWithValue
*/
boost::shared_ptr<IFunction> &FunctionProperty::
FunctionProperty &FunctionProperty::
operator=(const boost::shared_ptr<IFunction> &value) {
return Kernel::PropertyWithValue<boost::shared_ptr<IFunction>>::operator=(
value);
Kernel::PropertyWithValue<boost::shared_ptr<IFunction>>::operator=(value);
return *this;
}

//--------------------------------------------------------------------------------------
Expand Down
7 changes: 4 additions & 3 deletions Framework/API/src/IMDWorkspace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@ IMDWorkspace::IMDWorkspace(const Parallel::StorageMode storageMode)
* @param function :: Implicit function limiting space to look at
* @return a single IMDIterator pointer
*/
IMDIterator *IMDWorkspace::createIterator(
std::unique_ptr<IMDIterator> IMDWorkspace::createIterator(
Mantid::Geometry::MDImplicitFunction *function) const {
std::vector<IMDIterator *> iterators = this->createIterators(1, function);
std::vector<std::unique_ptr<IMDIterator>> iterators =
this->createIterators(1, function);
if (iterators.empty())
throw std::runtime_error("IMDWorkspace::createIterator(): iterator "
"creation was not successful. No iterators "
"returned by " +
this->id());
return iterators[0];
return std::move(iterators[0]);
}

//---------------------------------------------------------------------------------------------
Expand Down
5 changes: 3 additions & 2 deletions Framework/API/src/IndexProperty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ std::string IndexProperty::isValid() const {
return error;
}

std::string IndexProperty::operator=(const std::string &rhs) {
return setValue(rhs);
IndexProperty &IndexProperty::operator=(const std::string &rhs) {
setValue(rhs);
return *this;
}

IndexProperty::operator Indexing::SpectrumIndexSet() const {
Expand Down
5 changes: 3 additions & 2 deletions Framework/API/src/IndexTypeProperty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ std::vector<std::string> IndexTypeProperty::allowedValues() const {

bool IndexTypeProperty::isMultipleSelectionAllowed() { return false; }

std::string &IndexTypeProperty::operator=(API::IndexType type) {
IndexTypeProperty &IndexTypeProperty::operator=(API::IndexType type) {
std::string val;

switch (type) {
Expand All @@ -62,7 +62,8 @@ std::string &IndexTypeProperty::operator=(API::IndexType type) {
break;
}

return *this = val;
*this = val;
return *this;
}

std::string IndexTypeProperty::generatePropertyName(const std::string &name) {
Expand Down
Loading

0 comments on commit 5e0a419

Please sign in to comment.