diff --git a/Framework/API/inc/MantidAPI/MuParserUtils.h b/Framework/API/inc/MantidAPI/MuParserUtils.h index eda2de76bf28f55090efe4856d4e81d329c42410..dd075d7598bb4a2094bd73bec01a7d2145204bf1 100644 --- a/Framework/API/inc/MantidAPI/MuParserUtils.h +++ b/Framework/API/inc/MantidAPI/MuParserUtils.h @@ -42,8 +42,9 @@ extern const MANTID_API_DLL std::map<double, std::string> MUPARSER_CONSTANTS; /// Add a set of default constants to a muParser. void MANTID_API_DLL addDefaultConstants(mu::Parser &parser); -typedef double(*oneVarFun)(double); // pointer to a function of one variable -extern const MANTID_API_DLL std::map<std::string, oneVarFun> MUPARSER_ONEVAR_FUNCTIONS; +typedef double (*oneVarFun)(double); // pointer to a function of one variable +extern const MANTID_API_DLL std::map<std::string, oneVarFun> + MUPARSER_ONEVAR_FUNCTIONS; void MANTID_API_DLL extraOneVarFunctions(mu::Parser &parser); diff --git a/Framework/API/src/MuParserUtils.cpp b/Framework/API/src/MuParserUtils.cpp index 47fc6ea4642c7056a1797a866747badc38470e72..fe56575992421f521b0fd38357350a72b00ceb3d 100644 --- a/Framework/API/src/MuParserUtils.cpp +++ b/Framework/API/src/MuParserUtils.cpp @@ -41,11 +41,9 @@ void DLLExport addDefaultConstants(mu::Parser &parser) { } } -typedef double(*oneVarFun)(double); // pointer to a function of one variable +typedef double (*oneVarFun)(double); // pointer to a function of one variable const std::map<std::string, oneVarFun> MUPARSER_ONEVAR_FUNCTIONS = { - {"erf", gsl_sf_erf}, - {"erfc", gsl_sf_erfc} -}; + {"erf", gsl_sf_erf}, {"erfc", gsl_sf_erfc}}; void DLLExport extraOneVarFunctions(mu::Parser &parser) { for (const auto function : MUPARSER_ONEVAR_FUNCTIONS) { diff --git a/Framework/API/test/MuParserUtilsTest.h b/Framework/API/test/MuParserUtilsTest.h index c8f0bc74aa187faaa1e39a0b891f47002b0b804b..5a03f49edf74956a8491c0801338004590e7e581 100644 --- a/Framework/API/test/MuParserUtilsTest.h +++ b/Framework/API/test/MuParserUtilsTest.h @@ -21,7 +21,6 @@ public: } private: - static bool extraOneVarFunctionsDefined(const mu::Parser &parser) { const auto functionMap = parser.GetFunDef(); for (const auto pair : MuParserUtils::MUPARSER_CONSTANTS) { diff --git a/Framework/CurveFitting/inc/MantidCurveFitting/Functions/UserFunction.h b/Framework/CurveFitting/inc/MantidCurveFitting/Functions/UserFunction.h index a078f65fc4c0a56d1e4f811241ec03214638a153..df17b444b72a8c8b3a8d60eb359f37b834b8024f 100644 --- a/Framework/CurveFitting/inc/MantidCurveFitting/Functions/UserFunction.h +++ b/Framework/CurveFitting/inc/MantidCurveFitting/Functions/UserFunction.h @@ -9,13 +9,13 @@ #include <boost/shared_array.hpp> namespace Mantid { - namespace Kernel { - class MuParserExtd; - } +namespace Kernel { +class MuParserExtd; +} } namespace mu { - class Parser; +class Parser; } namespace Mantid { @@ -90,7 +90,7 @@ private: /// The formula std::string m_formula; /// extended muParser instance - //Mantid::Kernel::MuParserExtd *m_parser; + // Mantid::Kernel::MuParserExtd *m_parser; mu::Parser *m_parser; /// Used as 'x' variable in m_parser. mutable double m_x; diff --git a/Framework/CurveFitting/src/Functions/UserFunction.cpp b/Framework/CurveFitting/src/Functions/UserFunction.cpp index c741fee342651f97f1507878da1494282dad81c0..1062456d6fdb6146dc0a9cc606bc0d4f77a64dc6 100644 --- a/Framework/CurveFitting/src/Functions/UserFunction.cpp +++ b/Framework/CurveFitting/src/Functions/UserFunction.cpp @@ -68,7 +68,7 @@ void UserFunction::setAttribute(const std::string &attName, clearAllParameters(); try { - //Mantid::Kernel::MuParserExtd tmp_parser; + // Mantid::Kernel::MuParserExtd tmp_parser; mu::Parser tmp_parser; extraOneVarFunctions(tmp_parser); tmp_parser.SetVarFactory(AddVariable, this); diff --git a/MantidQt/MantidWidgets/src/UserFunctionDialog.cpp b/MantidQt/MantidWidgets/src/UserFunctionDialog.cpp index 62299eb210bbec157116c989948dc3568278d534..ceadf692863289dcba6e3a61405da0fa9afb0357 100644 --- a/MantidQt/MantidWidgets/src/UserFunctionDialog.cpp +++ b/MantidQt/MantidWidgets/src/UserFunctionDialog.cpp @@ -81,7 +81,8 @@ void UserFunctionDialog::loadFunctions() { setFunction("Base", "sign", "sign(x)", "Sign of x"); setFunction("Base", "rint", "rint(x)", "Round to nearest integer"); setFunction("Base", "erf", "erf(x)", "error function of x"); - setFunction("Base", "erfc", "erfc(x)", "Complementary error function erfc(x) = 1 - erf(x)"); + setFunction("Base", "erfc", "erfc(x)", + "Complementary error function erfc(x) = 1 - erf(x)"); setFunction("Built-in", "Gauss", "h*exp(-s*(x-c)^2)"); setFunction("Built-in", "ExpDecay", "h*exp(-x/t)"); QFile funFile(