Commit 546eae52 authored by Whitfield, Ross's avatar Whitfield, Ross
Browse files

Refs #12625 clang-format Framework.

parent 179e43f5
......@@ -194,26 +194,26 @@ typedef const Poco::AutoPtr<Mantid::Kernel::DataService<
typedef Mantid::Kernel::DataService<Mantid::API::Workspace>::
BeforeReplaceNotification WorkspaceBeforeReplaceNotification;
typedef const Poco::AutoPtr<Mantid::Kernel::DataService<
Mantid::API::Workspace>::BeforeReplaceNotification>
&WorkspaceBeforeReplaceNotification_ptr;
Mantid::API::Workspace>::BeforeReplaceNotification> &
WorkspaceBeforeReplaceNotification_ptr;
typedef Mantid::Kernel::DataService<Mantid::API::Workspace>::
AfterReplaceNotification WorkspaceAfterReplaceNotification;
typedef const Poco::AutoPtr<Mantid::Kernel::DataService<
Mantid::API::Workspace>::AfterReplaceNotification>
&WorkspaceAfterReplaceNotification_ptr;
Mantid::API::Workspace>::AfterReplaceNotification> &
WorkspaceAfterReplaceNotification_ptr;
typedef Mantid::Kernel::DataService<Mantid::API::Workspace>::
PreDeleteNotification WorkspacePreDeleteNotification;
typedef const Poco::AutoPtr<
Mantid::Kernel::DataService<Mantid::API::Workspace>::PreDeleteNotification>
&WorkspacePreDeleteNotification_ptr;
typedef const Poco::AutoPtr<Mantid::Kernel::DataService<
Mantid::API::Workspace>::PreDeleteNotification> &
WorkspacePreDeleteNotification_ptr;
typedef Mantid::Kernel::DataService<Mantid::API::Workspace>::
PostDeleteNotification WorkspacePostDeleteNotification;
typedef const Poco::AutoPtr<
Mantid::Kernel::DataService<Mantid::API::Workspace>::PostDeleteNotification>
&WorkspacePostDeleteNotification_ptr;
typedef const Poco::AutoPtr<Mantid::Kernel::DataService<
Mantid::API::Workspace>::PostDeleteNotification> &
WorkspacePostDeleteNotification_ptr;
typedef Mantid::Kernel::DataService<Mantid::API::Workspace>::ClearNotification
ClearADSNotification;
......@@ -223,25 +223,25 @@ typedef const Poco::AutoPtr<Mantid::Kernel::DataService<
typedef Mantid::Kernel::DataService<Mantid::API::Workspace>::RenameNotification
WorkspaceRenameNotification;
typedef const Poco::AutoPtr<
Mantid::Kernel::DataService<Mantid::API::Workspace>::RenameNotification>
&WorkspaceRenameNotification_ptr;
Mantid::Kernel::DataService<Mantid::API::Workspace>::RenameNotification> &
WorkspaceRenameNotification_ptr;
typedef AnalysisDataServiceImpl::GroupWorkspacesNotification
WorkspacesGroupedNotification;
typedef const Poco::AutoPtr<
AnalysisDataServiceImpl::GroupWorkspacesNotification>
&WorkspacesGroupedNotification_ptr;
AnalysisDataServiceImpl::GroupWorkspacesNotification> &
WorkspacesGroupedNotification_ptr;
typedef AnalysisDataServiceImpl::UnGroupingWorkspaceNotification
WorkspaceUnGroupingNotification;
typedef const Poco::AutoPtr<
AnalysisDataServiceImpl::UnGroupingWorkspaceNotification>
&WorkspaceUnGroupingNotification_ptr;
AnalysisDataServiceImpl::UnGroupingWorkspaceNotification> &
WorkspaceUnGroupingNotification_ptr;
typedef AnalysisDataServiceImpl::GroupUpdatedNotification
GroupUpdatedNotification;
typedef const Poco::AutoPtr<AnalysisDataServiceImpl::GroupUpdatedNotification>
&GroupUpdatedNotification_ptr;
typedef const Poco::AutoPtr<AnalysisDataServiceImpl::GroupUpdatedNotification> &
GroupUpdatedNotification_ptr;
} // Namespace API
} // Namespace Mantid
......
......@@ -33,8 +33,9 @@ public:
* @return BoxController instance
*/
BoxController(size_t nd)
: nd(nd), m_maxId(0), m_SplitThreshold(1024), m_splitTopInto(boost::none), m_numSplit(1), m_numTopSplit(1),
m_fileIO(boost::shared_ptr<API::IBoxControllerIO>()) {
: nd(nd), m_maxId(0), m_SplitThreshold(1024), m_splitTopInto(boost::none),
m_numSplit(1), m_numTopSplit(1),
m_fileIO(boost::shared_ptr<API::IBoxControllerIO>()) {
// TODO: Smarter ways to determine all of these values
m_maxDepth = 5;
m_numEventsAtMax = 0;
......@@ -130,7 +131,6 @@ public:
return m_splitTopInto;
}
/// Return how many boxes (total) a MDGridBox will contain.
size_t getNumSplit() const { return m_numSplit; }
......@@ -158,7 +158,6 @@ public:
calcNumSplit();
}
//-----------------------------------------------------------------------------------
/** Set the way splitting will be done for the top level
*
......@@ -167,11 +166,12 @@ public:
*/
void setSplitTopInto(size_t dim, size_t num) {
if (dim >= nd)
throw std::invalid_argument("BoxController::setSplitTopInto() called with "
"too high of a dimension index.");
throw std::invalid_argument(
"BoxController::setSplitTopInto() called with "
"too high of a dimension index.");
// If the vector is not created, then create it
if (!m_splitTopInto) {
m_splitTopInto = std::vector<size_t>(nd,1);
m_splitTopInto = std::vector<size_t>(nd, 1);
}
m_splitTopInto.get()[dim] = num;
calcNumTopSplit();
......@@ -294,14 +294,13 @@ public:
// We need to account for optional top level splitting
if (depth == 0 && m_splitTopInto) {
size_t numSplitTop = 1;
for (size_t d = 0; d < m_splitTopInto.get().size(); d++)
numSplitTop *= m_splitTopInto.get()[d];
m_numMDBoxes[depth + 1] += numSplitTop;
}
else {
} else {
m_numMDBoxes[depth + 1] += m_numSplit;
}
m_mutexNumMDBoxes.unlock();
......@@ -310,8 +309,11 @@ public:
/** Return the vector giving the number of MD Boxes as a function of depth */
const std::vector<size_t> &getNumMDBoxes() const { return m_numMDBoxes; }
/** Return the vector giving the number of MD Grid Boxes as a function of depth */
const std::vector<size_t> &getNumMDGridBoxes() const { return m_numMDGridBoxes; }
/** Return the vector giving the number of MD Grid Boxes as a function of
* depth */
const std::vector<size_t> &getNumMDGridBoxes() const {
return m_numMDGridBoxes;
}
/** Return the vector giving the MAXIMUM number of MD Boxes as a function of
* depth */
......@@ -420,15 +422,13 @@ private:
// Now calculate the max # of boxes
m_maxNumMDBoxes.resize(m_maxDepth + 1, 0); // Reset to 0
m_maxNumMDBoxes[0] = 1;
for (size_t depth = 1; depth < m_maxNumMDBoxes.size(); depth++)
{
if (depth ==1 && m_splitTopInto)
{
m_maxNumMDBoxes[depth] = m_maxNumMDBoxes[depth - 1] * double(m_numTopSplit);
}
else
{
m_maxNumMDBoxes[depth] = m_maxNumMDBoxes[depth - 1] * double(m_numSplit);
for (size_t depth = 1; depth < m_maxNumMDBoxes.size(); depth++) {
if (depth == 1 && m_splitTopInto) {
m_maxNumMDBoxes[depth] =
m_maxNumMDBoxes[depth - 1] * double(m_numTopSplit);
} else {
m_maxNumMDBoxes[depth] =
m_maxNumMDBoxes[depth - 1] * double(m_numSplit);
}
}
}
......
......@@ -55,16 +55,17 @@ protected:
void setLoadAlgFileProp(const std::string &filePropName);
void setAccumAlg(const std::string &alg);
void setPropManagerPropName(const std::string &propName);
void mapPropertyName(const std::string &nameInProp, const std::string &nameInPropManager);
void copyProperty(API::Algorithm_sptr alg, const std::string& name);
void mapPropertyName(const std::string &nameInProp,
const std::string &nameInPropManager);
void copyProperty(API::Algorithm_sptr alg, const std::string &name);
virtual ITableWorkspace_sptr determineChunk(const std::string &filename);
virtual MatrixWorkspace_sptr loadChunk(const size_t rowIndex);
Workspace_sptr load(const std::string &inputData,
const bool loadQuiet = false);
std::vector<std::string> splitInput(const std::string &input);
void forwardProperties();
boost::shared_ptr<Kernel::PropertyManager>
getProcessProperties(const std::string &propertyManager=std::string()) const;
boost::shared_ptr<Kernel::PropertyManager> getProcessProperties(
const std::string &propertyManager = std::string()) const;
/// MPI option. If false, we will use one job event if MPI is available
bool m_useMPI;
Workspace_sptr assemble(Workspace_sptr partialWS);
......
......@@ -74,9 +74,11 @@ public:
/// Cache a lookup of grouped detIDs to member IDs
virtual void cacheDetectorGroupings(const det2group_map &mapping);
/// Returns the detector IDs that make up the group that this ID is part of
virtual const std::vector<detid_t> &getGroupMembers(const detid_t detID) const;
virtual const std::vector<detid_t> &
getGroupMembers(const detid_t detID) const;
/// Get a detector or detector group from an ID
virtual Geometry::IDetector_const_sptr getDetectorByID(const detid_t detID) const;
virtual Geometry::IDetector_const_sptr
getDetectorByID(const detid_t detID) const;
/// Set an object describing the source properties and take ownership
virtual void setModeratorModel(ModeratorModel *source);
......@@ -110,21 +112,29 @@ public:
/// Easy access to the efixed value for this run & detector ID
virtual double getEFixed(const detid_t detID) const;
/// Easy access to the efixed value for this run & optional detector
virtual double getEFixed(const Geometry::IDetector_const_sptr detector =
Geometry::IDetector_const_sptr()) const;
virtual double
getEFixed(const Geometry::IDetector_const_sptr
detector = Geometry::IDetector_const_sptr()) const;
/// Set the efixed value for a given detector ID
virtual void setEFixed(const detid_t detID, const double value);
/// Saves this experiment description to the open NeXus file
virtual void saveExperimentInfoNexus(::NeXus::File *file) const;
/// Loads an experiment description from the open NeXus file
virtual void loadExperimentInfoNexus(const std::string& nxFilename, ::NeXus::File *file, std::string &parameterStr);
virtual void loadExperimentInfoNexus(const std::string &nxFilename,
::NeXus::File *file,
std::string &parameterStr);
/// Load the instrument from an open NeXus file.
virtual void loadInstrumentInfoNexus(const std::string& nxFilename, ::NeXus::File *file, std::string &parameterStr);
virtual void loadInstrumentInfoNexus(const std::string &nxFilename,
::NeXus::File *file,
std::string &parameterStr);
/// Load the instrument from an open NeXus file without reading any parameters
virtual void loadInstrumentInfoNexus(const std::string& nxFilename, ::NeXus::File *file);
/// Load instrument parameters from an open Nexus file in Instument group if found there
virtual void loadInstrumentParametersNexus ( ::NeXus::File *file, std::string &parameterStr);
virtual void loadInstrumentInfoNexus(const std::string &nxFilename,
::NeXus::File *file);
/// Load instrument parameters from an open Nexus file in Instument group if
/// found there
virtual void loadInstrumentParametersNexus(::NeXus::File *file,
std::string &parameterStr);
/// Load the sample and log info from an open NeXus file.
virtual void loadSampleAndLogInfoNexus(::NeXus::File *file);
......@@ -169,14 +179,20 @@ private:
const Geometry::XMLInstrumentParameter &paramInfo,
const Run &runData);
/// Attempt to load instrument embedded in Nexus file. *file must have instrument group open.
void loadEmbeddedInstrumentInfoNexus( ::NeXus::File *file, std::string &instrumentName, std::string &instrumentXML );
/// Attempt to load instrument embedded in Nexus file. *file must have
/// instrument group open.
void loadEmbeddedInstrumentInfoNexus(::NeXus::File *file,
std::string &instrumentName,
std::string &instrumentXML);
/// Set the instrument given the name and XML leading from IDF file if XML string is empty
void setInstumentFromXML( const std::string& nxFilename, std::string &instrumentName, std::string &instrumentXML );
/// Set the instrument given the name and XML leading from IDF file if XML
/// string is empty
void setInstumentFromXML(const std::string &nxFilename,
std::string &instrumentName,
std::string &instrumentXML);
//Loads the xml from an instrument file with some basic error handling
std::string loadInstrumentXML(const std::string& filename);
// Loads the xml from an instrument file with some basic error handling
std::string loadInstrumentXML(const std::string &filename);
/// Detector grouping information
det2group_map m_detgroups;
/// Mutex to protect against cow_ptr copying
......
......@@ -37,7 +37,8 @@ namespace API {
class MANTID_API_DLL FileBackedExperimentInfo : public ExperimentInfo {
public:
/// Constructor
FileBackedExperimentInfo(const std::string & filename, const std::string &path);
FileBackedExperimentInfo(const std::string &filename,
const std::string &path);
ExperimentInfo *cloneExperimentInfo() const;
......
......@@ -50,7 +50,8 @@ Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class MANTID_API_DLL FileFinderImpl {
public:
std::string getFullPath(const std::string &filename, const bool ignoreDirs = false) const;
std::string getFullPath(const std::string &filename,
const bool ignoreDirs = false) const;
std::string getPath(const std::vector<IArchiveSearch_sptr> &archs,
const std::set<std::string> &filename,
const std::vector<std::string> &extensions) const;
......
......@@ -121,7 +121,7 @@ private:
void AsynchronousStartupTasks();
/// Update instrument definitions from github
void UpdateInstrumentDefinitions();
///check if a newer version of Mantid is available
/// check if a newer version of Mantid is available
void CheckIfNewerVersionIsAvailable();
/// Sends startup usage information
void SendStartupUsageInfo();
......
......@@ -157,7 +157,7 @@ protected:
};
typedef boost::shared_ptr<FunctionParameterDecorator>
FunctionParameterDecorator_sptr;
FunctionParameterDecorator_sptr;
} // namespace API
} // namespace Mantid
......
......@@ -104,7 +104,7 @@ public:
void setFitDataFromCalculated(const FunctionValues &values);
/// Return the calculated values as a vector
std::vector<double> toVector() const {return m_calculated;}
std::vector<double> toVector() const { return m_calculated; }
protected:
/// Copy calculated values to a buffer
......
......@@ -59,7 +59,8 @@ public:
virtual double integrate(const double minX, const double maxX,
const bool entireRange) const = 0;
/// Convert the TOF values
virtual void convertTof(std::function<double(double)> func, const int sorting=0) = 0;
virtual void convertTof(std::function<double(double)> func,
const int sorting = 0) = 0;
/// Convert the TOF values
virtual void convertTof(const double factor, const double offset = 0.) = 0;
/// Scale the TOF values by a constant
......
......@@ -73,7 +73,6 @@ protected:
private:
virtual IEventWorkspace *doClone() const = 0;
};
}
}
......
......@@ -72,7 +72,6 @@ public:
/// Finalize minimization, eg store additional outputs
virtual void finalize() {}
protected:
/// Error string.
std::string m_errorString;
......
......@@ -85,12 +85,15 @@ public:
virtual void setCoordinateSystem(
const Mantid::Kernel::SpecialCoordinateSystem coordinateSystem) = 0;
/// Preferred visual normalizaiton method for any histo workspaces created from this.
virtual void setDisplayNormalizationHisto(Mantid::API::MDNormalization preferredNormalizationHisto) = 0;
/// Preferred visual normalizaiton method for any histo workspaces created
/// from this.
virtual void setDisplayNormalizationHisto(
Mantid::API::MDNormalization preferredNormalizationHisto) = 0;
virtual Mantid::API::MDNormalization displayNormalizationHisto() const = 0;
/// Preferred visual normalization method.
virtual void setDisplayNormalization(Mantid::API::MDNormalization preferredNormalization) = 0;
virtual void setDisplayNormalization(
Mantid::API::MDNormalization preferredNormalization) = 0;
virtual Mantid::API::MDNormalization displayNormalization() const = 0;
protected:
......
......@@ -53,7 +53,7 @@ class IMDNode {
*/
public:
virtual ~IMDNode(){}
virtual ~IMDNode() {}
//---------------- ISAVABLE
/**Return the pointer to the structure responsible for saving the box on disk
* if the workspace occupies too much memory */
......@@ -284,7 +284,7 @@ public:
virtual bool isBox() const = 0;
virtual signal_t getSignalByNEvents() const {
return this->getSignal()/static_cast<signal_t>(this->getNPoints());
return this->getSignal() / static_cast<signal_t>(this->getNPoints());
}
// ----------------------------- Helper Methods
......
......@@ -54,13 +54,14 @@ public:
std::unique_ptr<IMaskWorkspace> clone() const {
return std::unique_ptr<IMaskWorkspace>(doInterfaceClone());
}
protected:
/// Protected copy constructor. May be used by childs for cloning.
IMaskWorkspace(const IMaskWorkspace &other) { (void)other; }
/// Protected copy assignment operator. Assignment not implemented.
IMaskWorkspace &operator=(const IMaskWorkspace &other);
/// returns a clone of the workspace as the interface
virtual IMaskWorkspace* doInterfaceClone() const = 0;
virtual IMaskWorkspace *doInterfaceClone() const = 0;
};
/// shared pointer to the matrix workspace base class
......
......@@ -16,7 +16,6 @@ class IPeak;
}
namespace API {
//==========================================================================================
/** Interface to the class Mantid::DataObjects::PeaksWorkspace
......@@ -95,7 +94,9 @@ public:
* @param peakNum :: index of the peak to get.
* @return a pointer to a Peak object.
*/
Mantid::Geometry::IPeak *getPeakPtr(const int peakNum) { return &this->getPeak(peakNum); }
Mantid::Geometry::IPeak *getPeakPtr(const int peakNum) {
return &this->getPeak(peakNum);
}
//---------------------------------------------------------------------------------------------
/** Create an instance of a Peak
......@@ -105,15 +106,17 @@ public:
* detector. Calculated if not provided.
* @return a pointer to a new Peak object.
*/
virtual Mantid::Geometry::IPeak *createPeak(Mantid::Kernel::V3D QLabFrame,
boost::optional<double> detectorDistance) const = 0;
virtual Mantid::Geometry::IPeak *
createPeak(Mantid::Kernel::V3D QLabFrame,
boost::optional<double> detectorDistance) const = 0;
/**
* Create an instance of a peak using a V3D
* @param HKL V3D
* @return a pointer to a new Peak object.
*/
virtual Mantid::Geometry::IPeak *createPeakHKL(Mantid::Kernel::V3D HKL) const = 0;
virtual Mantid::Geometry::IPeak *
createPeakHKL(Mantid::Kernel::V3D HKL) const = 0;
//---------------------------------------------------------------------------------------------
/** Determine if the workspace has been integrated using a peaks integration
......@@ -163,7 +166,6 @@ protected:
private:
virtual IPeaksWorkspace *doClone() const = 0;
};
}
}
#endif
......@@ -87,10 +87,12 @@ public:
size_t numOriginalWorkspaces() const;
boost::shared_ptr<Workspace> getOriginalWorkspace(size_t index = 0) const;
void setOriginalWorkspace(boost::shared_ptr<Workspace> ws, size_t index = 0);
Mantid::API::CoordTransform const *getTransformFromOriginal(size_t index = 0) const;
Mantid::API::CoordTransform const *
getTransformFromOriginal(size_t index = 0) const;
void setTransformFromOriginal(Mantid::API::CoordTransform *transform,
size_t index = 0);
Mantid::API::CoordTransform const *getTransformToOriginal(size_t index = 0) const;
Mantid::API::CoordTransform const *
getTransformToOriginal(size_t index = 0) const;
void setTransformToOriginal(Mantid::API::CoordTransform *transform,
size_t index = 0);
......@@ -145,11 +147,13 @@ protected:
/// Coordinate Transformation that goes from the original workspace to this
/// workspace's coordinates.
std::vector<boost::shared_ptr<const Mantid::API::CoordTransform> > m_transforms_FromOriginal;
std::vector<boost::shared_ptr<const Mantid::API::CoordTransform>>
m_transforms_FromOriginal;
/// Coordinate Transformation that goes from this workspace's coordinates to
/// the original workspace coordinates.
std::vector<boost::shared_ptr<const Mantid::API::CoordTransform> > m_transforms_ToOriginal;
std::vector<boost::shared_ptr<const Mantid::API::CoordTransform>>
m_transforms_ToOriginal;
/// Poco delete notification observer object
Poco::NObserver<MDGeometry, Mantid::API::WorkspacePreDeleteNotification>
......
......@@ -135,7 +135,7 @@ public:
getDetectorIDToWorkspaceIndexVector(std::vector<size_t> &out, detid_t &offset,
bool throwIfMultipleDets = false) const;
virtual void getSpectrumToWorkspaceIndexVector(std::vector<size_t> &out,
specid_t &offset) const;
specid_t &offset) const;
void getIndicesFromSpectra(const std::vector<specid_t> &spectraList,
std::vector<size_t> &indexList) const;
size_t getIndexFromSpectrumNumber(const specid_t specNo) const;
......@@ -283,7 +283,8 @@ public:
}
/// Set the specified Dx (X Error) array to point to the given existing array
virtual void setDx(const std::size_t index, const MantidVecPtr::ptr_type &Dx) {
virtual void setDx(const std::size_t index,
const MantidVecPtr::ptr_type &Dx) {
getSpectrum(index)->setX(Dx);
invalidateCommonBinsFlag();
}
......@@ -373,7 +374,8 @@ public:
const MaskList &maskedBins(const size_t &spectrumIndex) const;
// Methods handling the internal monitor workspace
virtual void setMonitorWorkspace(const boost::shared_ptr<MatrixWorkspace> &monitorWS);
virtual void
setMonitorWorkspace(const boost::shared_ptr<MatrixWorkspace> &monitorWS);
boost::shared_ptr<MatrixWorkspace> monitorWorkspace() const;
void saveInstrumentNexus(::NeXus::File *file) const;
......
......@@ -46,8 +46,7 @@ namespace API {
class DLLExport MultiPeriodGroupWorker {
public:
/// Convenience typdef for workspace names.
typedef std::vector<WorkspaceGroup_sptr>
VecWSGroupType;
typedef std::vector<WorkspaceGroup_sptr> VecWSGroupType;
/// Constructor
MultiPeriodGroupWorker();
/// Copy constructor
......
......@@ -40,28 +40,28 @@
namespace Mantid {
namespace API {
class MANTID_API_DLL NotebookBuilder {
public:
NotebookBuilder(boost::shared_ptr<HistoryView> view,
NotebookBuilder(boost::shared_ptr<HistoryView> view,
std::string versionSpecificity = "old");
virtual ~NotebookBuilder(){};
virtual ~NotebookBuilder(){};
/// build an ipython notebook from the history view
const std::string build(std::string ws_name, std::string ws_title, std::string ws_comment);
/// build an ipython notebook from the history view
const std::string build(std::string ws_name, std::string ws_title,
std::string ws_comment);
private:
void writeHistoryToStream(std::vector<HistoryItem>::const_iterator &iter);
void buildChildren(std::vector<HistoryItem>::const_iterator &iter);
const std::string
buildAlgorithmString(AlgorithmHistory_const_sptr algHistory);
const std::string
buildPropertyString(Mantid::Kernel::PropertyHistory_const_sptr propHistory);
const std::vector<HistoryItem> m_historyItems;
std::string m_output;
std::string m_versionSpecificity;
std::unique_ptr<NotebookWriter> m_nb_writer;
void writeHistoryToStream(std::vector<HistoryItem>::const_iterator &iter);
void buildChildren(std::vector<HistoryItem>::const_iterator &iter);
const std::string
buildAlgorithmString(AlgorithmHistory_const_sptr algHistory);
const std::string
buildPropertyString(Mantid::Kernel::PropertyHistory_const_sptr propHistory);
const std::vector<HistoryItem> m_historyItems;
std::string m_output;
std::string m_versionSpecificity;
std::unique_ptr<NotebookWriter> m_nb_writer;
};
} // namespace API
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment