Skip to content
Snippets Groups Projects
Commit 6133358b authored by Anders Markvardsen's avatar Anders Markvardsen
Browse files

Start on interface to allow not only LM and Simplex to be used with

Fit but also other minimizers. Refs #1044.
parent 124aa645
No related branches found
No related tags found
No related merge requests found
...@@ -37,7 +37,7 @@ namespace API ...@@ -37,7 +37,7 @@ namespace API
File change history is stored at: <https://svn.mantidproject.org/mantid/trunk/Code/Mantid>. File change history is stored at: <https://svn.mantidproject.org/mantid/trunk/Code/Mantid>.
Code Documentation is available at: <http://doxygen.mantidproject.org> Code Documentation is available at: <http://doxygen.mantidproject.org>
*/ */
class DLLExport IPeakFunction : public IFunctionWithLocation//, public Function class DLLExport IPeakFunction : public IFunctionWithLocation
{ {
public: public:
/// Returns the peak FWHM /// Returns the peak FWHM
......
...@@ -234,6 +234,10 @@ ...@@ -234,6 +234,10 @@
RelativePath=".\src\IkedaCarpenterPV1D.cpp" RelativePath=".\src\IkedaCarpenterPV1D.cpp"
> >
</File> </File>
<File
RelativePath=".\src\LevenbergMarquardtMinimizer.cpp"
>
</File>
<File <File
RelativePath=".\src\Linear.cpp" RelativePath=".\src\Linear.cpp"
> >
...@@ -336,6 +340,10 @@ ...@@ -336,6 +340,10 @@
RelativePath=".\test\GaussianTest.h" RelativePath=".\test\GaussianTest.h"
> >
</File> </File>
<File
RelativePath=".\inc\MantidCurveFitting\IFuncMinimizer.h"
>
</File>
<File <File
RelativePath=".\inc\MantidCurveFitting\IkedaCarpenterPV.h" RelativePath=".\inc\MantidCurveFitting\IkedaCarpenterPV.h"
> >
...@@ -352,6 +360,10 @@ ...@@ -352,6 +360,10 @@
RelativePath=".\test\IkedaCarpenterPVTest.h" RelativePath=".\test\IkedaCarpenterPVTest.h"
> >
</File> </File>
<File
RelativePath=".\inc\MantidCurveFitting\LevenbergMarquardtMinimizer.h"
>
</File>
<File <File
RelativePath=".\inc\MantidCurveFitting\Linear.h" RelativePath=".\inc\MantidCurveFitting\Linear.h"
> >
......
#ifndef MANTID_CURVEFITTING_IFUNCMINIMIZER_H_
#define MANTID_CURVEFITTING_IFUNCMINIMIZER_H_
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidKernel/System.h"
#include <string>
namespace Mantid
{
namespace CurveFitting
{
/** An interface for function minimizers.
@author Anders Markvardsen, ISIS, RAL
@date 11/12/2009
Copyright &copy; 2009 STFC Rutherford Appleton Laboratory
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://svn.mantidproject.org/mantid/trunk/Code/Mantid>.
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class DLLExport IFuncMinimizer
{
public:
/// Get name of minimizer
virtual std::string name()const = 0;
/// Perform iteration with minimizer
virtual void iterate() = 0;
};
} // namespace CurveFitting
} // namespace Mantid
#endif /*MANTID_CURVEFITTING_IFUNCMINIMIZER_H_*/
#ifndef MANTID_CURVEFITTING_LEVENBERGMARQUARDTMINIMIZER_H_
#define MANTID_CURVEFITTING_LEVENBERGMARQUARDTMINIMIZER_H_
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidCurveFitting/IFuncMinimizer.h"
namespace Mantid
{
namespace CurveFitting
{
/** Implementing Levenberg-Marquardt. Wrap the GSL implementation of this
algorithm into using IFuncMinimizer interface.
@author Anders Markvardsen, ISIS, RAL
@date 11/12/2009
Copyright &copy; 2009 STFC Rutherford Appleton Laboratory
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://svn.mantidproject.org/mantid/trunk/Code/Mantid>.
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class DLLExport LevenbergMarquardtMinimizer : public IFuncMinimizer
{
public:
/// Virtual destructor
virtual ~LevenbergMarquardtMinimizer(){}
/// Get name of minimizer
virtual std::string name()const;
/// Perform iteration with minimizer
virtual void iterate();
};
} // namespace CurveFitting
} // namespace Mantid
#endif /*MANTID_CURVEFITTING_LEVENBERGMARQUARDTMINIMIZER_H_*/
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidCurveFitting/LevenbergMarquardtMinimizer.h"
#include <gsl/gsl_errno.h>
#include <gsl/gsl_fit.h>
#include "MantidKernel/Exception.h"
namespace Mantid
{
namespace CurveFitting
{
/// Get name of minimizer
std::string LevenbergMarquardtMinimizer::name()const
{
throw Kernel::Exception::NotImplementedError("Not implemented yet");
return std::string("Not implemented yet");
}
/// Perform iteration with minimizer
void LevenbergMarquardtMinimizer::iterate()
{
throw Kernel::Exception::NotImplementedError("Not implemented yet");
}
} // namespace CurveFitting
} // namespace Mantid
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment