From f6207463aec71b57903d12ee3a212c65c884d1d3 Mon Sep 17 00:00:00 2001 From: Michael Wedel Date: Fri, 15 Aug 2014 13:54:09 +0200 Subject: [PATCH] Refs #9782. AutoDiffTestAlg improved --- .../CurveFitting/src/AutoDiffTestAlg.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Code/Mantid/Framework/CurveFitting/src/AutoDiffTestAlg.cpp b/Code/Mantid/Framework/CurveFitting/src/AutoDiffTestAlg.cpp index cb85120bc5b3..e14caca3d4a1 100644 --- a/Code/Mantid/Framework/CurveFitting/src/AutoDiffTestAlg.cpp +++ b/Code/Mantid/Framework/CurveFitting/src/AutoDiffTestAlg.cpp @@ -96,6 +96,8 @@ void AutoDiffTestAlg::exec() MatrixWorkspace_sptr fitData = getProperty("InputWorkspace"); m_derType = getPropertyValue("DerivativeType"); + g_log.warning() << "Using " << m_derType << " derivatives." << std::endl; + std::string parameterString = getProperty("GaussianParameters"); std::vector paramValues = parameterValues(parameterString); @@ -134,15 +136,22 @@ void AutoDiffTestAlg::exec() FunctionValues y(x); CurveFitting::Jacobian J(x.size(), 3); - g->function(x, y); + Kernel::Timer timerF; + + for(size_t i = 0; i < 10000; ++i) { + g->function(x, y); + } + + g_log.warning() << "Calculating function took " << timerF.elapsed() / 10000 << " seconds to complete." << std::endl; + - Kernel::Timer timer; + Kernel::Timer timerDf; for(size_t i = 0; i < 10000; ++i) { g->functionDeriv(x, J); } - g_log.warning() << "Calculating derivatives took " << timer.elapsed() / 10000 << " seconds to complete." << std::endl; + g_log.warning() << "Calculating derivatives took " << timerDf.elapsed() / 10000 << " seconds to complete." << std::endl; MatrixWorkspace_sptr t = WorkspaceFactory::Instance().create(fitData); @@ -206,7 +215,6 @@ std::vector AutoDiffTestAlg::parameterValues(const std::string ¶mete std::cout << std::setprecision(17); for(size_t i = 0; i < values.size(); ++i) { values[i] = boost::lexical_cast(strings[i]); - std::cout << values[i] << std::endl; } return values;