LSST Applications 29.1.0,g0fba68d861+6b120c4394,g123d84c11c+8c5ae1fdc5,g1ec0fe41b4+191117f6ec,g1fd858c14a+c8450ae71a,g3533f9d6cb+a04f9ee0ab,g35bb328faa+8c5ae1fdc5,g3f0dcc2b1b+7df08700bd,g4178042926+b4254969db,g44ba364a48+04455b336b,g53246c7159+8c5ae1fdc5,g60b5630c4e+a04f9ee0ab,g663da51e9b+b05e6e1875,g67b6fd64d1+250bf6acd3,g78460c75b0+7e33a9eb6d,g786e29fd12+668abc6043,g8352419a5c+8c5ae1fdc5,g87e3079a85+d3fa38de54,g8852436030+cd899e2626,g89139ef638+250bf6acd3,g93a033419f+31ead11197,g989de1cb63+250bf6acd3,g9f33ca652e+f6053ecf14,ga1e959baac+5fbc491aed,ga2f891cd6c+a04f9ee0ab,gabe3b4be73+8856018cbb,gabf8522325+1f7e6d67b9,gac2eed3f23+250bf6acd3,gb1101e3267+0c331e9486,gb89ab40317+250bf6acd3,gcf25f946ba+cd899e2626,gd107969129+8964d67276,gd6cbbdb0b4+6bbecc8878,gde0f65d7ad+d65f9e019a,ge278dab8ac+eb3bbeb12f,ge410e46f29+250bf6acd3,gf5e32f922b+8c5ae1fdc5,gff02db199a+747430a128,gffe7e49bb4+a04f9ee0ab
LSST Data Management Base Package
|
A parameter with values and metadata. More...
#include <parameter.h>
Public Member Functions | |
std::string | get_desc () const override |
Get a string description for this parameter class. | |
T | get_default () const override |
Get the default value. | |
bool | get_fixed () const override |
Return whether the parameter is fixed (not free). | |
bool | get_free () const override |
Return whether the parameter is free (not fixed). | |
std::string | get_label () const override |
Return a string label for this parameter instance. | |
const Limits< T > & | get_limits_maximal () const override |
Return limits representing the maximum/minimum untransformed value. | |
const Limits< T > & | get_limits () const override |
Return the limits for the untransformed value. | |
bool | get_linear () const override |
Return whether the parameter is linear. | |
T | get_min () const override |
Return the minimum value for this parameter instance. | |
T | get_max () const override |
Return the maximum value for this parameter instance. | |
std::string | get_name () const override |
Get a string name for this parameter class. | |
const Transform< T > & | get_transform () const override |
Return the transforming function for this parameter instance. | |
std::shared_ptr< const Transform< T > > | get_transform_ptr () const override |
Return the transform pointer for this parameter instance. | |
T | get_transform_derivative () const override |
Return the derivative of the transform for this parameter instance. | |
const Unit & | get_unit () const override |
Return the unit of this parameter instance. | |
T | get_value () const override |
Return the untransformed value of this parameter instance. | |
T | get_value_transformed () const override |
Return the transformed value of this parameter instance. | |
std::shared_ptr< C > | ptr () |
Return a shared pointer to this. | |
void | set_fixed (bool fixed) override |
Set the parameter to be fixed (or not). | |
void | set_free (bool free) override |
Set the parameter to be free (or not). | |
void | set_label (std::string label) override |
Set the string label for this parameter instance. | |
void | set_limits (std::shared_ptr< const Limits< T > > limits) override |
Set the limits for this parameter instance. | |
void | set_transform (const std::shared_ptr< const Transform< T > > transform) override |
Set the transforming function for this parameter instance. | |
void | set_value (T value) override |
Set the untransformed value for this parameter instance. | |
void | set_value_transformed (T value_transformed) override |
Set the transformed value for this parameter instance. | |
void | set_unit (std::shared_ptr< const Unit > unit=nullptr) override |
Set the unit for this parameter instance. | |
std::string | repr (bool name_keywords=false, const std::string_view &namespace_separator=Object::CC_NAMESPACE_SEPARATOR) const override |
Return a full, callable string representation of this. | |
std::string | str () const override |
Return a brief, human-readable string representation of this. | |
Parameter (T value=_get_default(), std::shared_ptr< const Limits< T > > limits=nullptr, const std::shared_ptr< const Transform< T > > transform=nullptr, std::shared_ptr< const Unit > unit=nullptr, bool fixed=false, std::string label="") | |
Initialize a Parameter. | |
~Parameter () | |
T | shared_from_this (T... args) |
Static Public Member Functions | |
static constexpr T | _get_default () |
Get the default value for the derived type of this. | |
static const std::string | get_type_name (bool strip_namespace_separator=false, const std::string_view &namespace_separator=detail::NAMESPACE_SEPARATOR) |
Get the name of the derived type of this. | |
static const UnitTransform< T > & | transform_none () |
Static Public Attributes | |
static constexpr std::string_view | CC_NAMESPACE_SEPARATOR = "::" |
The C++ namespace separator. | |
Static Protected Member Functions | |
static const std::string | _get_desc () |
static constexpr bool | _get_linear () |
static constexpr T | _get_min () |
static constexpr T | _get_max () |
static const std::string | _get_name () |
Protected Attributes | |
T | _value |
The untransformed value. | |
T | _value_transformed |
The cached, transformed value. | |
A parameter with values and metadata.
This is a CRTP implementation of the ParameterBase interface, which allows for concise, minimal-effort derived classes (see tests and examples).
T | The type of the value. Only floating point values are tested. |
C | The derived class. |
Definition at line 150 of file parameter.h.
|
inline |
Initialize a Parameter.
value | The initial untransformed value. |
limits | The untransformed value limits. |
transform | The transformation to apply to values. |
unit | The unit of the untransformed value. |
fixed | Whether the parameter is fixed in models. |
label | A descriptive label for the parameter. |
Definition at line 343 of file parameter.h.
|
inline |
Definition at line 354 of file parameter.h.
|
inlinestaticconstexpr |
|
inlinestaticprotected |
Definition at line 204 of file parameter.h.
|
inlinestaticconstexprprotected |
Definition at line 205 of file parameter.h.
|
inlinestaticconstexprprotected |
Definition at line 207 of file parameter.h.
|
inlinestaticconstexprprotected |
Definition at line 206 of file parameter.h.
|
inlinestaticprotected |
Definition at line 208 of file parameter.h.
|
inlineoverridevirtual |
Get the default value.
Implements lsst::modelfit::parameters::ParameterBase< T >.
Definition at line 216 of file parameter.h.
|
inlineoverridevirtual |
Get a string description for this parameter class.
Implements lsst::modelfit::parameters::ParameterBase< T >.
Definition at line 214 of file parameter.h.
|
inlineoverridevirtual |
Return whether the parameter is fixed (not free).
Implements lsst::modelfit::parameters::ParameterBase< T >.
Definition at line 218 of file parameter.h.
|
inlineoverridevirtual |
Return whether the parameter is free (not fixed).
Implements lsst::modelfit::parameters::ParameterBase< T >.
Definition at line 220 of file parameter.h.
|
inlineoverridevirtual |
Return a string label for this parameter instance.
Implements lsst::modelfit::parameters::ParameterBase< T >.
Definition at line 222 of file parameter.h.
|
inlineoverridevirtual |
Return the limits for the untransformed value.
Implements lsst::modelfit::parameters::ParameterBase< T >.
Definition at line 230 of file parameter.h.
|
inlineoverridevirtual |
Return limits representing the maximum/minimum untransformed value.
Implements lsst::modelfit::parameters::ParameterBase< T >.
Definition at line 224 of file parameter.h.
|
inlineoverridevirtual |
Return whether the parameter is linear.
Implements lsst::modelfit::parameters::ParameterBase< T >.
Definition at line 232 of file parameter.h.
|
inlineoverridevirtual |
Return the maximum value for this parameter instance.
Implements lsst::modelfit::parameters::ParameterBase< T >.
Definition at line 236 of file parameter.h.
|
inlineoverridevirtual |
Return the minimum value for this parameter instance.
Implements lsst::modelfit::parameters::ParameterBase< T >.
Definition at line 234 of file parameter.h.
|
inlineoverridevirtual |
Get a string name for this parameter class.
Implements lsst::modelfit::parameters::ParameterBase< T >.
Definition at line 238 of file parameter.h.
|
inlineoverridevirtual |
Return the transforming function for this parameter instance.
Implements lsst::modelfit::parameters::ParameterBase< T >.
Definition at line 240 of file parameter.h.
|
inlineoverridevirtual |
Return the derivative of the transform for this parameter instance.
Implements lsst::modelfit::parameters::ParameterBase< T >.
Definition at line 244 of file parameter.h.
|
inlineoverridevirtual |
Return the transform pointer for this parameter instance.
Implements lsst::modelfit::parameters::ParameterBase< T >.
Definition at line 242 of file parameter.h.
|
inlinestatic |
Get the name of the derived type of this.
Definition at line 248 of file parameter.h.
|
inlineoverridevirtual |
Return the unit of this parameter instance.
Implements lsst::modelfit::parameters::ParameterBase< T >.
Definition at line 254 of file parameter.h.
|
inlineoverridevirtual |
Return the untransformed value of this parameter instance.
Implements lsst::modelfit::parameters::ParameterBase< T >.
Definition at line 256 of file parameter.h.
|
inlineoverridevirtual |
Return the transformed value of this parameter instance.
Implements lsst::modelfit::parameters::ParameterBase< T >.
Definition at line 258 of file parameter.h.
|
inline |
|
inlineoverridevirtual |
Return a full, callable string representation of this.
name_keywords | Whether to prefix arguments with "{name}=", where name is the arg name in the header (as with keyword arguments in Python). |
namespace_separator | The string to use to delimit namespaces, i.e. :: in C++ and . in Python. |
Implements lsst::modelfit::parameters::Object.
Definition at line 312 of file parameter.h.
|
inlineoverridevirtual |
Set the parameter to be fixed (or not).
Implements lsst::modelfit::parameters::ParameterBase< T >.
Definition at line 263 of file parameter.h.
|
inlineoverridevirtual |
Set the parameter to be free (or not).
Implements lsst::modelfit::parameters::ParameterBase< T >.
Definition at line 264 of file parameter.h.
|
inlineoverridevirtual |
Set the string label for this parameter instance.
Implements lsst::modelfit::parameters::ParameterBase< T >.
Definition at line 265 of file parameter.h.
|
inlineoverridevirtual |
Set the limits for this parameter instance.
Implements lsst::modelfit::parameters::ParameterBase< T >.
Definition at line 266 of file parameter.h.
|
inlineoverridevirtual |
Set the transforming function for this parameter instance.
Implements lsst::modelfit::parameters::ParameterBase< T >.
Definition at line 283 of file parameter.h.
|
inlineoverridevirtual |
Set the unit for this parameter instance.
Implements lsst::modelfit::parameters::ParameterBase< T >.
Definition at line 308 of file parameter.h.
|
inlineoverridevirtual |
Set the untransformed value for this parameter instance.
Implements lsst::modelfit::parameters::ParameterBase< T >.
Definition at line 297 of file parameter.h.
|
inlineoverridevirtual |
Set the transformed value for this parameter instance.
Implements lsst::modelfit::parameters::ParameterBase< T >.
Definition at line 303 of file parameter.h.
|
inlineoverridevirtual |
Return a brief, human-readable string representation of this.
Implements lsst::modelfit::parameters::Object.
Definition at line 321 of file parameter.h.
|
inlinestaticinherited |
Definition at line 111 of file parameter.h.
|
protected |
The untransformed value.
Definition at line 200 of file parameter.h.
|
protected |
The cached, transformed value.
Definition at line 202 of file parameter.h.
|
staticconstexprinherited |