Commit 18aca57d authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

[corr1] various simplifications in view of pybind11 ()

Merging branch 'corr1'  into 'main'.

See merge request !954
parents 55d29765 742bf0dc
Pipeline #67047 failed with stage
in 9 minutes and 46 seconds
......@@ -22,6 +22,7 @@
#include "Device/Data/DataUtils.h"
#include "Device/Data/Datafield.h"
#include "Device/Detector/IDetector.h"
#include "Device/Detector/SimulationAreaIterator.h"
#include "Sim/Scan/ISpecularScan.h"
#include "Sim/Simulation/ISimulation2D.h"
#include <utility>
......
......@@ -135,11 +135,11 @@ void DepthProbeSimulation::setBeamParameters(double lambda, const IAxis& alpha_a
void DepthProbeSimulation::initElementVector()
{
m_eles = generateElements(beam());
m_depth_eles = generateElements(beam());
if (!m_cache.empty())
return;
m_cache.resize(m_eles.size(), std::valarray<double>(0.0, zAxis()->size()));
m_cache.resize(m_depth_eles.size(), std::valarray<double>(0.0, zAxis()->size()));
}
std::vector<DepthProbeElement> DepthProbeSimulation::generateElements(const Beam& beam)
......@@ -163,8 +163,8 @@ std::vector<DepthProbeElement> DepthProbeSimulation::generateElements(const Beam
std::unique_ptr<IComputation>
DepthProbeSimulation::createComputation(const reSample& re_sample, size_t start, size_t n_elements)
{
ASSERT(start < m_eles.size() && start + n_elements <= m_eles.size());
const auto& begin = m_eles.begin() + static_cast<long>(start);
ASSERT(start < m_depth_eles.size() && start + n_elements <= m_depth_eles.size());
const auto& begin = m_depth_eles.begin() + static_cast<long>(start);
return std::make_unique<DepthProbeComputation>(re_sample, options(), progress(), begin,
begin + static_cast<long>(n_elements));
}
......@@ -176,7 +176,7 @@ void DepthProbeSimulation::validityCheck() const
throw std::runtime_error(
"Error in DepthProbeSimulation::validityCheck: no sample found in the simulation.");
const size_t data_size = m_eles.size();
const size_t data_size = m_depth_eles.size();
if (data_size != alphaAxis()->size())
throw std::runtime_error(
"Error in DepthProbeSimulation::validityCheck: length of simulation "
......@@ -185,7 +185,7 @@ void DepthProbeSimulation::validityCheck() const
void DepthProbeSimulation::checkCache() const
{
if (m_eles.size() != m_cache.size())
if (m_depth_eles.size() != m_cache.size())
throw std::runtime_error("Error in DepthProbeSimulation: the sizes of simulation element "
"vector and of its cache are different");
}
......@@ -206,7 +206,7 @@ void DepthProbeSimulation::normalize(size_t start_ind, size_t n_elements)
{
const double beam_intensity = beam().intensity();
for (size_t i = start_ind, stop_point = start_ind + n_elements; i < stop_point; ++i) {
auto& element = m_eles[i];
auto& element = m_depth_eles[i];
const double alpha_i = -element.alphaI();
const auto* footprint = beam().footprintFactor();
double intensity_factor = beam_intensity;
......@@ -226,15 +226,15 @@ void DepthProbeSimulation::addBackgroundIntensity(size_t, size_t)
void DepthProbeSimulation::addDataToCache(double weight)
{
checkCache();
for (size_t i = 0, size = m_eles.size(); i < size; ++i)
m_cache[i] += m_eles[i].getIntensities() * weight;
for (size_t i = 0, size = m_depth_eles.size(); i < size; ++i)
m_cache[i] += m_depth_eles[i].getIntensities() * weight;
}
void DepthProbeSimulation::moveDataFromCache()
{
checkCache();
for (size_t i = 0, size = m_eles.size(); i < size; ++i)
m_eles[i].setIntensities(std::move(m_cache[i]));
for (size_t i = 0, size = m_depth_eles.size(); i < size; ++i)
m_depth_eles[i].setIntensities(std::move(m_cache[i]));
m_cache.clear();
m_cache.shrink_to_fit();
}
......@@ -250,8 +250,8 @@ std::unique_ptr<Datafield> DepthProbeSimulation::createIntensityData() const
std::vector<double> out(frame->size());
size_t iout = 0;
for (size_t i = 0, size = m_eles.size(); i < size; ++i)
for (const double v: m_eles[i].getIntensities())
for (size_t i = 0, size = m_depth_eles.size(); i < size; ++i)
for (const double v: m_depth_eles[i].getIntensities())
out[iout++] = v;
return std::unique_ptr<Datafield>(new Datafield(frame, out));
......
......@@ -114,7 +114,7 @@ private:
std::unique_ptr<IAxis> m_alpha_axis;
std::unique_ptr<IAxis> m_z_axis;
std::vector<DepthProbeElement> m_eles;
std::vector<DepthProbeElement> m_depth_eles; // TODO remerge with ISimulation2D::m_eles
std::vector<std::valarray<double>> m_cache;
#endif
};
......
......@@ -16,6 +16,7 @@
#define BORNAGAIN_SIM_SIMULATION_ISIMULATION_H
#include "Param/Distrib/DistributionHandler.h"
#include "Param/Distrib/ParameterDistribution.h"
#include "Param/Node/INode.h"
#include <heinz/Vectors3D.h>
......
......@@ -98,11 +98,11 @@ std::vector<std::unique_ptr<DiffuseElement>> ISimulation2D::generateElements(con
std::vector<std::unique_ptr<DiffuseElement>> result;
result.reserve(N);
for (size_t element_index = 0; element_index < N; ++element_index)
for (size_t i = 0; i < N; ++i)
result.emplace_back(std::make_unique<DiffuseElement>(
wavelength, alpha_i, phi_i, m_detector_context->createPixel(element_index),
wavelength, alpha_i, phi_i, m_detector_context->createPixel(i),
beam_polMatrices, analyzer_operator,
m_detector_context->detectorIndex(element_index) == spec_index));
m_detector_context->detectorIndex(i) == spec_index));
return result;
}
......@@ -179,3 +179,18 @@ void ISimulation2D::initDistributionHandler()
}
}
}
std::vector<std::unique_ptr<DiffuseElement>>& ISimulation2D::elements()
{
return m_eles;
}
const std::vector<std::unique_ptr<DiffuseElement>>& ISimulation2D::elements() const
{
return m_eles;
}
void ISimulation2D::element_emplace_back(std::unique_ptr<DiffuseElement>&& ele)
{
m_eles.emplace_back(std::move(ele));
}
......@@ -97,10 +97,14 @@ protected:
std::unique_ptr<Beam> m_beam;
std::unique_ptr<IDetector> m_detector;
std::vector<std::unique_ptr<DiffuseElement>> m_eles;
std::vector<double> m_cache;
std::vector<std::unique_ptr<DiffuseElement>>& elements();
const std::vector<std::unique_ptr<DiffuseElement>>& elements() const;
void element_emplace_back(std::unique_ptr<DiffuseElement>&&);
private:
std::vector<std::unique_ptr<DiffuseElement>> m_eles;
std::unique_ptr<DetectorContext> m_detector_context;
#endif // SWIG
};
......
......@@ -54,7 +54,7 @@ SimulationResult OffspecSimulation::pack_result()
checkInitialization();
const IAxis& phi_axis = detector().axis(0);
size_t phi_f_size = phi_axis.size();
ASSERT(phi_f_size * m_intensity_map->size() == m_eles.size());
ASSERT(phi_f_size * m_intensity_map->size() == elements().size());
for (size_t i = 0; i < m_alpha_i_axis->size(); ++i)
transferDetectorImage(i);
......@@ -96,16 +96,16 @@ size_t OffspecSimulation::intensityMapSize() const
void OffspecSimulation::initElementVector()
{
m_eles.clear();
elements().clear();
Beam beam2 = beam();
for (size_t i = 0; i < m_alpha_i_axis->size(); ++i) {
beam2.setInclination(m_alpha_i_axis->bin(i).center());
std::vector<std::unique_ptr<DiffuseElement>> eles_i = generateElements(beam2);
for (auto&& ele : eles_i)
m_eles.emplace_back(std::move(ele));
element_emplace_back(std::move(ele));
}
if (m_cache.empty())
m_cache.resize(m_eles.size(), 0.0);
m_cache.resize(elements().size(), 0.0);
}
void OffspecSimulation::validateParametrization(const ParameterDistribution& par_distr) const
......@@ -145,7 +145,7 @@ void OffspecSimulation::transferDetectorImage(size_t index)
size_t N = detector_image->size();
for (size_t i = 0; i < N; ++i)
(*detector_image)[i] = m_eles[index * N + i]->intensity();
(*detector_image)[i] = elements()[index * N + i]->intensity();
detector().applyDetectorResolution(detector_image.get());
size_t y_axis_size = detector().axis(1).size();
for (size_t i = 0; i < N; ++i)
......
......@@ -38,7 +38,7 @@ void ScatteringSimulation::prepareSimulation()
SimulationResult ScatteringSimulation::pack_result()
{
auto* const coordsys = createCoordSystem();
const std::unique_ptr<Datafield> data(detector().createDetectorIntensity(m_eles));
const std::unique_ptr<Datafield> data(detector().createDetectorIntensity(elements()));
return {*data, *coordsys};
}
......@@ -61,7 +61,10 @@ ICoordSystem* ScatteringSimulation::createCoordSystem() const
void ScatteringSimulation::initElementVector()
{
m_eles = generateElements(beam());
elements().clear();
for (auto& ele: generateElements(beam()))
element_emplace_back(std::move(ele));
if (m_cache.empty())
m_cache.resize(m_eles.size(), 0.0);
m_cache.resize(elements().size(), 0.0);
}
......@@ -15,6 +15,7 @@
#include "Base/Axis/IAxis.h"
#include "Base/Const/Units.h"
#include "Device/Beam/Beam.h"
#include "Device/Data/Datafield.h"
#include "Device/Detector/RectangularDetector.h"
#include "Device/Mask/Rectangle.h"
#include "Fit/Kernel/Minimizer.h"
......
......@@ -15,6 +15,7 @@
#include "Tests/Functional/Fitting/SimfitTestPlan.h"
#include "Fit/Kernel/Minimizer.h"
#include "Device/Data/Datafield.h"
#include "Sample/Multilayer/MultiLayer.h"
#include "Sim/Fitting/FitObjective.h"
#include "Sim/Fitting/SimDataPair.h"
......
#include "Device/Data/ArrayUtils.h"
#include "Device/Data/Datafield.h"
#include "Base/Axis/FixedBinAxis.h"
#include "Tests/GTestWrapper/google_test.h"
#include <vector>
......
#include "Base/Axis/FixedBinAxis.h"
#include "Device/Data/Datafield.h"
#include "Device/IO/ReadWriteINT.h"
#include "Device/IO/ReadWriteNumpyTXT.h"
#include "Device/IO/ReadWriteTiff.h"
......
#include "Device/Detector/SimulationAreaIterator.h"
#include "Device/Detector/SphericalDetector.h"
#include "Device/Mask/Rectangle.h"
#include "Tests/GTestWrapper/google_test.h"
......
......@@ -2,6 +2,7 @@
#include "Base/Axis/FixedBinAxis.h"
#include "Base/Const/Units.h"
#include "Device/Beam/Beam.h"
#include "Device/Detector/SimulationAreaIterator.h"
#include "Device/Mask/DetectorMask.h"
#include "Device/Mask/Polygon.h"
#include "Device/Mask/Rectangle.h"
......
#include "Param/Distrib/DistributionHandler.h"
#include "Param/Distrib/Distributions.h"
#include "Param/Distrib/ParameterDistribution.h"
#include "Tests/GTestWrapper/google_test.h"
#include <cmath>
......
......@@ -406,12 +406,12 @@ Returns data as Python numpy array.
%feature("docstring") Datafield::normalizedToMaximum "Datafield * Datafield::normalizedToMaximum() const
";
%feature("docstring") Datafield::xProjection "Datafield * Datafield::xProjection()
%feature("docstring") Datafield::xProjection "Datafield * Datafield::xProjection() const
Project a 2D histogram into 1D histogram along X. The projection is made from all bins along y-axis.
";
%feature("docstring") Datafield::xProjection "Datafield * Datafield::xProjection(double yvalue)
%feature("docstring") Datafield::xProjection "Datafield * Datafield::xProjection(double yvalue) const
Project a 2D histogram into 1D histogram along X. The projection is made from the y-bin closest to given ordinate yvalue.
......@@ -422,7 +422,7 @@ yvalue:
the value on y-axis at which projection is taken
";
%feature("docstring") Datafield::xProjection "Datafield * Datafield::xProjection(double ylow, double yup)
%feature("docstring") Datafield::xProjection "Datafield * Datafield::xProjection(double ylow, double yup) const
Project a 2D histogram into 1D histogram along X. The projection is made from all y-bins corresponding to ordinate between ylow and yup.
......@@ -436,12 +436,12 @@ yup:
upper edje on y-axis
";
%feature("docstring") Datafield::yProjection "Datafield * Datafield::yProjection()
%feature("docstring") Datafield::yProjection "Datafield * Datafield::yProjection() const
Project a 2D histogram into 1D histogram along Y. The projection is made from all bins along x-axis.
";
%feature("docstring") Datafield::yProjection "Datafield * Datafield::yProjection(double xvalue)
%feature("docstring") Datafield::yProjection "Datafield * Datafield::yProjection(double xvalue) const
Project a 2D histogram into 1D histogram along Y. The projection is made from the x-bin closest to given abscissa xvalue.
......@@ -452,7 +452,7 @@ xvalue:
the value on x-axis at which projection is taken
";
%feature("docstring") Datafield::yProjection "Datafield * Datafield::yProjection(double xlow, double xup)
%feature("docstring") Datafield::yProjection "Datafield * Datafield::yProjection(double xlow, double xup) const
Project a 2D histogram into 1D histogram along Y. The projection is made from all x-bins corresponding to abscissa between xlow and xup.
......
......@@ -44,7 +44,7 @@ Returns the distribution-specific mean.
%feature("docstring") DistributionCosine::sigma "double DistributionCosine::sigma() const
";
%feature("docstring") DistributionCosine::equidistantPoints "std::vector< double > DistributionCosine::equidistantPoints(size_t nbr_samples, double sigma_factor, const RealLimits &limits=RealLimits()) const override
%feature("docstring") DistributionCosine::equidistantPoints "std::vector< double > DistributionCosine::equidistantPoints(size_t nbr_samples, double sigma_factor, const RealLimits &limits={}) const override
generate list of sample values
";
......@@ -106,7 +106,7 @@ Returns the distribution-specific mean.
%feature("docstring") DistributionGate::max "double DistributionGate::max() const
";
%feature("docstring") DistributionGate::equidistantPoints "std::vector< double > DistributionGate::equidistantPoints(size_t nbr_samples, double sigma_factor, const RealLimits &limits=RealLimits()) const override
%feature("docstring") DistributionGate::equidistantPoints "std::vector< double > DistributionGate::equidistantPoints(size_t nbr_samples, double sigma_factor, const RealLimits &limits={}) const override
Returns list of sample values.
";
......@@ -165,7 +165,7 @@ Returns the distribution-specific mean.
%feature("docstring") DistributionGaussian::getStdDev "double DistributionGaussian::getStdDev() const
";
%feature("docstring") DistributionGaussian::equidistantPoints "std::vector< double > DistributionGaussian::equidistantPoints(size_t nbr_samples, double sigma_factor, const RealLimits &limits=RealLimits()) const override
%feature("docstring") DistributionGaussian::equidistantPoints "std::vector< double > DistributionGaussian::equidistantPoints(size_t nbr_samples, double sigma_factor, const RealLimits &limits={}) const override
generate list of sample values
";
......@@ -195,11 +195,6 @@ C++ includes: DistributionHandler.h
%feature("docstring") DistributionHandler::~DistributionHandler "DistributionHandler::~DistributionHandler()
";
%feature("docstring") DistributionHandler::addParameterDistribution "void DistributionHandler::addParameterDistribution(const std::string &param_name, const IDistribution1D &distribution, size_t nbr_samples, double sigma_factor=0.0, const RealLimits &limits=RealLimits())
add a sampled parameter distribution
";
%feature("docstring") DistributionHandler::addParameterDistribution "void DistributionHandler::addParameterDistribution(const ParameterDistribution &par_distr)
";
......@@ -263,7 +258,7 @@ Returns the distribution-specific mean.
%feature("docstring") DistributionLogNormal::getScalePar "double DistributionLogNormal::getScalePar() const
";
%feature("docstring") DistributionLogNormal::equidistantPoints "std::vector< double > DistributionLogNormal::equidistantPoints(size_t nbr_samples, double sigma_factor, const RealLimits &limits=RealLimits()) const override
%feature("docstring") DistributionLogNormal::equidistantPoints "std::vector< double > DistributionLogNormal::equidistantPoints(size_t nbr_samples, double sigma_factor, const RealLimits &limits={}) const override
generate list of sample values
";
......@@ -322,7 +317,7 @@ Returns the distribution-specific mean.
%feature("docstring") DistributionLorentz::hwhm "double DistributionLorentz::hwhm() const
";
%feature("docstring") DistributionLorentz::equidistantPoints "std::vector< double > DistributionLorentz::equidistantPoints(size_t nbr_samples, double sigma_factor, const RealLimits &limits=RealLimits()) const override
%feature("docstring") DistributionLorentz::equidistantPoints "std::vector< double > DistributionLorentz::equidistantPoints(size_t nbr_samples, double sigma_factor, const RealLimits &limits={}) const override
generate list of sample values
";
......@@ -387,7 +382,7 @@ Returns the distribution-specific mean.
%feature("docstring") DistributionTrapezoid::getRightWidth "double DistributionTrapezoid::getRightWidth() const
";
%feature("docstring") DistributionTrapezoid::equidistantPoints "std::vector< double > DistributionTrapezoid::equidistantPoints(size_t nbr_samples, double sigma_factor, const RealLimits &limits=RealLimits()) const override
%feature("docstring") DistributionTrapezoid::equidistantPoints "std::vector< double > DistributionTrapezoid::equidistantPoints(size_t nbr_samples, double sigma_factor, const RealLimits &limits={}) const override
generate list of sample values
";
......@@ -427,7 +422,7 @@ Returns the distribution-specific probability density for value x.
Returns the distribution-specific mean.
";
%feature("docstring") IDistribution1D::equidistantSamples "std::vector< ParameterSample > IDistribution1D::equidistantSamples(size_t nbr_samples, double sigma_factor=0., const RealLimits &limits=RealLimits()) const
%feature("docstring") IDistribution1D::equidistantSamples "std::vector< ParameterSample > IDistribution1D::equidistantSamples(size_t nbr_samples, double sigma_factor=0., const RealLimits &limits={}) const
Returns equidistant samples, using intrinsic parameters, weighted with probabilityDensity().
";
......@@ -437,7 +432,7 @@ Returns equidistant samples, using intrinsic parameters, weighted with probabil
Returns equidistant samples from xmin to xmax, weighted with probabilityDensity().
";
%feature("docstring") IDistribution1D::equidistantPoints "virtual std::vector<double> IDistribution1D::equidistantPoints(size_t nbr_samples, double sigma_factor, const RealLimits &limits=RealLimits()) const =0
%feature("docstring") IDistribution1D::equidistantPoints "virtual std::vector<double> IDistribution1D::equidistantPoints(size_t nbr_samples, double sigma_factor, const RealLimits &limits={}) const =0
Returns equidistant interpolation points, with range computed in distribution-specific way from mean and width parameter, taking into account limits and sigma_factor.
";
......
......@@ -2244,7 +2244,7 @@ class Datafield(object):
xProjection(Datafield self) -> Datafield
xProjection(Datafield self, double yvalue) -> Datafield
xProjection(Datafield self, double ylow, double yup) -> Datafield
Datafield * Datafield::xProjection(double ylow, double yup)
Datafield * Datafield::xProjection(double ylow, double yup) const
Project a 2D histogram into 1D histogram along X. The projection is made from all y-bins corresponding to ordinate between ylow and yup.
......@@ -2265,7 +2265,7 @@ class Datafield(object):
yProjection(Datafield self) -> Datafield
yProjection(Datafield self, double xvalue) -> Datafield
yProjection(Datafield self, double xlow, double xup) -> Datafield
Datafield * Datafield::yProjection(double xlow, double xup)
Datafield * Datafield::yProjection(double xlow, double xup) const
Project a 2D histogram into 1D histogram along Y. The projection is made from all x-bins corresponding to abscissa between xlow and xup.
......
......@@ -27870,10 +27870,10 @@ SWIGINTERN PyObject *_wrap_Datafield_xProjection__SWIG_0(PyObject *SWIGUNUSEDPAR
if ((nobjs < 1) || (nobjs > 1)) SWIG_fail;
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Datafield, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Datafield_xProjection" "', argument " "1"" of type '" "Datafield *""'");
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Datafield_xProjection" "', argument " "1"" of type '" "Datafield const *""'");
}
arg1 = reinterpret_cast< Datafield * >(argp1);
result = (Datafield *)(arg1)->xProjection();
result = (Datafield *)((Datafield const *)arg1)->xProjection();
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Datafield, 0 | 0 );
return resultobj;
fail:
......@@ -27894,7 +27894,7 @@ SWIGINTERN PyObject *_wrap_Datafield_xProjection__SWIG_1(PyObject *SWIGUNUSEDPAR
if ((nobjs < 2) || (nobjs > 2)) SWIG_fail;
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Datafield, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Datafield_xProjection" "', argument " "1"" of type '" "Datafield *""'");
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Datafield_xProjection" "', argument " "1"" of type '" "Datafield const *""'");
}
arg1 = reinterpret_cast< Datafield * >(argp1);
ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
......@@ -27902,7 +27902,7 @@ SWIGINTERN PyObject *_wrap_Datafield_xProjection__SWIG_1(PyObject *SWIGUNUSEDPAR
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Datafield_xProjection" "', argument " "2"" of type '" "double""'");
}
arg2 = static_cast< double >(val2);
result = (Datafield *)(arg1)->xProjection(arg2);
result = (Datafield *)((Datafield const *)arg1)->xProjection(arg2);
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Datafield, 0 | 0 );
return resultobj;
fail:
......@@ -27926,7 +27926,7 @@ SWIGINTERN PyObject *_wrap_Datafield_xProjection__SWIG_2(PyObject *SWIGUNUSEDPAR
if ((nobjs < 3) || (nobjs > 3)) SWIG_fail;
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Datafield, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Datafield_xProjection" "', argument " "1"" of type '" "Datafield *""'");
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Datafield_xProjection" "', argument " "1"" of type '" "Datafield const *""'");
}
arg1 = reinterpret_cast< Datafield * >(argp1);
ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
......@@ -27939,7 +27939,7 @@ SWIGINTERN PyObject *_wrap_Datafield_xProjection__SWIG_2(PyObject *SWIGUNUSEDPAR
SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Datafield_xProjection" "', argument " "3"" of type '" "double""'");
}
arg3 = static_cast< double >(val3);
result = (Datafield *)(arg1)->xProjection(arg2,arg3);
result = (Datafield *)((Datafield const *)arg1)->xProjection(arg2,arg3);
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Datafield, 0 | 0 );
return resultobj;
fail:
......@@ -28004,9 +28004,9 @@ SWIGINTERN PyObject *_wrap_Datafield_xProjection(PyObject *self, PyObject *args)
fail:
SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'Datafield_xProjection'.\n"
" Possible C/C++ prototypes are:\n"
" Datafield::xProjection()\n"
" Datafield::xProjection(double)\n"
" Datafield::xProjection(double,double)\n");
" Datafield::xProjection() const\n"
" Datafield::xProjection(double) const\n"
" Datafield::xProjection(double,double) const\n");
return 0;
}
 
......@@ -28021,10 +28021,10 @@ SWIGINTERN PyObject *_wrap_Datafield_yProjection__SWIG_0(PyObject *SWIGUNUSEDPAR
if ((nobjs < 1) || (nobjs > 1)) SWIG_fail;
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Datafield, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Datafield_yProjection" "', argument " "1"" of type '" "Datafield *""'");
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Datafield_yProjection" "', argument " "1"" of type '" "Datafield const *""'");
}
arg1 = reinterpret_cast< Datafield * >(argp1);
result = (Datafield *)(arg1)->yProjection();
result = (Datafield *)((Datafield const *)arg1)->yProjection();
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Datafield, 0 | 0 );
return resultobj;
fail:
......@@ -28045,7 +28045,7 @@ SWIGINTERN PyObject *_wrap_Datafield_yProjection__SWIG_1(PyObject *SWIGUNUSEDPAR
if ((nobjs < 2) || (nobjs > 2)) SWIG_fail;
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Datafield, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Datafield_yProjection" "', argument " "1"" of type '" "Datafield *""'");
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Datafield_yProjection" "', argument " "1"" of type '" "Datafield const *""'");
}
arg1 = reinterpret_cast< Datafield * >(argp1);
ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
......@@ -28053,7 +28053,7 @@ SWIGINTERN PyObject *_wrap_Datafield_yProjection__SWIG_1(PyObject *SWIGUNUSEDPAR
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Datafield_yProjection" "', argument " "2"" of type '" "double""'");
}
arg2 = static_cast< double >(val2);
result = (Datafield *)(arg1)->yProjection(arg2);
result = (Datafield *)((Datafield const *)arg1)->yProjection(arg2);
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Datafield, 0 | 0 );
return resultobj;
fail:
......@@ -28077,7 +28077,7 @@ SWIGINTERN PyObject *_wrap_Datafield_yProjection__SWIG_2(PyObject *SWIGUNUSEDPAR
if ((nobjs < 3) || (nobjs > 3)) SWIG_fail;
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Datafield, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Datafield_yProjection" "', argument " "1"" of type '" "Datafield *""'");
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Datafield_yProjection" "', argument " "1"" of type '" "Datafield const *""'");
}
arg1 = reinterpret_cast< Datafield * >(argp1);
ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
......@@ -28090,7 +28090,7 @@ SWIGINTERN PyObject *_wrap_Datafield_yProjection__SWIG_2(PyObject *SWIGUNUSEDPAR
SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Datafield_yProjection" "', argument " "3"" of type '" "double""'");
}
arg3 = static_cast< double >(val3);
result = (Datafield *)(arg1)->yProjection(arg2,arg3);
result = (Datafield *)((Datafield const *)arg1)->yProjection(arg2,arg3);
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Datafield, 0 | 0 );
return resultobj;
fail:
......@@ -28155,9 +28155,9 @@ SWIGINTERN PyObject *_wrap_Datafield_yProjection(PyObject *self, PyObject *args)
fail:
SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'Datafield_yProjection'.\n"
" Possible C/C++ prototypes are:\n"
" Datafield::yProjection()\n"
" Datafield::yProjection(double)\n"
" Datafield::yProjection(double,double)\n");
" Datafield::yProjection() const\n"
" Datafield::yProjection(double) const\n"
" Datafield::yProjection(double,double) const\n");
return 0;
}
 
......@@ -33462,7 +33462,7 @@ fail:
SWIGINTERN PyObject *_wrap_IDetector_iterateOverRegionOfInterest(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
IDetector *arg1 = (IDetector *) 0 ;
std::function< void (IDetector::const_iterator) > arg2 ;
SwigValueWrapper< std::function< void (SimulationAreaIterator const &) > > arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
void *argp2 ;
......@@ -33499,7 +33499,7 @@ fail:
SWIGINTERN PyObject *_wrap_IDetector_iterateOverNonMaskedPoints(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
IDetector *arg1 = (IDetector *) 0 ;
std::function< void (IDetector::const_iterator) > arg2 ;
SwigValueWrapper< std::function< void (SimulationAreaIterator const &) > > arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
void *argp2 ;
......@@ -38197,7 +38197,7 @@ static PyMethodDef SwigMethods[] = {
"Datafield_xProjection(Datafield self) -> Datafield\n"
"Datafield_xProjection(Datafield self, double yvalue) -> Datafield\n"
"Datafield_xProjection(Datafield self, double ylow, double yup) -> Datafield\n"
"Datafield * Datafield::xProjection(double ylow, double yup)\n"
"Datafield * Datafield::xProjection(double ylow, double yup) const\n"
"\n"
"Project a 2D histogram into 1D histogram along X. The projection is made from all y-bins corresponding to ordinate between ylow and yup.\n"
"\n"
......@@ -38215,7 +38215,7 @@ static PyMethodDef SwigMethods[] = {
"Datafield_yProjection(Datafield self) -> Datafield\n"
"Datafield_yProjection(Datafield self, double xvalue) -> Datafield\n"
"Datafield_yProjection(Datafield self, double xlow, double xup) -> Datafield\n"
"Datafield * Datafield::yProjection(double xlow, double xup)\n"
"Datafield * Datafield::yProjection(double xlow, double xup) const\n"
"\n"
"Project a 2D histogram into 1D histogram along Y. The projection is made from all x-bins corresponding to abscissa between xlow and xup.\n"
"\n"
......@@ -2180,8 +2180,8 @@ class IDistribution1D(libBornAgainBase.ICloneable, INode):
def equidistantSamples(self, *args):
r"""
equidistantSamples(IDistribution1D self, size_t nbr_samples, double sigma_factor=0., RealLimits const & limits=RealLimits()) -> std::vector< ParameterSample,std::allocator< ParameterSample > >
std::vector< ParameterSample > IDistribution1D::equidistantSamples(size_t nbr_samples, double sigma_factor=0., const RealLimits &limits=RealLimits()) const
equidistantSamples(IDistribution1D self, size_t nbr_samples, double sigma_factor=0., RealLimits const & limits={}) -> std::vector< ParameterSample,std::allocator< ParameterSample > >
std::vector< ParameterSample > IDistribution1D::equidistantSamples(size_t nbr_samples, double sigma_factor=0., const RealLimits &limits={}) const
Returns equidistant samples, using intrinsic parameters, weighted with probabilityDensity().
......@@ -2200,8 +2200,8 @@ class IDistribution1D(libBornAgainBase.ICloneable, INode):
def equidistantPoints(self, *args):
r"""
equidistantPoints(IDistribution1D self, size_t nbr_samples, double sigma_factor, RealLimits const & limits=RealLimits()) -> vdouble1d_t
virtual std::vector<double> IDistribution1D::equidistantPoints(size_t nbr_samples, double sigma_factor, const RealLimits &limits=RealLimits()) const =0
equidistantPoints(IDistribution1D self, size_t nbr_samples, double sigma_factor, RealLimits const & limits={}) -> vdouble1d_t
virtual std::vector<double> IDistribution1D::equidistantPoints(size_t nbr_samples, double sigma_factor, const RealLimits &limits={}) const =0
Returns equidistant interpolation points, with range computed in distribution-specific way from mean and width parameter, taking into account limits and sigma_factor.
......@@ -2321,8 +2321,8 @@ class DistributionGate(IDistribution1D):
def equidistantPoints(self, *args):
r"""
equidistantPoints(DistributionGate self, size_t nbr_samples, double sigma_factor, RealLimits const & limits=RealLimits()) -> vdouble1d_t
std::vector< double > DistributionGate::equidistantPoints(size_t nbr_samples, double sigma_factor, const RealLimits &limits=RealLimits()) const override
equidistantPoints(DistributionGate self, size_t nbr_samples, double sigma_factor, RealLimits const & limits={}) -> vdouble1d_t
std::vector< double > DistributionGate::equidistantPoints(size_t nbr_samples, double sigma_factor, const RealLimits &limits={}) const override
Returns list of sample values.
......@@ -2424,8 +2424,8 @@ class DistributionLorentz(IDistribution1D):
def equidistantPoints(self, *args):
r"""