Commit e794e226 authored by Karl Palmen's avatar Karl Palmen
Browse files

Merge remote-tracking branch 'origin/master' into 12827_shape_class_extension

parents 400df480 d4c024fe
......@@ -7,16 +7,23 @@ cmake_minimum_required ( VERSION 3.5 )
# Define the project name.
project ( Mantid )
# Policy settings
if (POLICY CMP0022)
cmake_policy (SET CMP0022 NEW)
endif ()
# System package target is important for the windows builds as it allows us to package only the dlls and exes and exclude libs. Defaults to empty for other platforms.
set ( SYSTEM_PACKAGE_TARGET "")
# Add the path to our custom 'find' modules
set ( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/buildconfig/CMake")
set ( ENABLE_MANTIDPLOT ON CACHE BOOL "Switch for compiling the gui components")
set ( ENABLE_MANTIDPLOT ON CACHE BOOL "Switch for compiling the Qt4-based gui & components")
# TODO: Switch this on by default when the builders all have Qt5 installed
set ( ENABLE_WORKBENCH OFF CACHE BOOL "Switch for compiling the Qt5-based gui & components")
SET (CPACK_INSTALL_CMAKE_PROJECTS
"${CMAKE_BINARY_DIR}" "Mantid" "ALL" "/")
set ( CPACK_INSTALL_CMAKE_PROJECTS
"${CMAKE_BINARY_DIR}" "Mantid" "ALL" "/" )
###########################################################################
# Quick exit if we only want data targets
......@@ -28,6 +35,9 @@ if( DATA_TARGETS_ONLY )
return()
endif()
###########################################################################
# Packaging configuration
###########################################################################
set ( CPACK_PACKAGE_SUFFIX "unstable" CACHE STRING "suffix used to determine the deployment type")
set_property(CACHE CPACK_PACKAGE_SUFFIX PROPERTY STRINGS nightly unstable "") #empty string and release are treated as the same thing
......@@ -71,12 +81,6 @@ endif ()
# Cross-platform setup
###########################################################################
include ( CommonSetup )
###########################################################################
# Check for Qt (DarwinSetup below needs a variable from this)
###########################################################################
if (ENABLE_MANTIDPLOT)
find_package ( Qt4 COMPONENTS QtCore QtGui QtOpenGL QtXml QtSvg REQUIRED )
endif ()
###########################################################################
# Find OpenGL
......@@ -98,25 +102,30 @@ if (COVERALLS)
endif()
###########################################################################
# Find qwt. Needs to be version 5
# Qt/Qwt/PyQt/sip
###########################################################################
if (ENABLE_MANTIDPLOT)
find_package ( Qwt REQUIRED )
if( QWT_VERSION VERSION_LESS 5.0 OR QWT_VERSION VERSION_EQUAL 6.0 OR
QWT_VERSION VERSION_GREATER 6.0 )
message ( FATAL_ERROR "Qwt version 5 is required, found: ${QWT_VERSION}" )
set ( QT_USE_IMPORTED_TARGETS ON )
find_package ( Qt4 COMPONENTS QtCore QtGui QtOpenGL QtXml QtSvg 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()
endif()
###########################################################################
# Find PyQt & sip
###########################################################################
if (ENABLE_MANTIDPLOT)
find_package ( PyQt4 REQUIRED )
find_package ( SIP REQUIRED )
separate_arguments ( PYQT4_SIP_FLAGS )
endif()
if (ENABLE_WORKBENCH)
find_package ( Qt5 COMPONENTS Core Gui Widgets REQUIRED )
find_package ( PyQt5 REQUIRED )
find_package ( SIP REQUIRED )
separate_arguments ( PYQT5_SIP_FLAGS )
endif()
###########################################################################
# gsl is currently needed by Geometry, Algorithms, Curvefitting, & MantidPlot
###########################################################################
......@@ -147,16 +156,6 @@ include_directories ( Framework/Types/inc )
set ( CORE_MANTIDLIBS Kernel HistogramData Indexing Geometry API Types )
if (ENABLE_MANTIDPLOT)
# Add a target for all GUI tests
add_custom_target ( GUITests )
add_dependencies ( GUITests MantidQtCommonTest)
add_dependencies ( check GUITests )
# Collect all tests together
add_custom_target ( AllTests )
add_dependencies ( AllTests FrameworkTests GUITests )
endif()
if ( ENABLE_MANTIDPLOT AND MAKE_VATES )
if (NOT APPLE)
......@@ -185,15 +184,22 @@ if ( MSVC )
add_definitions ( -DQWT_DLL )
endif ()
if (ENABLE_MANTIDPLOT)
if ( ENABLE_MANTIDPLOT OR ENABLE_WORKBENCH )
add_custom_target ( GUITests )
add_dependencies ( check GUITests )
# Collect all tests together
add_custom_target ( AllTests )
add_dependencies ( AllTests FrameworkTests GUITests )
add_subdirectory ( qt )
endif()
if ( ENABLE_MANTIDPLOT )
add_subdirectory ( MantidPlot )
endif()
add_subdirectory ( scripts )
if (ENABLE_MANTIDPLOT)
if ( ENABLE_MANTIDPLOT )
add_subdirectory ( docs )
endif()
......@@ -261,7 +267,7 @@ if ( ENABLE_CPACK )
elseif ( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" )
include ( CPackLinuxSetup )
# let people know what is coming out the other end
message ( STATUS " CPACK_PACKAGE_FILE_NAME = ${CPACK_PACKAGE_FILE_NAME}" )
message ( STATUS "CPACK_PACKAGE_FILE_NAME = ${CPACK_PACKAGE_FILE_NAME}" )
# rhel requirements
set ( CPACK_RPM_PACKAGE_REQUIRES "qt4 >= 4.2,nexus >= 4.3.1,gsl,glibc,qwtplot3d-qt4,muParser,numpy,h5py >= 2.3.1,PyCifRW >= 4.2.1,tbb,librdkafka" )
......@@ -342,7 +348,7 @@ if ( ENABLE_CPACK )
endif()
# soft requirement of tcmalloc if selected
IF ( USE_TCMALLOC )
message ( STATUS " Adding gperftools to the package requirements" )
message ( STATUS "Adding gperftools to the package requirements" )
set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES},gperftools-libs >= 2.0" )
set ( CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS},${PERFTOOLS_DEB_PACKAGE}" )
ENDIF ( )
......
......@@ -240,6 +240,7 @@ public:
void enableHistoryRecordingForChild(const bool on) override;
bool isRecordingHistoryForChild() { return m_recordHistoryForChild; }
void setAlwaysStoreInADS(const bool doStore) override;
bool getAlwaysStoreInADS() const override;
void setRethrows(const bool rethrow) override;
/** @name Asynchronous Execution */
......
......@@ -115,7 +115,7 @@ public:
void setAlwaysStoreInADS(const bool val) override {
m_setAlwaysStoreInADS = val;
}
bool getAlwaysStoreInADS() const { return m_setAlwaysStoreInADS; }
bool getAlwaysStoreInADS() const override { return m_setAlwaysStoreInADS; }
/// Proxies only manage parent algorithms
void enableHistoryRecordingForChild(const bool) override{};
......
......@@ -138,6 +138,9 @@ public:
/// To query whether algorithm is a child. Default to false
virtual bool isChild() const = 0;
/// To query whether the output is stored in the analysis data service.
virtual bool getAlwaysStoreInADS() const = 0;
/** To set whether algorithm is a child.
* @param isChild :: True - the algorithm is a child algorithm. False - this
* is a full managed algorithm.
......
#ifndef MANTID_API_REFAXIS_H_
#define MANTID_API_REFAXIS_H_
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidAPI/NumericAxis.h"
namespace Mantid {
......@@ -41,13 +38,12 @@ namespace API {
*/
class MANTID_API_DLL RefAxis : public NumericAxis {
public:
RefAxis(const std::size_t &length,
const MatrixWorkspace *const parentWorkspace);
RefAxis(const MatrixWorkspace *const parentWorkspace);
Axis *clone(const MatrixWorkspace *const parentWorkspace) override;
Axis *clone(const std::size_t length,
const MatrixWorkspace *const parentWorkspace) override;
std::size_t length() const override { return m_size; }
std::size_t length() const override;
/// Get a value at the specified index
double operator()(const std::size_t &index,
const std::size_t &verticalIndex) const override;
......@@ -72,8 +68,6 @@ private:
/// A pointer to the workspace holding the axis
const MatrixWorkspace *const m_parentWS;
/// Length of the axis
std::size_t m_size;
};
} // namespace API
......
......@@ -163,6 +163,11 @@ void Algorithm::setAlwaysStoreInADS(const bool doStore) {
m_alwaysStoreInADS = doStore;
}
/** Returns true if we always store in the AnalysisDataService.
* @return true if output is saved to the AnalysisDataService.
*/
bool Algorithm::getAlwaysStoreInADS() const { return m_alwaysStoreInADS; }
/** Set whether the algorithm will rethrow exceptions
* @param rethrow :: true if you want to rethrow exception.
*/
......@@ -1334,7 +1339,11 @@ bool Algorithm::processGroups() {
// Set the property using the name of that workspace
if (Property *prop =
dynamic_cast<Property *>(m_inputWorkspaceProps[iwp])) {
alg->setPropertyValue(prop->name(), ws->getName());
if (ws->getName().empty()) {
alg->setProperty(prop->name(), ws);
} else {
alg->setPropertyValue(prop->name(), ws->getName());
}
} else {
throw std::logic_error("Found a Workspace property which doesn't "
"inherit from Property.");
......
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidAPI/RefAxis.h"
#include "MantidAPI/MatrixWorkspace.h"
......@@ -8,14 +5,12 @@ namespace Mantid {
namespace API {
/** Constructor
* @param length :: The length of this axis
* @param parentWorkspace :: A pointer to the workspace that holds this axis
*/
// NumericAxis is set to length 0 since we do not need its internal storage. We
// override public functions of NumericAxis that would access it.
RefAxis::RefAxis(const std::size_t &length,
const MatrixWorkspace *const parentWorkspace)
: NumericAxis(0), m_parentWS(parentWorkspace), m_size(length) {}
RefAxis::RefAxis(const MatrixWorkspace *const parentWorkspace)
: NumericAxis(0), m_parentWS(parentWorkspace) {}
/** Private, specialised copy constructor. Needed because it's necessary to pass
* in
......@@ -27,7 +22,7 @@ RefAxis::RefAxis(const std::size_t &length,
*/
RefAxis::RefAxis(const RefAxis &right,
const MatrixWorkspace *const parentWorkspace)
: NumericAxis(right), m_parentWS(parentWorkspace), m_size(right.m_size) {}
: NumericAxis(right), m_parentWS(parentWorkspace) {}
/** Virtual constructor
* @param parentWorkspace :: A pointer to the workspace that will hold the new
......@@ -40,11 +35,12 @@ Axis *RefAxis::clone(const MatrixWorkspace *const parentWorkspace) {
Axis *RefAxis::clone(const std::size_t length,
const MatrixWorkspace *const parentWorkspace) {
auto newAxis = new RefAxis(*this, parentWorkspace);
newAxis->m_size = length;
return newAxis;
static_cast<void>(length);
return clone(parentWorkspace);
}
std::size_t RefAxis::length() const { return m_parentWS->x(0).size(); }
/** Get the axis value at the position given. In this case, the values are held
* in the
* X vectors of the workspace itself.
......@@ -57,12 +53,12 @@ Axis *RefAxis::clone(const std::size_t length,
*/
double RefAxis::operator()(const std::size_t &index,
const std::size_t &verticalIndex) const {
if (index >= m_size) {
throw Kernel::Exception::IndexError(index, m_size - 1,
const auto &x = m_parentWS->x(verticalIndex);
if (index >= x.size()) {
throw Kernel::Exception::IndexError(index, x.size() - 1,
"Axis: Index out of range.");
}
return m_parentWS->dataX(verticalIndex)[index];
return x[index];
}
/** Method not available for RefAxis. Will always throw.
......
......@@ -18,7 +18,7 @@ Workspace::~Workspace() = default;
Workspace::Workspace(const Workspace &other)
: Kernel::DataItem(other), m_title(other.m_title),
m_comment(other.m_comment), m_name(other.m_name),
m_comment(other.m_comment), m_name(),
m_history(Kernel::make_unique<WorkspaceHistory>(other.getHistory())),
m_storageMode(other.m_storageMode) {}
......
......@@ -38,23 +38,28 @@ ResultType executeBinaryOperation(const std::string &algorithmName,
alg->setRethrows(rethrow);
alg->initialize();
if (child) {
if (lhs->getName().empty()) {
alg->setProperty<LHSType>("LHSWorkspace", lhs);
alg->setProperty<RHSType>("RHSWorkspace", rhs);
// Have to set a text name for the output workspace if the algorithm is a
// child even
// though it will not be used.
alg->setPropertyValue("OutputWorkspace", "��NotApplicable");
if (lhsAsOutput) {
alg->setProperty<LHSType>("OutputWorkspace", lhs);
}
}
// If this is not a child algorithm then we need names for the properties
else {
} else {
alg->setPropertyValue("LHSWorkspace", lhs->getName());
}
if (rhs->getName().empty()) {
alg->setProperty<RHSType>("RHSWorkspace", rhs);
} else {
alg->setPropertyValue("RHSWorkspace", rhs->getName());
if (lhsAsOutput) {
}
if (lhsAsOutput) {
if (!lhs->getName().empty()) {
alg->setPropertyValue("OutputWorkspace", lhs->getName());
} else {
alg->setAlwaysStoreInADS(false);
alg->setPropertyValue("OutputWorkspace", "dummy-output-name");
alg->setProperty<LHSType>("OutputWorkspace", lhs);
}
} else {
if (name.empty()) {
alg->setAlwaysStoreInADS(false);
alg->setPropertyValue("OutputWorkspace", "dummy-output-name");
} else {
alg->setPropertyValue("OutputWorkspace", name);
}
......@@ -68,8 +73,10 @@ ResultType executeBinaryOperation(const std::string &algorithmName,
}
// Get the output workspace property
if (child) {
return alg->getProperty("OutputWorkspace");
if (!alg->getAlwaysStoreInADS()) {
API::MatrixWorkspace_sptr result = alg->getProperty("OutputWorkspace");
return boost::dynamic_pointer_cast<typename ResultType::element_type>(
result);
} else {
API::Workspace_sptr result = API::AnalysisDataService::Instance().retrieve(
alg->getPropertyValue("OutputWorkspace"));
......
......@@ -244,6 +244,14 @@ public:
TS_ASSERT_EQUALS(false, alg.isChild());
}
void testAlwaysStoreInADSGetterSetter() {
TS_ASSERT(alg.getAlwaysStoreInADS())
alg.setAlwaysStoreInADS(false);
TS_ASSERT(!alg.getAlwaysStoreInADS())
alg.setAlwaysStoreInADS(true);
TS_ASSERT(alg.getAlwaysStoreInADS())
}
void testAlgStartupLogging() {
TSM_ASSERT_EQUALS("Default logging should be true", true,
alg.getAlgStartupLogging());
......
#ifndef WORKSPACETEST_H_
#define WORKSPACETEST_H_
#include "MantidAPI/AnalysisDataService.h"
#include "MantidAPI/ISpectrum.h"
#include "MantidAPI/MatrixWorkspace.h"
#include "MantidAPI/NumericAxis.h"
......@@ -402,6 +403,17 @@ public:
TS_ASSERT_EQUALS(ws.getSpectrum(0).getDetectorIDs().size(), 0);
}
void testCloneClearsWorkspaceName() {
auto ws = boost::make_shared<WorkspaceTester>();
ws->initialize(1, 1, 1);
const std::string name{"MatrixWorkspace_testCloneClearsWorkspaceName"};
AnalysisDataService::Instance().add(name, ws);
TS_ASSERT_EQUALS(ws->getName(), name)
auto cloned = ws->clone();
TS_ASSERT(cloned->getName().empty())
AnalysisDataService::Instance().clear();
}
void testGetSetTitle() {
TS_ASSERT_EQUALS(ws->getTitle(), "");
ws->setTitle("something");
......
......@@ -982,7 +982,8 @@ enable_precompiled_headers ( inc/MantidAlgorithms/PrecompiledHeader.h SRC_FILES
add_library ( Algorithms ${SRC_FILES} ${C_SRC_FILES} ${INC_FILES})
# Set the name of the generated library
set_target_properties ( Algorithms PROPERTIES OUTPUT_NAME MantidAlgorithms
COMPILE_DEFINITIONS "IN_MANTID_ALGORITHMS" )
COMPILE_DEFINITIONS "IN_MANTID_ALGORITHMS"
)
if (OSX_VERSION VERSION_GREATER 10.8)
set_target_properties ( Algorithms PROPERTIES INSTALL_RPATH "@loader_path/../Contents/MacOS")
......
......@@ -231,8 +231,9 @@ endif()
# Add the target for this directory
add_library ( Crystal ${SRC_FILES} ${INC_FILES})
# Set the name of the generated library
set_target_properties ( Crystal PROPERTIES OUTPUT_NAME MantidCrystal
INSTALL_RPATH "@loader_path/../Contents/MacOS/")
set_target_properties ( Crystal PROPERTIES OUTPUT_NAME MantidCrystal
INSTALL_RPATH "@loader_path/../Contents/MacOS/"
)
# Add to the 'Framework' group in VS
set_property ( TARGET Crystal PROPERTY FOLDER "MantidFramework" )
......
......@@ -356,12 +356,14 @@ set ( TEST_FILES
FortranMatrixTest.h
FortranVectorTest.h
FuncMinimizers/BFGSTest.h
FuncMinimizers/DTRSMinimizerTest.h
FuncMinimizers/DampedGaussNewtonMinimizerTest.h
FuncMinimizers/ErrorMessagesTest.h
FuncMinimizers/FABADAMinimizerTest.h
FuncMinimizers/FRConjugateGradientTest.h
FuncMinimizers/LevenbergMarquardtMDTest.h
FuncMinimizers/LevenbergMarquardtTest.h
FuncMinimizers/MoreSorensenTest.h
FuncMinimizers/PRConjugateGradientTest.h
FuncMinimizers/SimplexTest.h
FunctionDomain1DSpectrumCreatorTest.h
......@@ -479,7 +481,8 @@ enable_precompiled_headers( inc/MantidCurveFitting/PrecompiledHeader.h SRC_FILES
add_library ( CurveFitting ${SRC_FILES} ${INC_FILES})
# Set the name of the generated library
set_target_properties ( CurveFitting PROPERTIES OUTPUT_NAME MantidCurveFitting
COMPILE_DEFINITIONS IN_MANTID_CURVEFITTING )
COMPILE_DEFINITIONS IN_MANTID_CURVEFITTING
)
if (OSX_VERSION VERSION_GREATER 10.8)
set_target_properties ( CurveFitting PROPERTIES INSTALL_RPATH "@loader_path/../Contents/MacOS")
......
......@@ -42,9 +42,18 @@ private:
const DoubleFortranMatrix &hf,
const DoubleFortranVector &g, double Delta,
DoubleFortranVector &d, double &normd,
const NLLS::nlls_options &options,
NLLS::nlls_inform &inform,
NLLS::calculate_step_work &w) override;
const NLLS::nlls_options &options) override;
void solveDtrs(const DoubleFortranMatrix &J, const DoubleFortranVector &f,
const DoubleFortranMatrix &hf, double Delta,
DoubleFortranVector &d, double &normd,
const NLLS::nlls_options &options);
// Used for calculating step
DoubleFortranMatrix m_A, m_ev;
DoubleFortranVector m_ew, m_v, m_v_trans, m_d_trans;
NLLS::all_eig_symm_work m_all_eig_symm_ws;
DoubleFortranVector m_scale;
};
} // namespace FuncMinimisers
......
......@@ -45,9 +45,22 @@ private:
const DoubleFortranMatrix &hf,
const DoubleFortranVector &g, double Delta,
DoubleFortranVector &d, double &normd,
const NLLS::nlls_options &options,
NLLS::nlls_inform &inform,
NLLS::calculate_step_work &w) override;
const NLLS::nlls_options &options) override;
void solveSubproblem(const DoubleFortranMatrix &J,
const DoubleFortranVector &f,
const DoubleFortranMatrix &hf, double Delta,
DoubleFortranVector &d, double &nd,
const NLLS::nlls_options &options);
bool getPdShift(double &sigma, DoubleFortranVector &d,
const NLLS::nlls_options &options);
// Used for calculating step
DoubleFortranMatrix m_A, m_LtL, m_AplusSigma;
DoubleFortranVector m_v, m_q, m_y1;
NLLS::min_eig_symm_work m_min_eig_symm_ws;
DoubleFortranVector m_scale;
};
} // namespace FuncMinimisers
......
......@@ -58,12 +58,12 @@ private:
void evalHF(const DoubleFortranVector &x, const DoubleFortranVector &f,
DoubleFortranMatrix &h) const;
/// Find a correction vector to the parameters.
virtual void
calculateStep(const DoubleFortranMatrix &J, const DoubleFortranVector &f,
const DoubleFortranMatrix &hf, const DoubleFortranVector &g,
double Delta, DoubleFortranVector &d, double &normd,
const NLLS::nlls_options &options, NLLS::nlls_inform &inform,
NLLS::calculate_step_work &w) = 0;
virtual void calculateStep(const DoubleFortranMatrix &J,
const DoubleFortranVector &f,
const DoubleFortranMatrix &hf,
const DoubleFortranVector &g, double Delta,
DoubleFortranVector &d, double &normd,
const NLLS::nlls_options &options) = 0;
/// Stored cost function
boost::shared_ptr<CostFunctions::CostFuncLeastSquares> m_leastSquares;
......
......@@ -216,6 +216,7 @@ private:
void makeMapsMultiSiteMultiSpectrum() const;
size_t makeMapsForFunction(const IFunction &fun, size_t iFirst,
const std::string &prefix) const;
void cacheSourceParameters() const;
/// Function that creates the source function.
mutable CrystalFieldControl m_control;
......@@ -238,6 +239,8 @@ private:
/// Map parameter/attribute prefixes to pointers to phys prop functions
mutable std::unordered_map<std::string, API::IFunction_sptr>
m_mapPrefixes2PhysProps;
/// Temporary cache for parameter values during source function resetting.
mutable std::vector<double> m_parameterResetCache;
};
} // namespace Functions
......
......@@ -23,13 +23,13 @@ double evaluateModel(const DoubleFortranVector &f, const DoubleFortranMatrix &J,
double calculateRho(double normf, double normfnew, double md,
const nlls_options &options);
void updateTrustRegionRadius(double &rho, const nlls_options &options,
nlls_inform &inform, NLLS_workspace &w);
NLLS_workspace &w);
void rankOneUpdate(DoubleFortranMatrix &hf, NLLS_workspace &w);
void testConvergence(double normF, double normJF, double normF0, double normJF0,
const nlls_options &options, nlls_inform &inform);
void applyScaling(const DoubleFortranMatrix &J, DoubleFortranMatrix &A,
DoubleFortranVector &v, apply_scaling_work &w,
const nlls_options &options, nlls_inform &inform);
DoubleFortranVector &v, DoubleFortranVector &scale,
const nlls_options &options);
void allEigSymm(const DoubleFortranMatrix &A, DoubleFortranVector &ew,
DoubleFortranMatrix &ev);
// void apply_second_order_info(int n, int m, const DoubleFortranVector& X,
......
......@@ -12,42 +12,19 @@ namespace NLLS {
namespace {
const double tenm3 = 1.0e-3;
const double tenm5 = 1.0e-5;
const double tenm8 = 1.0e-8;
const double hundred = 100.0;
const double ten = 10.0;
const double point9 = 0.9;
const double zero = 0.0;
const double one = 1.0;
const double two = 2.0;
const double half = 0.5;
const double sixteenth = 0.0625;
const double TEN_M3 = 1.0e-3;
const double TEN_M5 = 1.0e-5;
const double TEN_M8 = 1.0e-8;
const double HUNDRED = 100.0;
const double TEN = 10.0;
const double POINT9 = 0.9;
const double ZERO = 0.0;
const double ONE = 1.0;
const double TWO = 2.0;
const double HALF = 0.5;
const double SIXTEENTH = 0.0625;
}
enum class NLLS_ERROR {
OK = 0,
MAXITS = -1,
EVALUATION = -2,
UNSUPPORTED_MODEL = -3,
FROM_EXTERNAL = -4,
UNSUPPORTED_METHOD = -5,
ALLOCATION = -6,
MAX_TR_REDUCTIONS = -7,
X_NO_PROGRESS = -8,
N_GT_M = -9,