Skip to content
Snippets Groups Projects
Commit 1e4c8841 authored by Pospelov, Gennady's avatar Pospelov, Gennady
Browse files

New MinimizerInfo and MinimizerCatalogue on the way to uniform access to the minimizer info

parent 18836970
No related branches found
No related tags found
No related merge requests found
......@@ -18,7 +18,7 @@
#include <string>
namespace MinimizerNames {
namespace ObsoleteMinimizerNames {
const std::string Minuit = "MinuitMinimizer";
const std::string GSL = "GSLMinimizer";
......@@ -26,7 +26,7 @@ const std::string Genetic = "GeneticMinimizer";
} // namespace MinimizerNames
namespace AlgorithmNames {
namespace ObsoleteAlgorithmNames {
const std::string Migrad = "Migrad";
const std::string Simplex = "Simplex";
......
// ************************************************************************** //
//
// BornAgain: simulate and fit scattering at grazing incidence
//
//! @file Fit/Minimizer/MinimizerCatalogue.cpp
//! @brief Implements class MinimizerCatalogue.
//!
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2015
//! @authors Scientific Computing Group at MLZ Garching
//! @authors C. Durniak, M. Ganeva, G. Pospelov, W. Van Herck, J. Wuttke
//
// ************************************************************************** //
#include "MinimizerCatalogue.h"
#include "MinimizerUtils.h"
#include <sstream>
#include <boost/format.hpp>
MinimizerCatalogue::MinimizerCatalogue()
{
addMinimizerInfo(MinimizerInfo::buildMinuit2Info());
addMinimizerInfo(MinimizerInfo::buildGSLMultiMinInfo());
addMinimizerInfo(MinimizerInfo::buildGSLLMAInfo());
addMinimizerInfo(MinimizerInfo::buildGSLSimAnInfo());
addMinimizerInfo(MinimizerInfo::buildGeneticInfo());
addMinimizerInfo(MinimizerInfo::buildTestMinimizerInfo());
}
//! Returns multiline string representing catalogue content.
std::string MinimizerCatalogue::toString()
{
const int text_width = 80;
std::ostringstream result;
result << std::string(text_width, '-') << "\n";
result << boost::format("%-15s|%-65s\n") % "Minimizer" % " Algorithms";
result << std::string(text_width, '-') << "\n";
for(MinimizerInfo minimizer : m_minimizers) {
result << boost::format("%-15s| %-64s\n")
% minimizer.name()
% MinimizerUtils::toString(minimizer.algorithmNames(), std::string(" "));
}
return result.str();
}
//! Returns list of algorithms defined for the minimizer with a given name.
std::vector<std::string> MinimizerCatalogue::algorithmNames(const std::string &minimizerName) const
{
return minimizerInfo(minimizerName).algorithmNames();
}
//! Returns list of algorithm's descriptions for the minimizer with a given name .
std::vector<std::string> MinimizerCatalogue::algorithmDescriptions(const std::string &minimizerName) const
{
return minimizerInfo(minimizerName).algorithmDescriptions();
}
//! Returns info for minimizer with given name.
MinimizerInfo MinimizerCatalogue::minimizerInfo(const std::string &minimizerName) const
{
for(auto info : m_minimizers)
if(info.name() == minimizerName)
return info;
throw std::runtime_error("MinimizerCatalogue::minimizerInfo -> Error. "
"No minimizer with the name '"+minimizerName+"'");
}
//! Adds minimizer info to the catalogue.
void MinimizerCatalogue::addMinimizerInfo(const MinimizerInfo &info)
{
m_minimizers.push_back(info);
}
// ************************************************************************** //
//
// BornAgain: simulate and fit scattering at grazing incidence
//
//! @file Fit/Minimizer/MinimizerCatalogue.h
//! @brief Defines class MinimizerCatalogue.
//!
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2015
//! @authors Scientific Computing Group at MLZ Garching
//! @authors C. Durniak, M. Ganeva, G. Pospelov, W. Van Herck, J. Wuttke
//
// ************************************************************************** //
#ifndef MINIMIZERCATALOGUE_H
#define MINIMIZERCATALOGUE_H
#include "WinDllMacros.h"
#include "MinimizerInfo.h"
#include <map>
//! @class MinimizerCatalogue
//! @ingroup fitting_internal
//! @brief The MinimizerCatalogue class contains information over all minimizers available.
/*
--------------------------------------------------------------------------------
Minimizer | Algorithms
--------------------------------------------------------------------------------
Minuit2 | Migrad Simplex Combined Scan Fumili
GSLMultiMin | SteepestDescent ConjugateFR ConjugatePR BFGS BFGS2
GSLLMA | Default
GSLSimAn | Default
Genetic | Default
Test | Default
*/
class BA_CORE_API_ MinimizerCatalogue {
public:
MinimizerCatalogue();
std::string toString();
std::vector<std::string> algorithmNames(const std::string& minimizerName) const;
std::vector<std::string> algorithmDescriptions(const std::string& minimizerName) const;
private:
MinimizerInfo minimizerInfo(const std::string &minimizerName) const;
void addMinimizerInfo(const MinimizerInfo &info);
std::vector<MinimizerInfo> m_minimizers;
};
#endif
// ************************************************************************** //
//
// BornAgain: simulate and fit scattering at grazing incidence
//
//! @file Fit/Minimizer/MinimizerConstants.h
//! @brief Defines class MinimizerConstants.
//!
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2015
//! @authors Scientific Computing Group at MLZ Garching
//! @authors C. Durniak, M. Ganeva, G. Pospelov, W. Van Herck, J. Wuttke
//
// ************************************************************************** //
#ifndef MINIMIZERCONSTANTS_H
#define MINIMIZERCONSTANTS_H
#include <string>
namespace MinimizerNames {
const std::string Minuit2 = "Minuit2";
const std::string GSLMultiMin = "GSLMultiMin";
const std::string GSLLMA = "GSLLMA";
const std::string GSLSimAn = "GSLSimAn";
const std::string Genetic = "Genetic";
const std::string Test = "Test";
} // namespace MinimizerNames
namespace AlgorithmNames {
const std::string Migrad = "Migrad";
const std::string Simplex = "Simplex";
const std::string Combined = "Combined";
const std::string Scan = "Scan";
const std::string Fumili = "Fumili";
const std::string SteepestDescent = "SteepestDescent";
const std::string ConjugateFR = "ConjugateFR";
const std::string ConjugatePR = "ConjugatePR";
const std::string BFGS = "BFGS";
const std::string BFGS2 = "BFGS2";
const std::string Default = "Default";
} // namespace AlgorithmNames
namespace OptionNames {
const std::string Strategy = "Strategy";
const std::string ErrorDef = "ErrorDef";
const std::string Tolerance = "Tolerance";
const std::string Precision = "Precision";
const std::string PrintLevel = "PrintLevel";
const std::string MaxFunctionCalls = "MaxFunctionCalls";
const std::string MaxIterations = "MaxIterations";
const std::string PopulationSize = "PopSize";
const std::string RandomSeed = "RandomSeed";
const std::string IterationTemp = "IterationsAtTemp";
const std::string StepSize = "StepSize";
const std::string BoltzmannK = "k";
const std::string BoltzmannInitT = "t_init";
const std::string BoltzmannMu = "mu";
const std::string BoltzmannTmin = "t_min";
} // namespace OptionsNames
#endif
......@@ -28,15 +28,15 @@
// ************************************************************************** //
//! Map of minimizer names holding list of defined algorithms for every minimizer.
class MinimizerCatalogue {
class ObsoleteMinimizerCatalogue {
public:
typedef std::map<std::string, std::vector<std::string>> catalogue_t;
typedef catalogue_t::const_iterator const_iterator;
MinimizerCatalogue();
ObsoleteMinimizerCatalogue();
const_iterator begin() const { return m_data.begin(); }
const_iterator end() const { return m_data.end(); }
bool isValid(const std::string& minimizer, const std::string& algorithm) const;
friend std::ostream& operator<<(std::ostream& ostr, const MinimizerCatalogue& m) {
friend std::ostream& operator<<(std::ostream& ostr, const ObsoleteMinimizerCatalogue& m) {
m.print(ostr); return ostr; }
private:
void print(std::ostream& ostr) const;
......@@ -44,7 +44,7 @@ private:
};
// Constructs map of minimizer names holding list of defined algorithms for every minimizer
MinimizerCatalogue::MinimizerCatalogue()
ObsoleteMinimizerCatalogue::ObsoleteMinimizerCatalogue()
{
// our minimizers
m_data["Test"] = {""};
......@@ -59,9 +59,9 @@ MinimizerCatalogue::MinimizerCatalogue()
}
void MinimizerCatalogue::print(std::ostream& ostr) const
void ObsoleteMinimizerCatalogue::print(std::ostream& ostr) const
{
for(MinimizerCatalogue::const_iterator it=m_data.begin(); it!=m_data.end(); ++it) {
for(ObsoleteMinimizerCatalogue::const_iterator it=m_data.begin(); it!=m_data.end(); ++it) {
ostr << std::setw(20) << std::left<< it->first << " : ";
for(size_t i=0; i<it->second.size(); ++i ) {
ostr << it->second[i] << " ";
......@@ -72,10 +72,10 @@ void MinimizerCatalogue::print(std::ostream& ostr) const
}
bool MinimizerCatalogue::isValid(const std::string& minimizer, const std::string& algorithm) const
bool ObsoleteMinimizerCatalogue::isValid(const std::string& minimizer, const std::string& algorithm) const
{
// check minimizers names
MinimizerCatalogue::const_iterator it = m_data.find(minimizer);
ObsoleteMinimizerCatalogue::const_iterator it = m_data.find(minimizer);
if(it != m_data.end() ) {
// check minimizer's algorithm type
for(size_t i=0; i<it->second.size(); ++i ) if(it->second[i] == algorithm ) return true;
......@@ -87,7 +87,7 @@ bool MinimizerCatalogue::isValid(const std::string& minimizer, const std::string
// class MinimizerFactory
// ************************************************************************** //
static MinimizerCatalogue catalogue;
static ObsoleteMinimizerCatalogue catalogue;
void MinimizerFactory::printCatalogue()
{
......
// ************************************************************************** //
//
// BornAgain: simulate and fit scattering at grazing incidence
//
//! @file Fit/Minimizer/MinimizerInfo.cpp
//! @brief Implements class MinimizerInfo.
//!
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2015
//! @authors Scientific Computing Group at MLZ Garching
//! @authors C. Durniak, M. Ganeva, G. Pospelov, W. Van Herck, J. Wuttke
//
// ************************************************************************** //
#include "MinimizerInfo.h"
#include "MinimizerConstants.h"
#include <sstream>
#include <stdexcept>
MinimizerInfo::MinimizerInfo(const std::string& minimizerType,
const std::string& minimizerDescription)
: InfoItem(minimizerType, minimizerDescription)
{
}
void MinimizerInfo::setAlgorithmName(const std::string &algorithmName)
{
for(AlgorithmInfo algo : m_algorithms) {
if(algo.name() == algorithmName) {
m_current_algorithm = algorithmName;
return;
}
}
std::ostringstream msg;
msg << "MinimizerInfo::setAlgorithmName() -> Error. Algorithm name '" << algorithmName
<<"' is not in the list of defined algorithms (";
for(AlgorithmInfo algo : m_algorithms)
msg << algo.name() << " ";
msg << ")";
throw std::runtime_error(msg.str());
}
std::string MinimizerInfo::algorithmName() const
{
return m_current_algorithm;
}
//! Return list of defined algorithm names.
std::vector<std::string> MinimizerInfo::algorithmNames() const
{
std::vector<std::string> result;
for(AlgorithmInfo algo : m_algorithms)
result.push_back(algo.name());
return result;
}
//! Returns list of string with description of all available algorithms.
std::vector<std::string> MinimizerInfo::algorithmDescriptions() const
{
std::vector<std::string> result;
for(AlgorithmInfo algo : m_algorithms)
result.push_back(algo.description());
return result;
}
//! Creates information for Minuit2Minimizer.
MinimizerInfo MinimizerInfo::buildMinuit2Info(const std::string &defaultAlgo)
{
MinimizerInfo result(MinimizerNames::Minuit2, "Minuit2 minimizer from ROOT library");
result.addAlgorithm(
AlgorithmNames::Migrad,
"Variable-metric method with inexact line search, best minimizer according to ROOT.");
result.addAlgorithm(AlgorithmNames::Simplex, "Simplex method of Nelder and Meadh, robust "
"against big fluctuations in objective function.");
result.addAlgorithm(AlgorithmNames::Combined,
"Combination of Migrad and Simplex (if Migrad fails).");
result.addAlgorithm(AlgorithmNames::Scan,
"Simple objective function scan, one parameter at a time.");
result.addAlgorithm(AlgorithmNames::Fumili, "Gradient descent minimizer similar to "
"Levenberg-Margquardt, sometimes can be better "
"than all others.");
if (defaultAlgo.empty()) {
result.setAlgorithmName(AlgorithmNames::Migrad);
} else {
result.setAlgorithmName(defaultAlgo);
}
return result;
}
//! Creates information for GSLMultiMinMinimizer.
MinimizerInfo MinimizerInfo::buildGSLMultiMinInfo(const std::string &defaultAlgo)
{
MinimizerInfo result(MinimizerNames::GSLMultiMin, "MultiMin minimizer from GSL library");
result.addAlgorithm(AlgorithmNames::SteepestDescent, "Steepest descent");
result.addAlgorithm(AlgorithmNames::ConjugateFR, "Fletcher-Reeves conjugate gradient");
result.addAlgorithm(AlgorithmNames::ConjugatePR, "Polak-Ribiere conjugate gradient");
result.addAlgorithm(AlgorithmNames::BFGS, "BFGS conjugate gradient");
result.addAlgorithm(AlgorithmNames::BFGS2, "BFGS conjugate gradient (Version 2)");
if(defaultAlgo.empty()) {
result.setAlgorithmName(AlgorithmNames::ConjugateFR);
} else {
result.setAlgorithmName(defaultAlgo);
}
return result;
}
//! Creates information for GSL's Levenberg-Marquardt.
MinimizerInfo MinimizerInfo::buildGSLLMAInfo()
{
MinimizerInfo result(MinimizerNames::GSLLMA, "Levenberg-Marquardt from GSL library");
result.addAlgorithm(AlgorithmNames::Default, "Default algorithm");
return result;
}
//! Creates information for GSL's simmulated annealing algorithm.
MinimizerInfo MinimizerInfo::buildGSLSimAnInfo()
{
MinimizerInfo result(MinimizerNames::GSLSimAn,
"Simmulated annealing minimizer from GSL library");
result.addAlgorithm(AlgorithmNames::Default, "Default algorithm");
return result;
}
//! Creates information for TMVA genetic minimizer
MinimizerInfo MinimizerInfo::buildGeneticInfo()
{
MinimizerInfo result(MinimizerNames::Genetic, "Genetic minimizer from TMVA library");
result.addAlgorithm(AlgorithmNames::Default, "Default algorithm");
return result;
}
//! Creates information for simple test minimizer
MinimizerInfo MinimizerInfo::buildTestMinimizerInfo()
{
MinimizerInfo result(MinimizerNames::Test, "One-shot minimizer to test whole chain");
result.addAlgorithm(AlgorithmNames::Default, "Default algorithm");
return result;
}
//! Adds minimizer algorithm to the list of defined algorithms.
void MinimizerInfo::addAlgorithm(const AlgorithmInfo& algorithm)
{
m_current_algorithm = algorithm.name();
m_algorithms.push_back(algorithm);
}
void MinimizerInfo::addAlgorithm(const std::string& algorithmName,
const std::string& algorithmDescription)
{
addAlgorithm(AlgorithmInfo(algorithmName, algorithmDescription));
}
// ************************************************************************** //
//
// BornAgain: simulate and fit scattering at grazing incidence
//
//! @file Fit/Minimizer/MinimizerInfo.h
//! @brief Declares class MinimizerInfo.
//!
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2015
//! @authors Scientific Computing Group at MLZ Garching
//! @authors C. Durniak, M. Ganeva, G. Pospelov, W. Van Herck, J. Wuttke
//
// ************************************************************************** //
#ifndef MINIMIZERINFO_H
#define MINIMIZERINFO_H
#include "WinDllMacros.h"
#include <string>
#include <vector>
//! @class InfoItem
//! @ingroup fitting_internal
//! @brief Simple item to hold the name and the description.
class BA_CORE_API_ InfoItem {
public:
InfoItem(){}
InfoItem(const std::string& itemName, const std::string& itemDescription)
: m_itemName(itemName)
, m_itemDescription(itemDescription){}
std::string name() const { return m_itemName; }
std::string description() const { return m_itemDescription; }
private:
std::string m_itemName;
std::string m_itemDescription;
};
//! @class MinimizerInfo
//! @ingroup fitting_internal
//! @brief The MinimizerInfo class provides info about the minimizer, including list of defined
//! minimization algorithms.
class BA_CORE_API_ MinimizerInfo : public InfoItem {
public:
using AlgorithmInfo = InfoItem;
MinimizerInfo(){}
MinimizerInfo(const std::string& minimizerType, const std::string& minimizerDescription);
//! Sets currently active algorithm
void setAlgorithmName(const std::string &algorithmName);
std::string algorithmName() const;
std::vector<std::string> algorithmNames() const;
std::vector<std::string> algorithmDescriptions() const;
static MinimizerInfo buildMinuit2Info(const std::string &defaultAlgo = std::string());
static MinimizerInfo buildGSLMultiMinInfo(const std::string &defaultAlgo = std::string());
static MinimizerInfo buildGSLLMAInfo();
static MinimizerInfo buildGSLSimAnInfo();
static MinimizerInfo buildGeneticInfo();
static MinimizerInfo buildTestMinimizerInfo();
private:
void addAlgorithm(const AlgorithmInfo& algorithm);
void addAlgorithm(const std::string& algorithmName, const std::string& algorithmDescription);
std::vector<AlgorithmInfo> m_algorithms;
std::string m_current_algorithm;
};
#endif
......@@ -67,53 +67,53 @@ std::list<std::string> MinimizerInfo::algorithmDescriptions() const
Catalogue::Catalogue()
{
MinimizerInfo minuit(
MinimizerNames::Minuit,
ObsoleteMinimizerNames::Minuit,
"Minuit2 minimizer from ROOT library");
minuit.addAlgorithm(
AlgorithmNames::Migrad,
ObsoleteAlgorithmNames::Migrad,
"Variable-metric method with inexact line search, best minimizer according to ROOT.");
minuit.addAlgorithm(
AlgorithmNames::Simplex,
ObsoleteAlgorithmNames::Simplex,
"Simplex method of Nelder and Meadh, "
"robust against big fluctuations in objective function.");
minuit.addAlgorithm(
AlgorithmNames::Combined,
ObsoleteAlgorithmNames::Combined,
"Combination of Migrad and Simplex (if Migrad fails).");
minuit.addAlgorithm(
AlgorithmNames::Scan,
ObsoleteAlgorithmNames::Scan,
"Simple objective function scan, one parameter at a time.");
minuit.addAlgorithm(
AlgorithmNames::Fumili,
ObsoleteAlgorithmNames::Fumili,
"Gradient descent minimizer similar to Levenberg-Margquardt, "
"sometimes can be better than all others.");
addMinimizer(minuit);
MinimizerInfo gsl(
MinimizerNames::GSL,
ObsoleteMinimizerNames::GSL,
"Set of minimizers from GNU Scientific Library");
gsl.addAlgorithm(
AlgorithmNames::ConjugateFR,
ObsoleteAlgorithmNames::ConjugateFR,
"Fletcher-Reeves conjugate gradient");
gsl.addAlgorithm(
AlgorithmNames::ConjugatePR,
ObsoleteAlgorithmNames::ConjugatePR,
"Polak-Ribiere conjugate gradient");
gsl.addAlgorithm(
AlgorithmNames::BFGS,
ObsoleteAlgorithmNames::BFGS,
"BFGS conjugate gradient");
gsl.addAlgorithm(
AlgorithmNames::BFGS2,
ObsoleteAlgorithmNames::BFGS2,
"BFGS conjugate gradient (Version 2)");
gsl.addAlgorithm(
AlgorithmNames::LMA,
ObsoleteAlgorithmNames::LMA,
"Levenberg-Marquardt, often works quite well.");
// gsl.addAlgorithm(AlgorithmNames::SimAn, "Simulated Annealing");
addMinimizer(gsl);
MinimizerInfo genetic(
MinimizerNames::Genetic,
ObsoleteMinimizerNames::Genetic,
"TMVA Genetic Algorithm");
genetic.addAlgorithm(
AlgorithmNames::Genetic,
ObsoleteAlgorithmNames::Genetic,
"TMVA Genetic Algorithm");
addMinimizer(genetic);
}
......
// ************************************************************************** //
//
// BornAgain: simulate and fit scattering at grazing incidence
//
//! @file Fit/Minimizer/MinimizerUtils.cpp
//! @brief Declares namespace MinimizerUtils.
//!
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2015
//! @authors Scientific Computing Group at MLZ Garching
//! @authors C. Durniak, M. Ganeva, G. Pospelov, W. Van Herck, J. Wuttke
//
// ************************************************************************** //
#include "MinimizerUtils.h"
#include <sstream>
#include <algorithm>
#include <limits>
std::string MinimizerUtils::toString(const std::vector<std::string> &v, const std::string &delim)
{
std::stringstream s;
std::for_each(v.begin(), v.end(), [&s, &delim](const std::string &elem) {s << elem << delim; });
return s.str();
}
//! Returns translation of GSL error code to string.
std::map<int, std::string> MinimizerUtils::gslErrorDescriptionMap()
{
std::map<int, std::string> result;
result[0] = std::string("OK, valid minimum");
result[-2] = std::string("iteration has not converged");
result[1] = std::string("input domain error, e.g sqrt(-1)");
result[2] = std::string("output range error, e.g. exp(1e100)");
result[3] = std::string("invalid pointer");
result[4] = std::string("invalid argument supplied by user");
result[5] = std::string("generic failure");
result[6] = std::string("factorization failed");
result[7] = std::string("sanity check failed - shouldn't happen");
result[8] = std::string("malloc failed");
result[9] = std::string("problem with user-supplied function");
result[10] = std::string("iterative process is out of control");
result[11] = std::string("exceeded max number of iterations");
result[12] = std::string("tried to divide by zero");
result[13] = std::string("user specified an invalid tolerance");
result[14] = std::string("failed to reach the specified tolerance");
result[15] = std::string("underflow");
result[16] = std::string("overflow ");
result[17] = std::string("loss of accuracy");
result[18] = std::string("failed because of roundoff error");
result[19] = std::string("matrix, vector lengths are not conformant");
result[20] = std::string("matrix not square");
result[21] = std::string("apparent singularity detected");
result[22] = std::string("integral or series is divergent");
result[23] = std::string("requested feature is not supported by the hardware");
result[24] = std::string("requested feature not (yet) implemented");
result[25] = std::string("cache limit exceeded");
result[26] = std::string("table limit exceeded");
result[27] = std::string("iteration is not making progress towards solution");
result[28] = std::string("jacobian evaluations are not improving the solution");
result[29] = std::string("cannot reach the specified tolerance in F");
result[30] = std::string("cannot reach the specified tolerance in X");
result[31] = std::string("cannot reach the specified tolerance in gradient");
return result;
}
std::string MinimizerUtils::gslErrorDescription(int errorCode)
{
auto errorDescription = gslErrorDescriptionMap();
auto it = errorDescription.find(errorCode);
if(it!=errorDescription.end())
return it->second;
return std::string("Unknown error");
}
bool MinimizerUtils::numbersDiffer(double a, double b, double tol)
{
constexpr double eps = std::numeric_limits<double>::epsilon();
if (tol<1)
throw std::runtime_error("MinimizerUtils::numbersDiffer() -> Error. not intended for tol<1");
return std::abs(a-b) > eps * std::max( tol*eps, std::abs(b) );
}
// ************************************************************************** //
//
// BornAgain: simulate and fit scattering at grazing incidence
//
//! @file Fit/Minimizer/MinimizerUtils.h
//! @brief Declares namespace MinimizerUtils.
//!
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2015
//! @authors Scientific Computing Group at MLZ Garching
//! @authors C. Durniak, M. Ganeva, G. Pospelov, W. Van Herck, J. Wuttke
//
// ************************************************************************** //
#ifndef MINIMIZERUTILS_H
#define MINIMIZERUTILS_H
#include "WinDllMacros.h"
#include <string>
#include <vector>
#include <map>
namespace MinimizerUtils {
BA_CORE_API_ std::string toString(const std::vector<std::string> &v, const std::string &delim = "");
BA_CORE_API_ std::map<int, std::string> gslErrorDescriptionMap();
BA_CORE_API_ std::string gslErrorDescription(int errorCode);
BA_CORE_API_ bool numbersDiffer(double a, double b, double tol);
}
#endif
......@@ -25,7 +25,7 @@ const std::string O_PRINTLEVEL = "PrintLevel";
}
Minuit2Minimizer::Minuit2Minimizer()
: BasicMinimizer(MinimizerNames::Minuit, AlgorithmNames::Migrad)
: BasicMinimizer(ObsoleteMinimizerNames::Minuit, ObsoleteAlgorithmNames::Migrad)
, m_minuit2_minimizer(new BA_ROOT::Minuit2::Minuit2Minimizer("xxx"))
{
addOption(O_STRATEGY, 1,
......
......@@ -60,7 +60,7 @@ void MinimizerItemCatalogue::domainMinimizerNames(
}
else if(minimizerType == Constants::GSLMinimizerType) {
if(algorithmName.toStdString() != AlgorithmNames::LMA) {
if(algorithmName.toStdString() != ObsoleteAlgorithmNames::LMA) {
domainName = std::string("GSLMultiMin");
domainAlgo = algorithmName.toStdString();
} else {
......
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