Unverified Commit 49dd30fa authored by Dominik Arominski's avatar Dominik Arominski Committed by GitHub
Browse files

Merge branch 'master' into ILL_loaders_cleanup

parents bfe574d8 472f13dc
[style] [style]
based_on_style = pep8 based_on_style = pep8
column_limit = 100 column_limit = 140
allow_split_before_dict_value = false allow_split_before_dict_value = false
each_dict_entry_on_separate_line = true each_dict_entry_on_separate_line = true
...@@ -30,8 +30,11 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/buildconfig/CMake") ...@@ -30,8 +30,11 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/buildconfig/CMake")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
option(ENABLE_MANTIDPLOT "Enable Qt4-based gui & components" ON) option(ENABLE_MANTIDPLOT "Enable Qt4-based gui & components" OFF)
option(ENABLE_WORKBENCH "Enable Qt5-based gui & components" ON) option(ENABLE_WORKBENCH "Enable Qt5-based gui & components" ON)
if(ENABLE_MANTIDPLOT)
message( FATAL_ERROR "MantidPlot has been removed from the source code")
endif()
set(CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_BINARY_DIR}" "Mantid" "ALL" "/") set(CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_BINARY_DIR}" "Mantid" "ALL" "/")
...@@ -56,6 +59,13 @@ set_property(CACHE CPACK_PACKAGE_SUFFIX ...@@ -56,6 +59,13 @@ set_property(CACHE CPACK_PACKAGE_SUFFIX
unstable unstable
"") "")
# empty string and release are treated as the same thing # empty string and release are treated as the same thing
if(CPACK_PACKAGE_SUFFIX)
# Camelcase version of suffix for Windows/Mac
string(TOUPPER ${CPACK_PACKAGE_SUFFIX} CPACK_PACKAGE_SUFFIX_CAMELCASE)
string(SUBSTRING ${CPACK_PACKAGE_SUFFIX_CAMELCASE} 0 1 CPACK_PACKAGE_SUFFIX_CAMELCASE)
string(SUBSTRING ${CPACK_PACKAGE_SUFFIX} 1 -1 _tmp_suffix_remainder)
string(CONCAT CPACK_PACKAGE_SUFFIX_CAMELCASE ${CPACK_PACKAGE_SUFFIX_CAMELCASE} ${_tmp_suffix_remainder})
endif()
# Set package name here # Set package name here
set(CPACK_PACKAGE_NAME "mantid${CPACK_PACKAGE_SUFFIX}") set(CPACK_PACKAGE_NAME "mantid${CPACK_PACKAGE_SUFFIX}")
...@@ -69,23 +79,8 @@ include(Eigen) ...@@ -69,23 +79,8 @@ include(Eigen)
include(Span) include(Span)
# Set ParaView information since later items depend on it # Set ParaView information since later items depend on it
# VATES flag. Requires ParaView # VATES flag. Requires ParaView
option(MAKE_VATES "Switch for compiling the Vates project") option(MAKE_VATES "Switch for compiling the Vates project" Off)
if(ENABLE_MANTIDPLOT AND MAKE_VATES)
find_package(ParaView)
if(ParaView_FOUND)
add_definitions(-DMAKE_VATES)
# Poco::File throws an exception when a backslash is used.
string(REPLACE "\\"
"/"
ParaView_DIR
${ParaView_DIR})
endif()
endif()
if(ENABLE_MANTIDPLOT)
include(ParaViewSetup)
endif()
if( MSVC ) if( MSVC )
include ( MSVCSetup ) include ( MSVCSetup )
...@@ -115,42 +110,13 @@ if(COVERALLS) ...@@ -115,42 +110,13 @@ if(COVERALLS)
coveralls_turn_on_coverage() coveralls_turn_on_coverage()
endif() endif()
# Qt/Qwt/PyQt/sip
if(ENABLE_MANTIDPLOT)
set(QT_USE_IMPORTED_TARGETS ON)
find_package(Qt4
COMPONENTS QtCore
QtDesigner
QtGui
QtOpenGL
QtScript
QtSvg
QtXml
REQUIRED)
find_package(QScintillaQt4 REQUIRED)
find_package(Qwt5 REQUIRED)
if(QWT5_VERSION VERSION_LESS 5.0
OR QWT5_VERSION VERSION_EQUAL 6.0
OR QWT5_VERSION VERSION_GREATER 6.0)
message(FATAL_ERROR "Qwt version 5 is required, found: ${QWT5_VERSION}")
endif()
if(UNIX_DIST MATCHES "RedHatEnterprise" AND UNIX_RELEASE MATCHES "7\..*")
set(USE_PRIVATE_SIPPYQT4 ON)
include(ExternalSipPyQt4)
else()
find_package(PyQt4 REQUIRED)
find_package(SIP REQUIRED)
endif()
separate_arguments(PYQT4_SIP_FLAGS)
endif()
if(ENABLE_WORKBENCH) if(ENABLE_WORKBENCH)
find_package(Qt5 find_package(Qt5
COMPONENTS Core COMPONENTS Core
Gui Gui
Widgets Widgets
OpenGL OpenGL
Test
REQUIRED) REQUIRED)
if(Qt5_FOUND) if(Qt5_FOUND)
message(STATUS "Found Qt ${Qt5_VERSION}: ${Qt5_DIR}") message(STATUS "Found Qt ${Qt5_VERSION}: ${Qt5_DIR}")
...@@ -187,33 +153,6 @@ include_directories(Framework/NexusGeometry/inc) ...@@ -187,33 +153,6 @@ include_directories(Framework/NexusGeometry/inc)
set(CORE_MANTIDLIBS Kernel HistogramData Indexing Beamline Geometry API Types) set(CORE_MANTIDLIBS Kernel HistogramData Indexing Beamline Geometry API Types)
if(ENABLE_MANTIDPLOT AND MAKE_VATES)
if(NOT APPLE)
list(APPEND CPACK_INSTALL_CMAKE_PROJECTS
"${ParaView_DIR}"
"ParaView Runtime Libs"
"Runtime"
"${INBUNDLE}/")
list(APPEND CPACK_INSTALL_CMAKE_PROJECTS
"${ParaView_DIR}"
"VTK Runtime Libs"
"RuntimeLibraries"
"${INBUNDLE}/")
list(APPEND CPACK_INSTALL_CMAKE_PROJECTS
"${ParaView_DIR}"
"HDF5 Core Library"
"libraries"
"${INBUNDLE}/")
list(APPEND CPACK_INSTALL_CMAKE_PROJECTS
"${ParaView_DIR}"
"HDF5 HL Library"
"hllibraries"
"${INBUNDLE}/")
endif()
endif(ENABLE_MANTIDPLOT AND MAKE_VATES)
if(UNIX) if(UNIX)
# Experimental feature. Unix only at this point. # Experimental feature. Unix only at this point.
option(UNITY_BUILD option(UNITY_BUILD
...@@ -227,7 +166,7 @@ endif() ...@@ -227,7 +166,7 @@ endif()
add_custom_target(AllTests) add_custom_target(AllTests)
add_dependencies(AllTests FrameworkTests) add_dependencies(AllTests FrameworkTests)
if(ENABLE_MANTIDPLOT OR ENABLE_WORKBENCH) if(ENABLE_WORKBENCH)
add_custom_target(GUITests) add_custom_target(GUITests)
add_dependencies(check GUITests) add_dependencies(check GUITests)
# Collect all tests together # Collect all tests together
...@@ -235,10 +174,6 @@ if(ENABLE_MANTIDPLOT OR ENABLE_WORKBENCH) ...@@ -235,10 +174,6 @@ if(ENABLE_MANTIDPLOT OR ENABLE_WORKBENCH)
add_subdirectory(qt) add_subdirectory(qt)
endif() endif()
if(ENABLE_MANTIDPLOT)
add_subdirectory(MantidPlot)
endif()
add_subdirectory(scripts) add_subdirectory(scripts)
# Docs requirements # Docs requirements
...@@ -287,11 +222,6 @@ endif() ...@@ -287,11 +222,6 @@ endif()
# Installation settings # Installation settings
if(ENABLE_MANTIDPLOT)
# N.B. INBUNDLE variable is empty except on Mac (set in DarwinSetup.cmake)
install(DIRECTORY installers/colormaps/ DESTINATION ${INBUNDLE}colormaps)
endif()
# Install the files (.desktop and icon) to create a menu items # Install the files (.desktop and icon) to create a menu items
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
function(uppercase_first_letter output_var input) function(uppercase_first_letter output_var input)
...@@ -331,17 +261,6 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") ...@@ -331,17 +261,6 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
if(CPACK_PACKAGE_SUFFIX) if(CPACK_PACKAGE_SUFFIX)
uppercase_first_letter(_app_name_suffix ${CPACK_PACKAGE_SUFFIX}) uppercase_first_letter(_app_name_suffix ${CPACK_PACKAGE_SUFFIX})
endif() endif()
if(ENABLE_MANTIDPLOT)
set(_icon_filename ${IMAGES_DIR}/mantidplot)
if(_icon_suffix)
set(_icon_filename ${_icon_filename}${_icon_suffix})
endif()
install_desktop_files(mantidplot${CPACK_PACKAGE_SUFFIX}.desktop
"Mantid Plot ${_app_name_suffix}"
${CMAKE_INSTALL_PREFIX}/bin/MantidPlot
${_icon_filename}.png
mantidplot${CPACK_PACKAGE_SUFFIX}.png )
endif()
if(ENABLE_WORKBENCH) if(ENABLE_WORKBENCH)
set(_icon_filename ${IMAGES_DIR}/mantid_workbench) set(_icon_filename ${IMAGES_DIR}/mantid_workbench)
...@@ -394,10 +313,6 @@ if(ENABLE_CPACK) ...@@ -394,10 +313,6 @@ if(ENABLE_CPACK)
"OCE-draw,OCE-foundation,OCE-modeling,OCE-ocaf,OCE-visualization," "OCE-draw,OCE-foundation,OCE-modeling,OCE-ocaf,OCE-visualization,"
"poco-crypto,poco-data,poco-mysql,poco-sqlite,poco-odbc,poco-util,poco-xml,poco-zip,poco-net,poco-netssl,poco-foundation," "poco-crypto,poco-data,poco-mysql,poco-sqlite,poco-odbc,poco-util,poco-xml,poco-zip,poco-net,poco-netssl,poco-foundation,"
"hdf,hdf5,jsoncpp >= 0.7.0") "hdf,hdf5,jsoncpp >= 0.7.0")
if(ENABLE_MANTIDPLOT)
set(CPACK_RPM_PACKAGE_REQUIRES
"${CPACK_RPM_PACKAGE_REQUIRES},qt4 >= 4.2,qscintilla,qwt5-qt4,qwtplot3d-qt4")
endif()
if(ENABLE_WORKBENCH) if(ENABLE_WORKBENCH)
set(CPACK_RPM_PACKAGE_REQUIRES set(CPACK_RPM_PACKAGE_REQUIRES
"${CPACK_RPM_PACKAGE_REQUIRES},qt5-qtbase,qscintilla-qt5") "${CPACK_RPM_PACKAGE_REQUIRES},qt5-qtbase,qscintilla-qt5")
...@@ -411,11 +326,6 @@ if(ENABLE_CPACK) ...@@ -411,11 +326,6 @@ if(ENABLE_CPACK)
"python36-six,python36-PyYAML,python36-requests,python36-toml," "python36-six,python36-PyYAML,python36-requests,python36-toml,"
"python36-ipython,python36-ipython-notebook" "python36-ipython,python36-ipython-notebook"
) )
if(ENABLE_MANTIDPLOT)
set(CPACK_RPM_PACKAGE_REQUIRES
"${CPACK_RPM_PACKAGE_REQUIRES},python36-QtPy,"
"python36-matplotlib-qt4,python36-ipython-gui")
endif()
if(ENABLE_WORKBENCH) if(ENABLE_WORKBENCH)
set(CPACK_RPM_PACKAGE_REQUIRES set(CPACK_RPM_PACKAGE_REQUIRES
"${CPACK_RPM_PACKAGE_REQUIRES},python36-qt5,python36-QtPy," "${CPACK_RPM_PACKAGE_REQUIRES},python36-qt5,python36-QtPy,"
...@@ -447,19 +357,6 @@ if(ENABLE_CPACK) ...@@ -447,19 +357,6 @@ if(ENABLE_CPACK)
"librdkafka1,librdkafka++1," "librdkafka1,librdkafka++1,"
"libpocofoundation${POCO_SOLIB_VERSION},libpocoutil${POCO_SOLIB_VERSION},libpoconet${POCO_SOLIB_VERSION},libpoconetssl${POCO_SOLIB_VERSION},libpococrypto${POCO_SOLIB_VERSION},libpocoxml${POCO_SOLIB_VERSION}" "libpocofoundation${POCO_SOLIB_VERSION},libpocoutil${POCO_SOLIB_VERSION},libpoconet${POCO_SOLIB_VERSION},libpoconetssl${POCO_SOLIB_VERSION},libpococrypto${POCO_SOLIB_VERSION},libpocoxml${POCO_SOLIB_VERSION}"
) )
if(ENABLE_MANTIDPLOT)
set(CPACK_DEBIAN_PACKAGE_DEPENDS
"${CPACK_DEBIAN_PACKAGE_DEPENDS},libqtcore4 (>= 4.2),"
"libqtgui4 (>= 4.2),"
"libqt4-opengl (>= 4.2),"
"libqt4-xml (>= 4.2),"
"libqt4-svg (>= 4.2),"
"libqt4-qt3support (>= 4.2),"
"qt4-dev-tools,"
"libqwt5-qt4,"
"libqwtplot3d-qt4-0v5,"
"libqtwebkit4")
endif()
if("${UNIX_CODENAME}" STREQUAL "bionic") if("${UNIX_CODENAME}" STREQUAL "bionic")
set(CPACK_DEBIAN_PACKAGE_DEPENDS set(CPACK_DEBIAN_PACKAGE_DEPENDS
...@@ -472,7 +369,7 @@ if(ENABLE_CPACK) ...@@ -472,7 +369,7 @@ if(ENABLE_CPACK)
set(CPACK_DEBIAN_PACKAGE_DEPENDS set(CPACK_DEBIAN_PACKAGE_DEPENDS
"${CPACK_DEBIAN_PACKAGE_DEPENDS},libqscintilla2-qt5-13") "${CPACK_DEBIAN_PACKAGE_DEPENDS},libqscintilla2-qt5-13")
endif() endif()
else() elseif ( "${UNIX_DIST}" MATCHES "Ubuntu" )
message(WARNING "Unsupported Debian-like OS: ${UNIX_CODENAME}. Packaging is unlikely to work correctly.") message(WARNING "Unsupported Debian-like OS: ${UNIX_CODENAME}. Packaging is unlikely to work correctly.")
endif() endif()
# python requirements # python requirements
...@@ -490,10 +387,6 @@ if(ENABLE_CPACK) ...@@ -490,10 +387,6 @@ if(ENABLE_CPACK)
"python3-yaml," "python3-yaml,"
"ipython3-qtconsole") # transitional package for bionic "ipython3-qtconsole") # transitional package for bionic
if(ENABLE_MANTIDPLOT)
set(CPACK_DEBIAN_PACKAGE_DEPENDS
"${CPACK_DEBIAN_PACKAGE_DEPENDS},python3-pyqt4")
endif()
if(ENABLE_WORKBENCH) if(ENABLE_WORKBENCH)
set(CPACK_DEBIAN_PACKAGE_DEPENDS set(CPACK_DEBIAN_PACKAGE_DEPENDS
"${CPACK_DEBIAN_PACKAGE_DEPENDS},python3-pyqt5,python3-psutil") "${CPACK_DEBIAN_PACKAGE_DEPENDS},python3-pyqt5,python3-psutil")
......
...@@ -107,8 +107,12 @@ public: ...@@ -107,8 +107,12 @@ public:
[[nodiscard]] bool isExplicitlySet(size_t i) const override; [[nodiscard]] bool isExplicitlySet(size_t i) const override;
/// Get the fitting error for a parameter /// Get the fitting error for a parameter
[[nodiscard]] double getError(size_t i) const override; [[nodiscard]] double getError(size_t i) const override;
/// Get the fitting error for a parameter by name
[[nodiscard]] double getError(const std::string &name) const override;
/// Set the fitting error for a parameter /// Set the fitting error for a parameter
void setError(size_t i, double err) override; void setError(size_t i, double err) override;
/// Set the fitting error for a parameter by name
void setError(const std::string &name, double err) override;
/// Value of i-th active parameter. Override this method to make fitted /// Value of i-th active parameter. Override this method to make fitted
/// parameters different from the declared /// parameters different from the declared
[[nodiscard]] double activeParameter(size_t i) const override; [[nodiscard]] double activeParameter(size_t i) const override;
......
...@@ -65,8 +65,12 @@ public: ...@@ -65,8 +65,12 @@ public:
bool isExplicitlySet(size_t i) const override; bool isExplicitlySet(size_t i) const override;
/// Get the fitting error for a parameter /// Get the fitting error for a parameter
double getError(size_t i) const override; double getError(size_t i) const override;
/// Get the fitting error for a parameter by name
double getError(const std::string &name) const override;
/// Set the fitting error for a parameter /// Set the fitting error for a parameter
void setError(size_t i, double err) override; void setError(size_t i, double err) override;
/// Set the fitting error for a parameter by name
void setError(const std::string &name, double err) override;
/// Return parameter index from a parameter reference. /// Return parameter index from a parameter reference.
size_t getParameterIndex(const ParameterReference &ref) const override; size_t getParameterIndex(const ParameterReference &ref) const override;
......
...@@ -75,8 +75,12 @@ public: ...@@ -75,8 +75,12 @@ public:
bool isExplicitlySet(size_t i) const override; bool isExplicitlySet(size_t i) const override;
/// Get the fitting error for a parameter of decorated function. /// Get the fitting error for a parameter of decorated function.
double getError(size_t i) const override; double getError(size_t i) const override;
/// Get the fitting error for a parameter of decorated function by name.
double getError(const std::string &name) const override;
/// Set the fitting error for a parameter of decorated function. /// Set the fitting error for a parameter of decorated function.
void setError(size_t i, double err) override; void setError(size_t i, double err) override;
/// Set the fitting error for a parameter of decorated function by name.
void setError(const std::string &name, double err) override;
/// Return parameter index of decorated function from a parameter reference. /// Return parameter index of decorated function from a parameter reference.
/// Usefull for constraints and ties in composite functions. /// Usefull for constraints and ties in composite functions.
......
...@@ -44,6 +44,19 @@ class Workspace; ...@@ -44,6 +44,19 @@ class Workspace;
class MatrixWorkspace; class MatrixWorkspace;
class FunctionHandler; class FunctionHandler;
/**
* Attribute visitor structure supporting lambda expressions
* Example usage: AttributeLambdaVisitor{[](const int val) {...}, [] (const
* double val) {}} would create a visitor capable of "visiting" an integer and
* double attribute*
* It functions by inheriting the () operator defined in each lambda
*/
template <class... Ts> struct AttributeLambdaVisitor : Ts... {
using Ts::operator()...;
};
template <class... Ts>
AttributeLambdaVisitor(Ts...)->AttributeLambdaVisitor<Ts...>;
/** This is an interface to a fitting function - a semi-abstarct class. /** This is an interface to a fitting function - a semi-abstarct class.
Functions derived from IFunction can be used with the Fit algorithm. Functions derived from IFunction can be used with the Fit algorithm.
IFunction defines the structure of a fitting funtion. IFunction defines the structure of a fitting funtion.
...@@ -250,6 +263,10 @@ public: ...@@ -250,6 +263,10 @@ public:
template <typename T> T apply(ConstAttributeVisitor<T> &v) const { template <typename T> T apply(ConstAttributeVisitor<T> &v) const {
return boost::apply_visitor(v, m_data); return boost::apply_visitor(v, m_data);
} }
/// Apply a lambda visitor
template <typename... Ts> void apply(AttributeLambdaVisitor<Ts...> &v) {
boost::apply_visitor(v, m_data);
}
/// Returns type of the attribute /// Returns type of the attribute
std::string type() const; std::string type() const;
...@@ -401,8 +418,12 @@ public: ...@@ -401,8 +418,12 @@ public:
virtual bool isExplicitlySet(size_t i) const = 0; virtual bool isExplicitlySet(size_t i) const = 0;
/// Get the fitting error for a parameter /// Get the fitting error for a parameter
virtual double getError(size_t i) const = 0; virtual double getError(size_t i) const = 0;
/// Get the fitting error for a parameter by name
virtual double getError(const std::string &name) const = 0;
/// Set the fitting error for a parameter /// Set the fitting error for a parameter
virtual void setError(size_t i, double err) = 0; virtual void setError(size_t i, double err) = 0;
/// Set the fitting error for a parameter by name
virtual void setError(const std::string &name, double err) = 0;
/// Check if a parameter i is fixed /// Check if a parameter i is fixed
[[nodiscard]] bool isFixed(size_t i) const; [[nodiscard]] bool isFixed(size_t i) const;
...@@ -539,10 +560,10 @@ public: ...@@ -539,10 +560,10 @@ public:
std::shared_ptr<const Kernel::Matrix<double>> getCovarianceMatrix() const { std::shared_ptr<const Kernel::Matrix<double>> getCovarianceMatrix() const {
return m_covar; return m_covar;
} }
/// Set the chi^2 /// Set the reduced chi^2
void setChiSquared(double chi2) { m_chiSquared = chi2; } void setReducedChiSquared(double chi2) { m_chiSquared = chi2; }
/// Get the chi^2 /// Get the reduced chi^2
[[nodiscard]] double getChiSquared() const { return m_chiSquared; } [[nodiscard]] double getReducedChiSquared() const { return m_chiSquared; }
/// Set the parallel hint /// Set the parallel hint
void setParallel(bool on) { void setParallel(bool on) {
......
...@@ -61,6 +61,15 @@ public: ...@@ -61,6 +61,15 @@ public:
/// Get name of parameter that is associated to centre. /// Get name of parameter that is associated to centre.
std::string getCentreParameterName() const; std::string getCentreParameterName() const;
/// Get the name of the parameter that is changed when the
/// fwhm is changed. By default this returns an empty string (unless
/// overridden in the individual functions) as some functions change two
/// params when the fwhm is set and others don't have a width (delta
/// func).This is intended for the BackToBackExponential-based peaks where
/// the width parameter (S) can be set in the intsurment parameter file and
/// this needs to be checked when a peak is added.
virtual std::string getWidthParameterName() const { return ""; }
/// Fix a parameter or set up a tie such that value returned /// Fix a parameter or set up a tie such that value returned
/// by intensity() is constant during fitting. /// by intensity() is constant during fitting.
/// @param isDefault :: If true fix intensity by default: /// @param isDefault :: If true fix intensity by default:
......
...@@ -36,7 +36,8 @@ public: ...@@ -36,7 +36,8 @@ public:
Kernel::IValidator_sptr(new Kernel::NullValidator)); Kernel::IValidator_sptr(new Kernel::NullValidator));
IndexProperty(const IndexProperty &) = default; IndexProperty(const IndexProperty &) = default;
IndexProperty &operator=(const IndexProperty &) = default; // Copy assignment is deleted since there are reference type members.
IndexProperty &operator=(const IndexProperty &) = delete;
IndexProperty *clone() const override; IndexProperty *clone() const override;
......
...@@ -121,6 +121,9 @@ public: ...@@ -121,6 +121,9 @@ public:
bool hasGroupedDetectors() const; bool hasGroupedDetectors() const;
/// Returns true if the workspace is ragged (has differently sized spectra).
virtual bool isRaggedWorkspace() const = 0;
/// Get the footprint in memory in bytes. /// Get the footprint in memory in bytes.
size_t getMemorySize() const override; size_t getMemorySize() const override;
virtual size_t getMemorySizeForXAxes() const; virtual size_t getMemorySizeForXAxes() const;
...@@ -132,6 +135,10 @@ public: ...@@ -132,6 +135,10 @@ public:
/// This throws an exception if the lengths are not identical across the /// This throws an exception if the lengths are not identical across the
/// spectra. /// spectra.
virtual std::size_t blocksize() const = 0; virtual std::size_t blocksize() const = 0;
/// Returns the number of bins for a given histogram index.
virtual std::size_t getNumberBins(const std::size_t &index) const = 0;
/// Returns the maximum number of bins in a workspace (works on ragged data).
virtual std::size_t getMaxNumberBins() const = 0;
/// Returns the number of histograms in the workspace /// Returns the number of histograms in the workspace
virtual std::size_t getNumberHistograms() const = 0; virtual std::size_t getNumberHistograms() const = 0;
...@@ -144,7 +151,7 @@ public: ...@@ -144,7 +151,7 @@ public:
Types::Core::DateAndTime getLastPulseTime() const; Types::Core::DateAndTime getLastPulseTime() const;
/// Returns the y index which corresponds to the X Value provided /// Returns the y index which corresponds to the X Value provided
std::size_t yIndexOfX(const double xValue, const std::size_t = 0, std::size_t yIndexOfX(const double xValue, const std::size_t &index = 0,
const double tolerance = 0.0) const; const double tolerance = 0.0) const;
//---------------------------------------------------------------------- //----------------------------------------------------------------------
...@@ -579,11 +586,10 @@ protected: ...@@ -579,11 +586,10 @@ protected:
private: private:
std::size_t binIndexOfValue(Mantid::HistogramData::HistogramX const &xValues, std::size_t binIndexOfValue(Mantid::HistogramData::HistogramX const &xValues,
double const &xValue, bool const &ascendingOrder, const double xValue,
double const &tolerance) const; const bool ascendingOrder) const;
std::size_t xIndexOfValue(Mantid::HistogramData::HistogramX const &xValues, std::size_t xIndexOfValue(const Mantid::HistogramData::HistogramX &xValues,
double const &xValue, const double xValue, const double tolerance) const;
double const &tolerance) const;
MatrixWorkspace *doClone() const override = 0; MatrixWorkspace *doClone() const override = 0;
MatrixWorkspace *doCloneEmpty() const override = 0; MatrixWorkspace *doCloneEmpty() const override = 0;
......
...@@ -64,8 +64,12 @@ public: ...@@ -64,8 +64,12 @@ public:
bool isExplicitlySet(size_t i) const override; bool isExplicitlySet(size_t i) const override;
/// Get the fitting error for a parameter /// Get the fitting error for a parameter
double getError(size_t i) const override; double getError(size_t i) const override;
/// Get the fitting error for a parameter by name
double getError(const std::string &name) const override;
/// Set the fitting error for a parameter /// Set the fitting error for a parameter
void setError(size_t i, double err) override; void setError(size_t i, double err) override;
/// Set the fitting error for a parameter by name
void setError(const std::string &name, double err) override;
/// Return parameter index from a parameter reference. Usefull for constraints /// Return parameter index from a parameter reference. Usefull for constraints
/// and ties in composite functions /// and ties in composite functions
......
...@@ -7,33 +7,15 @@ ...@@ -7,33 +7,15 @@
#pragma once #pragma once
// Mantid // Mantid
#include "MantidAPI/DllConfig.h"
#include "MantidGeometry/IComponent.h" #include "MantidGeometry/IComponent.h"
#include "MantidGeometry/IDetector.h" #include "MantidGeometry/IDetector.h"
#include "MantidGeometry/Instrument.h" #include "MantidGeometry/Instrument.h"
#include "MantidKernel/ArrayProperty.h"
#include "MantidKernel/DateAndTime.h"
#include "MantidKernel/DynamicFactory.h"
#include "MantidKernel/Exception.h"
#include "MantidKernel/IPropertyManager.h"
#include "MantidKernel/Logger.h"
#include "MantidKernel/Quat.h"
#include "MantidKernel/System.h"
#include "MantidKernel/V3D.h"
// STL // STL
#include <cfloat>
#include <cmath>
#include <cstddef>
#include <map>
#include <set>
#include <string>
#include <utility>
#include <vector>
// Boost