lsst.gauss2d.fit
g199a45376c+7362695278
Toggle main menu visibility
Loading...
Searching...
No Matches
linearintegralmodel.h
1
#ifndef LSST_GAUSS2D_FIT_LINEARINTEGRALMODEL_H
2
#define LSST_GAUSS2D_FIT_LINEARINTEGRALMODEL_H
3
4
#include <map>
5
#include <memory>
6
7
#include "channel.h"
8
#include "parameters.h"
9
#include "integralmodel.h"
10
11
namespace
lsst::gauss2d::fit {
12
16
class
LinearIntegralModel
:
public
IntegralModel
{
17
public
:
18
typedef
std::pair<std::reference_wrapper<const Channel>, std::shared_ptr<IntegralParameterD>>
19
ChannelIntegralParameterD;
20
typedef
std::vector<ChannelIntegralParameterD> Data;
21
29
explicit
LinearIntegralModel
(
const
Data *data_in);
30
~LinearIntegralModel
();
31
33
std::shared_ptr<IntegralParameterD>
at
(
const
Channel
&channel);
35
std::shared_ptr<const IntegralParameterD>
at
(
const
Channel
&channel)
const
;
36
37
typename
Data::iterator begin()
noexcept
;
38
typename
Data::const_iterator cbegin()
const
noexcept
;
39
40
typename
Data::iterator end()
noexcept
;
41
typename
Data::const_iterator cend()
const
noexcept
;
42
43
std::vector<std::reference_wrapper<const Channel>>
get_channels
()
const override
;
44
double
get_integral
(
const
Channel
&channel)
const override
;
45
std::vector<std::pair<ParamBaseCRef, ExtraParamFactorValues>>
get_integral_derivative_factors
(
46
const
Channel
&channel)
const override
;
47
48
ParamRefs &
get_parameters
(ParamRefs ¶ms,
ParamFilter
*filter =
nullptr
)
const override
;
49
ParamCRefs &
get_parameters_const
(ParamCRefs ¶ms,
ParamFilter
*filter =
nullptr
)
const override
;
50
52
size_t
size
()
const
;
53
54
std::string repr(
bool
name_keywords =
false
,
55
std::string_view namespace_separator = Object::CC_NAMESPACE_SEPARATOR)
const override
;
56
std::string str()
const override
;
57
58
const
bool
operator<(
const
IntegralModel
&m)
const
{
return
&(*this) < &m; };
59
const
bool
operator==(
const
IntegralModel
&m)
const
{
return
&(*this) == &m; };
60
const
bool
operator!=(
const
IntegralModel
&m)
const
{
return
&(*this) != &m; };
61
62
private
:
63
Data _data = {};
64
// This could be unordered, but std::hash<std::string> won't take const strings
65
// ... and it doesn't seem to be worth the effort to work around
66
std::map<std::reference_wrapper<const Channel>, std::shared_ptr<IntegralParameterD>> _map = {};
67
struct
Shared_enabler;
68
};
69
70
}
// namespace lsst::gauss2d::fit
71
72
#endif
lsst::gauss2d::fit::Channel
An observational channel, usually representing some range of wavelengths of light.
Definition
channel.h:29
lsst::gauss2d::fit::IntegralModel
A Parametric model for the integral of a 2D distribution.
Definition
integralmodel.h:23
lsst::gauss2d::fit::LinearIntegralModel::LinearIntegralModel
LinearIntegralModel(const Data *data_in)
Definition
linearintegralmodel.cc:12
lsst::gauss2d::fit::LinearIntegralModel::get_parameters_const
ParamCRefs & get_parameters_const(ParamCRefs ¶ms, ParamFilter *filter=nullptr) const override
Same as get_parameters(), but for const refs.
Definition
linearintegralmodel.cc:72
lsst::gauss2d::fit::LinearIntegralModel::get_channels
std::vector< std::reference_wrapper< const Channel > > get_channels() const override
Get the set of channels this instance is applicable for.
Definition
linearintegralmodel.cc:35
lsst::gauss2d::fit::LinearIntegralModel::at
std::shared_ptr< IntegralParameterD > at(const Channel &channel)
Get the IntegralParameterD for the given Channel.
Definition
linearintegralmodel.cc:50
lsst::gauss2d::fit::LinearIntegralModel::get_integral_derivative_factors
std::vector< std::pair< ParamBaseCRef, ExtraParamFactorValues > > get_integral_derivative_factors(const Channel &channel) const override
Return the partial derivative of the model w.r.t. each metaparameter.
Definition
linearintegralmodel.cc:46
lsst::gauss2d::fit::LinearIntegralModel::get_integral
double get_integral(const Channel &channel) const override
Get the value of the integral in a single Channel.
Definition
linearintegralmodel.cc:41
lsst::gauss2d::fit::LinearIntegralModel::get_parameters
ParamRefs & get_parameters(ParamRefs ¶ms, ParamFilter *filter=nullptr) const override
Definition
linearintegralmodel.cc:68
lsst::gauss2d::fit::LinearIntegralModel::size
size_t size() const
Return the size of Data (number of Channel/IntegralParameterD instances).
Definition
linearintegralmodel.cc:77
lsst::gauss2d::fit::ParamFilter
Definition
param_filter.h:17
include
lsst
gauss2d
fit
linearintegralmodel.h
Generated by
1.17.0