Skip to content
Snippets Groups Projects
Unverified Commit 4c8dd284 authored by Yurov, Dmitry's avatar Yurov, Dmitry Committed by GitHub
Browse files

Merge pull request #349 from gpospelov/develop

Simple printing of avaiable minimizer options
parents b00a0b80 4500e670
No related branches found
No related tags found
No related merge requests found
Showing
with 348 additions and 60 deletions
......@@ -2,7 +2,7 @@
Working with sample parameters.
Variation of SampleParameterIntro.py with the difference that parameter change
is going via assembled simulation object.
is going via top level simulation object.
"""
from __future__ import print_function
......
......@@ -60,6 +60,7 @@ def get_simulation():
simulation.setDetectorParameters(100, -1.0*deg, 1.0*deg,
100, 0.0*deg, 2.0*deg)
simulation.setBeamParameters(1.0*angstrom, 0.2*deg, 0.0*deg)
simulation.setBeamIntensity(1e+08)
return simulation
......
......@@ -5,7 +5,8 @@ import bornagain as ba
from bornagain import deg, angstrom, nm
def get_sample():
def get_sample(cylinder_height=5.0*nm, cylinder_radius=5.0*nm,
prism_length=5.0*nm, prism_height=5.0*nm):
"""
Returns a sample with uncorrelated cylinders and prisms on a substrate.
"""
......@@ -15,9 +16,9 @@ def get_sample():
m_particle = ba.HomogeneousMaterial("Particle", 6e-4, 2e-8)
# collection of particles
cylinder_ff = ba.FormFactorCylinder(1.0*nm, 1.0*nm)
cylinder_ff = ba.FormFactorCylinder(cylinder_radius, cylinder_height)
cylinder = ba.Particle(m_particle, cylinder_ff)
prism_ff = ba.FormFactorPrism3(1.0*nm, 1.0*nm)
prism_ff = ba.FormFactorPrism3(prism_length, prism_height)
prism = ba.Particle(m_particle, prism_ff)
particle_layout = ba.ParticleLayout()
particle_layout.addParticle(cylinder, 0.5)
......@@ -43,6 +44,7 @@ def get_simulation():
simulation.setDetectorParameters(100, -1.0*deg, 1.0*deg,
100, 0.0*deg, 2.0*deg)
simulation.setBeamParameters(1.0*angstrom, 0.2*deg, 0.0*deg)
simulation.setBeamIntensity(1e+08)
return simulation
......
......@@ -69,8 +69,8 @@ def create_real_data():
real_data.setBinContent(i, noisy_amplitude)
# uncomment line to save generated data on disk
#IntensityDataIOFactory.writeIntensityData(
# real_data, 'refdata_fitcylinderprisms.int')
#ba.IntensityDataIOFactory.writeIntensityData(
# real_data, 'refdata_fitcylinderprisms.int.gz')
return real_data
......@@ -82,6 +82,7 @@ def get_simulation():
simulation.setDetectorParameters(100, -1.0*deg, 1.0*deg,
100, 0.0*deg, 2.0*deg)
simulation.setBeamParameters(1.0*angstrom, 0.2*deg, 0.0*deg)
simulation.setBeamIntensity(1e+08)
return simulation
......
"""
Fitting example: running same fit using various minimizer and their settings.
"""
import bornagain as ba
from bornagain import deg, angstrom, nm
def get_sample(cylinder_height=5.0*nm, cylinder_radius=5.0*nm,
prism_length=5.0*nm, prism_height=5.0*nm):
"""
Returns a sample with uncorrelated cylinders and prisms on a substrate.
"""
# defining materials
m_air = ba.HomogeneousMaterial("Air", 0.0, 0.0)
m_substrate = ba.HomogeneousMaterial("Substrate", 6e-6, 2e-8)
m_particle = ba.HomogeneousMaterial("Particle", 6e-4, 2e-8)
# collection of particles
cylinder_ff = ba.FormFactorCylinder(cylinder_radius, cylinder_height)
cylinder = ba.Particle(m_particle, cylinder_ff)
prism_ff = ba.FormFactorPrism3(prism_length, prism_height)
prism = ba.Particle(m_particle, prism_ff)
particle_layout = ba.ParticleLayout()
particle_layout.addParticle(cylinder, 0.5)
particle_layout.addParticle(prism, 0.5)
interference = ba.InterferenceFunctionNone()
particle_layout.setInterferenceFunction(interference)
# air layer with particles and substrate form multi layer
air_layer = ba.Layer(m_air)
air_layer.addLayout(particle_layout)
substrate_layer = ba.Layer(m_substrate, 0)
multi_layer = ba.MultiLayer()
multi_layer.addLayer(air_layer)
multi_layer.addLayer(substrate_layer)
return multi_layer
def get_simulation():
"""
Returns a GISAXS simulation with beam and detector defined
"""
simulation = ba.GISASSimulation()
simulation.setDetectorParameters(100, -1.0*deg, 1.0*deg,
100, 0.0*deg, 2.0*deg)
simulation.setBeamParameters(1.0*angstrom, 0.2*deg, 0.0*deg)
simulation.setBeamIntensity(1e+08)
return simulation
def run_fitting():
"""
run fitting
"""
# prints info about available minimizers
print(ba.MinimizerFactory().catalogueToString())
# prints detailed info about available minimizers and their options
print(ba.MinimizerFactory().catalogueDetailsToString())
sample = get_sample()
simulation = get_simulation()
simulation.setSample(sample)
real_data = ba.IntensityDataIOFactory.readIntensityData(
'refdata_fitcylinderprisms.int.gz')
fit_suite = ba.FitSuite()
fit_suite.addSimulationAndRealData(simulation, real_data)
fit_suite.initPrint(10)
# setting fitting parameters with starting values
fit_suite.addFitParameter("*Cylinder/Height", 4.*nm).setLowerLimited(0.01)
fit_suite.addFitParameter("*Cylinder/Radius", 6.*nm).setLowerLimited(0.01)
fit_suite.addFitParameter("*Prism3/Height", 4.*nm).setLowerLimited(0.01)
fit_suite.addFitParameter("*Prism3/BaseEdge", 12.*nm).setLowerLimited(0.01)
# Uncomment one of the line below to adjust minimizer settings
# setting Minuit2 minimizer with Migrad algorithm, limiting number of iterations
# Minimization will try to respect MaxFunctionCalls value
# fit_suite.setMinimizer("Minuit2", "Migrad", "MaxFunctionCalls=100")
# Setting two options at once.
# Strategy=2 promises more accurate fit.
# fit_suite.setMinimizer("Minuit2", "Simplex", "MaxFunctionCalls=100;Strategy=2")
# setting Minuit2 minimizer with Fumili algorithm
# fit_suite.setMinimizer("Minuit2", "Fumili")
# Setting Levenberg-Marquardt algorithm
# fit_suite.setMinimizer("GSLLMA")
# Setting Genetic algorithm.It requires all parameters
# to be limited, so we recreate parameters with min and max defined
# fit_suite.fitParameters().clear()
# fit_suite.addFitParameter("*Cylinder/Height", 4.*nm).setLimited(3.0, 8.0)
# fit_suite.addFitParameter("*Cylinder/Radius", 6.*nm).setLimited(3.0, 8.0)
# fit_suite.addFitParameter("*Prism3/Height", 4.*nm).setLimited(3.0, 8.0)
# fit_suite.addFitParameter("*Prism3/BaseEdge", 4.*nm).setLimited(3.0, 8.0)
# fit_suite.setMinimizer("Genetic", "Default",
# "MaxIterations=2;PopSize=200;RandomSeed=1")
# running fit with default minimizer
fit_suite.runFit()
print("Fitting completed.")
print("chi2:", fit_suite.getChi2())
for par in fit_suite.fitParameters():
print(par.name(), par.value(), par.error())
if __name__ == '__main__':
run_fitting()
No preview for this file type
......@@ -47,6 +47,7 @@ def get_simulation():
simulation.setDetectorParameters(100, -1.0*deg, 1.0*deg,
100, 0.0*deg, 2.0*deg)
simulation.setBeamParameters(1.0*angstrom, 0.2*deg, 0.0*deg)
simulation.setBeamIntensity(1e+08)
return simulation
......
......@@ -64,6 +64,7 @@ def get_simulation():
simulation.setDetectorParameters(100, -1.0*deg, 1.0*deg,
100, 0.0*deg, 2.0*deg)
simulation.setBeamParameters(1.0*angstrom, 0.2*deg, 0.0*deg)
simulation.setBeamIntensity(1e+08)
return simulation
......
......@@ -41,6 +41,7 @@ def get_simulation():
simulation.setDetectorParameters(100, -1.0*deg, 1.0*deg,
100, 0.0*deg, 2.0*deg)
simulation.setBeamParameters(1.0*angstrom, 0.2*deg, 0.0*deg)
simulation.setBeamIntensity(1e+08)
return simulation
......
......@@ -47,6 +47,7 @@ def get_simulation():
simulation.setDetectorParameters(100, 0.0*deg, 2.0*deg,
100, 0.0*deg, 2.0*deg)
simulation.setBeamParameters(1.0*angstrom, 0.2*deg, 0.0*deg)
simulation.setBeamIntensity(1e+08)
return simulation
......
......@@ -44,6 +44,7 @@ def get_simulation():
simulation.setDetectorParameters(100, -1.0*deg, 1.0*deg,
100, 0.0*deg, 2.0*deg)
simulation.setBeamParameters(1.0*angstrom, 0.2*deg, 0.0*deg)
simulation.setBeamIntensity(1e+08)
return simulation
......
......@@ -41,6 +41,7 @@ def get_simulation(incident_alpha=0.2):
simulation.setDetectorParameters(50, -1.5*deg, 1.5*deg,
50, 0.0*deg, 2.0*deg)
simulation.setBeamParameters(1.0*angstrom, incident_alpha, 0.0*deg)
simulation.setBeamIntensity(1e+08)
return simulation
......
......@@ -39,15 +39,24 @@ std::string MinimizerCatalogue::toString() const
result << boost::format("%-15s|%-65s\n") % "Minimizer" % " Algorithms";
result << std::string(text_width, '-') << "\n";
for(MinimizerInfo minimizer : m_minimizers) {
for(const auto& ingo : m_minimizers) {
result << boost::format("%-15s| %-64s\n")
% minimizer.name()
% MinimizerUtils::toString(minimizer.algorithmNames(), std::string(" "));
% ingo.name()
% MinimizerUtils::toString(ingo.algorithmNames(), std::string(" "));
}
return result.str();
}
std::vector<std::string> MinimizerCatalogue::minimizerNames() const
{
std::vector<std::string> result;
for(const auto& info : m_minimizers)
result.push_back(info.name());
return result;
}
//! Returns list of algorithms defined for the minimizer with a given name.
std::vector<std::string> MinimizerCatalogue::algorithmNames(const std::string& minimizerName) const
......@@ -65,9 +74,9 @@ std::vector<std::string> MinimizerCatalogue::algorithmDescriptions(
//! Returns info for minimizer with given name.
MinimizerInfo MinimizerCatalogue::minimizerInfo(const std::string& minimizerName) const
const MinimizerInfo& MinimizerCatalogue::minimizerInfo(const std::string& minimizerName) const
{
for(auto info : m_minimizers)
for(const auto& info : m_minimizers)
if(info.name() == minimizerName)
return info;
......
......@@ -41,12 +41,14 @@ public:
std::string toString() const;
std::vector<std::string> minimizerNames() const;
std::vector<std::string> algorithmNames(const std::string& minimizerName) const;
std::vector<std::string> algorithmDescriptions(const std::string& minimizerName) const;
const MinimizerInfo& minimizerInfo(const std::string& minimizerName) const;
private:
MinimizerInfo minimizerInfo(const std::string& minimizerName) const;
void addMinimizerInfo(const MinimizerInfo& info);
std::vector<MinimizerInfo> m_minimizers;
......
......@@ -23,6 +23,9 @@
#include "MinimizerCatalogue.h"
#include <sstream>
#include <iostream>
#include <boost/format.hpp>
#include <memory>
#include <iomanip>
IMinimizer* MinimizerFactory::createMinimizer(const std::string& minimizerName,
const std::string& algorithmType,
......@@ -76,11 +79,56 @@ void MinimizerFactory::printCatalogue()
std::cout << catalogueToString() << std::endl;
}
//! Returns multi-line string representing catalogue content: minimizer names and list of their
//! algorithms.
std::string MinimizerFactory::catalogueToString()
{
return catalogue().toString();
}
//! Returns multi-line string representing detailed catalogue content:
//! minimizer names, list of their algorithms and description, list of minimizer options.
std::string MinimizerFactory::catalogueDetailsToString()
{
const int text_width = 80;
std::ostringstream result;
const std::string fmt("%-20s| %-65s\n");
for (const auto& minimizerName : catalogue().minimizerNames()) {
// general info
const MinimizerInfo& info = catalogue().minimizerInfo(minimizerName);
result << std::string(text_width, '-') << "\n";
result << boost::format(fmt) % info.name() % info.description();
result << std::string(text_width, '-') << "\n";
// algorithm names and description
result << "\nAlgorithm names\n";
auto algorithmNames = info.algorithmNames();
auto algorithmDescription = info.algorithmDescriptions();
for (size_t i=0; i<algorithmNames.size(); ++i)
result << boost::format(fmt) % algorithmNames[i] % algorithmDescription[i];
if (algorithmNames.size()>1)
result << boost::format(fmt) % "Default algorithm" % info.algorithmName();
// list of minimizer options
std::unique_ptr<IMinimizer> minimizer(createMinimizer(minimizerName));
if (auto rootMinimizer = dynamic_cast<RootMinimizerAdapter*>(minimizer.get())) {
result << "\nOptions\n";
for(auto option : rootMinimizer->options()) {
std::ostringstream opt;
opt << std::setw(5) << std::left << option->value() << option->description();
result << boost::format(fmt) % option->name() % opt.str();
}
}
result << "\n";
}
return result.str();
}
const MinimizerCatalogue& MinimizerFactory::catalogue()
{
static MinimizerCatalogue s_catalogue = MinimizerCatalogue();
......
......@@ -36,6 +36,8 @@ class BA_CORE_API_ MinimizerFactory
static std::string catalogueToString();
static std::string catalogueDetailsToString();
static const MinimizerCatalogue& catalogue();
};
......
......@@ -26,7 +26,7 @@ MinimizerInfo::MinimizerInfo(const std::string& minimizerType,
void MinimizerInfo::setAlgorithmName(const std::string& algorithmName)
{
for (const AlgorithmInfo algo : m_algorithms) {
for (const AlgorithmInfo& algo : m_algorithms) {
if(algo.name() == algorithmName) {
m_current_algorithm = algorithmName;
return;
......@@ -36,7 +36,7 @@ void MinimizerInfo::setAlgorithmName(const std::string& algorithmName)
std::ostringstream msg;
msg << "MinimizerInfo::setAlgorithmName() -> Error. Algorithm name '" << algorithmName
<<"' is not in the list of defined algorithms (";
for (const AlgorithmInfo algo : m_algorithms)
for (const AlgorithmInfo& algo : m_algorithms)
msg << algo.name() << " ";
msg << ")";
throw std::runtime_error(msg.str());
......@@ -52,7 +52,7 @@ std::string MinimizerInfo::algorithmName() const
std::vector<std::string> MinimizerInfo::algorithmNames() const
{
std::vector<std::string> result;
for (const AlgorithmInfo algo : m_algorithms)
for (const AlgorithmInfo& algo : m_algorithms)
result.push_back(algo.name());
return result;
}
......@@ -62,7 +62,7 @@ std::vector<std::string> MinimizerInfo::algorithmNames() const
std::vector<std::string> MinimizerInfo::algorithmDescriptions() const
{
std::vector<std::string> result;
for (const AlgorithmInfo algo : m_algorithms)
for (const AlgorithmInfo& algo : m_algorithms)
result.push_back(algo.description());
return result;
}
......
......@@ -5994,7 +5994,7 @@ SWIG_AsVal_std_complex_Sl_double_Sg_ (PyObject *o, std::complex<double>* val)
 
 
SWIGINTERNINLINE PyObject*
SWIG_From_std_complex_Sl_double_Sg_ (/*@SWIG:/usr/share/swig3.0/typemaps/swigmacros.swg,104,%ifcplusplus@*/
SWIG_From_std_complex_Sl_double_Sg_ (/*@SWIG:/home/pospelov/software/local/share/swig/3.0.8/typemaps/swigmacros.swg,104,%ifcplusplus@*/
 
const std::complex<double>&
 
......@@ -2665,6 +2665,11 @@ class MinimizerCatalogue(_object):
return _libBornAgainFit.MinimizerCatalogue_toString(self)
def minimizerNames(self):
"""minimizerNames(MinimizerCatalogue self) -> vector_string_t"""
return _libBornAgainFit.MinimizerCatalogue_minimizerNames(self)
def algorithmNames(self, minimizerName):
"""
algorithmNames(MinimizerCatalogue self, std::string const & minimizerName) -> vector_string_t
......@@ -2688,6 +2693,11 @@ class MinimizerCatalogue(_object):
"""
return _libBornAgainFit.MinimizerCatalogue_algorithmDescriptions(self, minimizerName)
def minimizerInfo(self, minimizerName):
"""minimizerInfo(MinimizerCatalogue self, std::string const & minimizerName) -> MinimizerInfo const &"""
return _libBornAgainFit.MinimizerCatalogue_minimizerInfo(self, minimizerName)
__swig_destroy__ = _libBornAgainFit.delete_MinimizerCatalogue
__del__ = lambda self: None
MinimizerCatalogue_swigregister = _libBornAgainFit.MinimizerCatalogue_swigregister
......@@ -2737,6 +2747,14 @@ class MinimizerFactory(_object):
catalogueToString = staticmethod(catalogueToString)
__swig_getmethods__["catalogueToString"] = lambda x: catalogueToString
def catalogueDetailsToString():
"""catalogueDetailsToString() -> std::string"""
return _libBornAgainFit.MinimizerFactory_catalogueDetailsToString()
if _newclass:
catalogueDetailsToString = staticmethod(catalogueDetailsToString)
__swig_getmethods__["catalogueDetailsToString"] = lambda x: catalogueDetailsToString
def catalogue():
"""catalogue() -> MinimizerCatalogue"""
return _libBornAgainFit.MinimizerFactory_catalogue()
......@@ -2782,6 +2800,10 @@ def MinimizerFactory_catalogueToString():
"""MinimizerFactory_catalogueToString() -> std::string"""
return _libBornAgainFit.MinimizerFactory_catalogueToString()
def MinimizerFactory_catalogueDetailsToString():
"""MinimizerFactory_catalogueDetailsToString() -> std::string"""
return _libBornAgainFit.MinimizerFactory_catalogueDetailsToString()
def MinimizerFactory_catalogue():
"""MinimizerFactory_catalogue() -> MinimizerCatalogue"""
return _libBornAgainFit.MinimizerFactory_catalogue()
......
......@@ -3460,48 +3460,49 @@ namespace Swig {
#define SWIGTYPE_p_IMinimizer swig_types[3]
#define SWIGTYPE_p_MinimizerCatalogue swig_types[4]
#define SWIGTYPE_p_MinimizerFactory swig_types[5]
#define SWIGTYPE_p_RealLimits swig_types[6]
#define SWIGTYPE_p_allocator_type swig_types[7]
#define SWIGTYPE_p_char swig_types[8]
#define SWIGTYPE_p_const_iterator swig_types[9]
#define SWIGTYPE_p_container_t swig_types[10]
#define SWIGTYPE_p_corr_matrix_t swig_types[11]
#define SWIGTYPE_p_difference_type swig_types[12]
#define SWIGTYPE_p_gradient_function_t swig_types[13]
#define SWIGTYPE_p_int swig_types[14]
#define SWIGTYPE_p_iterator swig_types[15]
#define SWIGTYPE_p_long_long swig_types[16]
#define SWIGTYPE_p_objective_function_t swig_types[17]
#define SWIGTYPE_p_p_PyObject swig_types[18]
#define SWIGTYPE_p_short swig_types[19]
#define SWIGTYPE_p_signed_char swig_types[20]
#define SWIGTYPE_p_size_type swig_types[21]
#define SWIGTYPE_p_std__allocatorT_double_t swig_types[22]
#define SWIGTYPE_p_std__allocatorT_int_t swig_types[23]
#define SWIGTYPE_p_std__allocatorT_std__complexT_double_t_t swig_types[24]
#define SWIGTYPE_p_std__allocatorT_std__string_t swig_types[25]
#define SWIGTYPE_p_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t swig_types[26]
#define SWIGTYPE_p_std__allocatorT_unsigned_long_t swig_types[27]
#define SWIGTYPE_p_std__invalid_argument swig_types[28]
#define SWIGTYPE_p_std__shared_ptrT_IFitObserver_t swig_types[29]
#define SWIGTYPE_p_std__shared_ptrT_IMultiLayerBuilder_t swig_types[30]
#define SWIGTYPE_p_std__shared_ptrT_IObserver_t swig_types[31]
#define SWIGTYPE_p_std__vectorT_IFitParameter_p_std__allocatorT_IFitParameter_p_t_t__const_iterator swig_types[32]
#define SWIGTYPE_p_std__vectorT_IFitParameter_p_std__allocatorT_IFitParameter_p_t_t__iterator swig_types[33]
#define SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t swig_types[34]
#define SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t swig_types[35]
#define SWIGTYPE_p_std__vectorT_std__complexT_double_t_std__allocatorT_std__complexT_double_t_t_t swig_types[36]
#define SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t swig_types[37]
#define SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t swig_types[38]
#define SWIGTYPE_p_std__vectorT_unsigned_long_std__allocatorT_unsigned_long_t_t swig_types[39]
#define SWIGTYPE_p_swig__SwigPyIterator swig_types[40]
#define SWIGTYPE_p_unsigned_char swig_types[41]
#define SWIGTYPE_p_unsigned_int swig_types[42]
#define SWIGTYPE_p_unsigned_long_long swig_types[43]
#define SWIGTYPE_p_unsigned_short swig_types[44]
#define SWIGTYPE_p_value_type swig_types[45]
static swig_type_info *swig_types[47];
static swig_module_info swig_module = {swig_types, 46, 0, 0, 0, 0};
#define SWIGTYPE_p_MinimizerInfo swig_types[6]
#define SWIGTYPE_p_RealLimits swig_types[7]
#define SWIGTYPE_p_allocator_type swig_types[8]
#define SWIGTYPE_p_char swig_types[9]
#define SWIGTYPE_p_const_iterator swig_types[10]
#define SWIGTYPE_p_container_t swig_types[11]
#define SWIGTYPE_p_corr_matrix_t swig_types[12]
#define SWIGTYPE_p_difference_type swig_types[13]
#define SWIGTYPE_p_gradient_function_t swig_types[14]
#define SWIGTYPE_p_int swig_types[15]
#define SWIGTYPE_p_iterator swig_types[16]
#define SWIGTYPE_p_long_long swig_types[17]
#define SWIGTYPE_p_objective_function_t swig_types[18]
#define SWIGTYPE_p_p_PyObject swig_types[19]
#define SWIGTYPE_p_short swig_types[20]
#define SWIGTYPE_p_signed_char swig_types[21]
#define SWIGTYPE_p_size_type swig_types[22]
#define SWIGTYPE_p_std__allocatorT_double_t swig_types[23]
#define SWIGTYPE_p_std__allocatorT_int_t swig_types[24]
#define SWIGTYPE_p_std__allocatorT_std__complexT_double_t_t swig_types[25]
#define SWIGTYPE_p_std__allocatorT_std__string_t swig_types[26]
#define SWIGTYPE_p_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t swig_types[27]
#define SWIGTYPE_p_std__allocatorT_unsigned_long_t swig_types[28]
#define SWIGTYPE_p_std__invalid_argument swig_types[29]
#define SWIGTYPE_p_std__shared_ptrT_IFitObserver_t swig_types[30]
#define SWIGTYPE_p_std__shared_ptrT_IMultiLayerBuilder_t swig_types[31]
#define SWIGTYPE_p_std__shared_ptrT_IObserver_t swig_types[32]
#define SWIGTYPE_p_std__vectorT_IFitParameter_p_std__allocatorT_IFitParameter_p_t_t__const_iterator swig_types[33]
#define SWIGTYPE_p_std__vectorT_IFitParameter_p_std__allocatorT_IFitParameter_p_t_t__iterator swig_types[34]
#define SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t swig_types[35]
#define SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t swig_types[36]
#define SWIGTYPE_p_std__vectorT_std__complexT_double_t_std__allocatorT_std__complexT_double_t_t_t swig_types[37]
#define SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t swig_types[38]
#define SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t swig_types[39]
#define SWIGTYPE_p_std__vectorT_unsigned_long_std__allocatorT_unsigned_long_t_t swig_types[40]
#define SWIGTYPE_p_swig__SwigPyIterator swig_types[41]
#define SWIGTYPE_p_unsigned_char swig_types[42]
#define SWIGTYPE_p_unsigned_int swig_types[43]
#define SWIGTYPE_p_unsigned_long_long swig_types[44]
#define SWIGTYPE_p_unsigned_short swig_types[45]
#define SWIGTYPE_p_value_type swig_types[46]
static swig_type_info *swig_types[48];
static swig_module_info swig_module = {swig_types, 47, 0, 0, 0, 0};
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
 
......@@ -5627,7 +5628,7 @@ SWIG_AsVal_std_complex_Sl_double_Sg_ (PyObject *o, std::complex<double>* val)
 
 
SWIGINTERNINLINE PyObject*
SWIG_From_std_complex_Sl_double_Sg_ (/*@SWIG:/usr/share/swig3.0/typemaps/swigmacros.swg,104,%ifcplusplus@*/
SWIG_From_std_complex_Sl_double_Sg_ (/*@SWIG:/home/pospelov/software/local/share/swig/3.0.8/typemaps/swigmacros.swg,104,%ifcplusplus@*/
 
const std::complex<double>&
 
......@@ -21911,6 +21912,28 @@ fail:
}
 
 
SWIGINTERN PyObject *_wrap_MinimizerCatalogue_minimizerNames(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
MinimizerCatalogue *arg1 = (MinimizerCatalogue *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
std::vector< std::string,std::allocator< std::string > > result;
if (!PyArg_ParseTuple(args,(char *)"O:MinimizerCatalogue_minimizerNames",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MinimizerCatalogue, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MinimizerCatalogue_minimizerNames" "', argument " "1"" of type '" "MinimizerCatalogue const *""'");
}
arg1 = reinterpret_cast< MinimizerCatalogue * >(argp1);
result = ((MinimizerCatalogue const *)arg1)->minimizerNames();
resultobj = swig::from(static_cast< std::vector< std::string,std::allocator< std::string > > >(result));
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_MinimizerCatalogue_algorithmNames(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
MinimizerCatalogue *arg1 = (MinimizerCatalogue *) 0 ;
......@@ -21987,6 +22010,44 @@ fail:
}
 
 
SWIGINTERN PyObject *_wrap_MinimizerCatalogue_minimizerInfo(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
MinimizerCatalogue *arg1 = (MinimizerCatalogue *) 0 ;
std::string *arg2 = 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int res2 = SWIG_OLDOBJ ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
MinimizerInfo *result = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OO:MinimizerCatalogue_minimizerInfo",&obj0,&obj1)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_MinimizerCatalogue, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MinimizerCatalogue_minimizerInfo" "', argument " "1"" of type '" "MinimizerCatalogue const *""'");
}
arg1 = reinterpret_cast< MinimizerCatalogue * >(argp1);
{
std::string *ptr = (std::string *)0;
res2 = SWIG_AsPtr_std_string(obj1, &ptr);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MinimizerCatalogue_minimizerInfo" "', argument " "2"" of type '" "std::string const &""'");
}
if (!ptr) {
SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "MinimizerCatalogue_minimizerInfo" "', argument " "2"" of type '" "std::string const &""'");
}
arg2 = ptr;
}
result = (MinimizerInfo *) &((MinimizerCatalogue const *)arg1)->minimizerInfo((std::string const &)*arg2);
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_MinimizerInfo, 0 | 0 );
if (SWIG_IsNewObj(res2)) delete arg2;
return resultobj;
fail:
if (SWIG_IsNewObj(res2)) delete arg2;
return NULL;
}
SWIGINTERN PyObject *_wrap_delete_MinimizerCatalogue(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
MinimizerCatalogue *arg1 = (MinimizerCatalogue *) 0 ;
......@@ -22234,6 +22295,19 @@ fail:
}
 
 
SWIGINTERN PyObject *_wrap_MinimizerFactory_catalogueDetailsToString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
std::string result;
if (!PyArg_ParseTuple(args,(char *)":MinimizerFactory_catalogueDetailsToString")) SWIG_fail;
result = MinimizerFactory::catalogueDetailsToString();
resultobj = SWIG_From_std_string(static_cast< std::string >(result));
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_MinimizerFactory_catalogue(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
MinimizerCatalogue *result = 0 ;
......@@ -23304,6 +23378,7 @@ static PyMethodDef SwigMethods[] = {
"Returns multiline string representing catalogue content. \n"
"\n"
""},
{ (char *)"MinimizerCatalogue_minimizerNames", _wrap_MinimizerCatalogue_minimizerNames, METH_VARARGS, (char *)"MinimizerCatalogue_minimizerNames(MinimizerCatalogue self) -> vector_string_t"},
{ (char *)"MinimizerCatalogue_algorithmNames", _wrap_MinimizerCatalogue_algorithmNames, METH_VARARGS, (char *)"\n"
"MinimizerCatalogue_algorithmNames(MinimizerCatalogue self, std::string const & minimizerName) -> vector_string_t\n"
"\n"
......@@ -23320,6 +23395,7 @@ static PyMethodDef SwigMethods[] = {
"Returns list of algorithm's descriptions for the minimizer with a given name . \n"
"\n"
""},
{ (char *)"MinimizerCatalogue_minimizerInfo", _wrap_MinimizerCatalogue_minimizerInfo, METH_VARARGS, (char *)"MinimizerCatalogue_minimizerInfo(MinimizerCatalogue self, std::string const & minimizerName) -> MinimizerInfo const &"},
{ (char *)"delete_MinimizerCatalogue", _wrap_delete_MinimizerCatalogue, METH_VARARGS, (char *)"delete_MinimizerCatalogue(MinimizerCatalogue self)"},
{ (char *)"MinimizerCatalogue_swigregister", MinimizerCatalogue_swigregister, METH_VARARGS, NULL},
{ (char *)"MinimizerFactory_createMinimizer", _wrap_MinimizerFactory_createMinimizer, METH_VARARGS, (char *)"\n"
......@@ -23329,6 +23405,7 @@ static PyMethodDef SwigMethods[] = {
""},
{ (char *)"MinimizerFactory_printCatalogue", _wrap_MinimizerFactory_printCatalogue, METH_VARARGS, (char *)"MinimizerFactory_printCatalogue()"},
{ (char *)"MinimizerFactory_catalogueToString", _wrap_MinimizerFactory_catalogueToString, METH_VARARGS, (char *)"MinimizerFactory_catalogueToString() -> std::string"},
{ (char *)"MinimizerFactory_catalogueDetailsToString", _wrap_MinimizerFactory_catalogueDetailsToString, METH_VARARGS, (char *)"MinimizerFactory_catalogueDetailsToString() -> std::string"},
{ (char *)"MinimizerFactory_catalogue", _wrap_MinimizerFactory_catalogue, METH_VARARGS, (char *)"MinimizerFactory_catalogue() -> MinimizerCatalogue"},
{ (char *)"new_MinimizerFactory", _wrap_new_MinimizerFactory, METH_VARARGS, (char *)"\n"
"new_MinimizerFactory() -> MinimizerFactory\n"
......@@ -23354,6 +23431,7 @@ static swig_type_info _swigt__p_IFitParameter = {"_p_IFitParameter", "IFitParame
static swig_type_info _swigt__p_IMinimizer = {"_p_IMinimizer", "IMinimizer *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_MinimizerCatalogue = {"_p_MinimizerCatalogue", "MinimizerCatalogue *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_MinimizerFactory = {"_p_MinimizerFactory", "MinimizerFactory *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_MinimizerInfo = {"_p_MinimizerInfo", "MinimizerInfo *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_RealLimits = {"_p_RealLimits", "RealLimits *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_allocator_type = {"_p_allocator_type", "allocator_type *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
......@@ -23402,6 +23480,7 @@ static swig_type_info *swig_type_initial[] = {
&_swigt__p_IMinimizer,
&_swigt__p_MinimizerCatalogue,
&_swigt__p_MinimizerFactory,
&_swigt__p_MinimizerInfo,
&_swigt__p_RealLimits,
&_swigt__p_allocator_type,
&_swigt__p_char,
......@@ -23450,6 +23529,7 @@ static swig_cast_info _swigc__p_IFitParameter[] = { {&_swigt__p_IFitParameter,
static swig_cast_info _swigc__p_IMinimizer[] = { {&_swigt__p_IMinimizer, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_MinimizerCatalogue[] = { {&_swigt__p_MinimizerCatalogue, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_MinimizerFactory[] = { {&_swigt__p_MinimizerFactory, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_MinimizerInfo[] = { {&_swigt__p_MinimizerInfo, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_RealLimits[] = { {&_swigt__p_RealLimits, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_allocator_type[] = { {&_swigt__p_allocator_type, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
......@@ -23498,6 +23578,7 @@ static swig_cast_info *swig_cast_initial[] = {
_swigc__p_IMinimizer,
_swigc__p_MinimizerCatalogue,
_swigc__p_MinimizerFactory,
_swigc__p_MinimizerInfo,
_swigc__p_RealLimits,
_swigc__p_allocator_type,
_swigc__p_char,
......
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