Skip to content

Commit

Permalink
Added simple progress reporting to Spline algorithms.
Browse files Browse the repository at this point in the history
Refs #7565
  • Loading branch information
Samuel Jackson committed Aug 5, 2013
1 parent 346187f commit e86393b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ of the bin boundaries. This will cause some values to fall outside of the range
*WIKI*/

#include "MantidAPI/TextAxis.h"
#include "MantidAPI/Progress.h"
#include "MantidKernel/BoundedValidator.h"
#include "MantidCurveFitting/SplineInterpolation.h"

Expand Down Expand Up @@ -115,6 +116,8 @@ namespace Mantid

MatrixWorkspace_sptr outputWorkspace = setupOutputWorkspace(mws, histNo);

Progress pgress(this, 0.0, 1.0, histNo);

//for each histogram in workspace, calculate interpolation and derivatives
for (int i = 0; i < histNo; ++i)
{
Expand All @@ -138,6 +141,8 @@ namespace Mantid
calculateDerivatives(mwspt, derivs[i], j+1);
}
}

pgress.report();
}

//Store the output workspaces
Expand Down
4 changes: 4 additions & 0 deletions Code/Mantid/Framework/CurveFitting/src/SplineSmoothing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ If the input workspace contains histograms, rather than data points, then Spline

#include "MantidAPI/IFunction1D.h"
#include "MantidAPI/FunctionFactory.h"
#include "MantidAPI/Progress.h"
#include "MantidAPI/TextAxis.h"
#include "MantidAPI/WorkspaceFactory.h"
#include "MantidKernel/BoundedValidator.h"
Expand Down Expand Up @@ -108,6 +109,7 @@ namespace CurveFitting
MatrixWorkspace_sptr outputWorkspace = setupOutputWorkspace(inputWorkspaceBinned, histNo);
std::vector<MatrixWorkspace_sptr> derivs (histNo);

Progress pgress(this, 0.0, 1.0, histNo);
for(int i = 0; i < histNo; ++i)
{
m_cspline = boost::make_shared<CubicSpline>();
Expand All @@ -132,6 +134,8 @@ namespace CurveFitting
calculateDerivatives(inputWorkspacePt, derivs[i], j+1, i);
}
}

pgress.report();
}

//prefix to name of deriv output workspaces
Expand Down

0 comments on commit e86393b

Please sign in to comment.