LSST Applications g04a91732dc+146a938ab0,g07dc498a13+80b84b0d75,g0fba68d861+4c4f3dcb5c,g1409bbee79+80b84b0d75,g1a7e361dbc+80b84b0d75,g1fd858c14a+f6e422e056,g20f46db602+333b6c0f32,g35bb328faa+fcb1d3bbc8,g42c1b31a95+a1301e4c20,g4d2262a081+f1facf12e5,g4d39ba7253+9b833be27e,g4e0f332c67+5d362be553,g53246c7159+fcb1d3bbc8,g60b5630c4e+9b833be27e,g78460c75b0+2f9a1b4bcd,g786e29fd12+cf7ec2a62a,g7b71ed6315+fcb1d3bbc8,g8852436030+790117df0f,g89139ef638+80b84b0d75,g8d6b6b353c+9b833be27e,g9125e01d80+fcb1d3bbc8,g989de1cb63+80b84b0d75,g9f33ca652e+9c6b68d7f3,ga9baa6287d+9b833be27e,gaaedd4e678+80b84b0d75,gabe3b4be73+1e0a283bba,gb1101e3267+9f3571abad,gb58c049af0+f03b321e39,gb90eeb9370+691e4ab549,gc741bbaa4f+2bcd3860df,gcf25f946ba+790117df0f,gd315a588df+5b65d88fe4,gd6cbbdb0b4+c8606af20c,gd9a9a58781+fcb1d3bbc8,gde0f65d7ad+ee6a3faa19,ge278dab8ac+932305ba37,ge82c20c137+76d20ab76d,gee8db133a9+2a6ae0040b,w.2025.10
LSST Data Management Base Package
Loading...
Searching...
No Matches
lsst::modelfit::parameters::ParameterBase< T > Class Template Referenceabstract

Interface for parameters with values and metadata. More...

#include <parameter.h>

Inheritance diagram for lsst::modelfit::parameters::ParameterBase< T >:
lsst::modelfit::parameters::Object lsst::modelfit::parameters::Parameter< T, C >

Public Member Functions

virtual T get_default () const =0
 Get the default value.
 
virtual std::string get_desc () const =0
 Get a string description for this parameter class.
 
virtual bool get_fixed () const =0
 Return whether the parameter is fixed (not free).
 
virtual bool get_free () const =0
 Return whether the parameter is free (not fixed).
 
virtual std::string get_label () const =0
 Return a string label for this parameter instance.
 
virtual const Limits< T > & get_limits () const =0
 Return the limits for the untransformed value.
 
virtual const Limits< T > & get_limits_maximal () const =0
 Return limits representing the maximum/minimum untransformed value.
 
virtual bool get_linear () const =0
 Return whether the parameter is linear.
 
virtual T get_min () const =0
 Return the minimum value for this parameter instance.
 
virtual T get_max () const =0
 Return the maximum value for this parameter instance.
 
virtual std::string get_name () const =0
 Get a string name for this parameter class.
 
virtual const Transform< T > & get_transform () const =0
 Return the transforming function for this parameter instance.
 
virtual T get_transform_derivative () const =0
 Return the derivative of the transform for this parameter instance.
 
virtual std::shared_ptr< const Transform< T > > get_transform_ptr () const =0
 Return the transform pointer for this parameter instance.
 
virtual T get_value () const =0
 Return the untransformed value of this parameter instance.
 
virtual T get_value_transformed () const =0
 Return the transformed value of this parameter instance.
 
virtual const Unitget_unit () const =0
 Return the unit of this parameter instance.
 
virtual void set_fixed (bool fixed)=0
 Set the parameter to be fixed (or not).
 
virtual void set_free (bool free)=0
 Set the parameter to be free (or not).
 
virtual void set_label (std::string label)=0
 Set the string label for this parameter instance.
 
virtual void set_limits (std::shared_ptr< const Limits< T > > limits)=0
 Set the limits for this parameter instance.
 
virtual void set_transform (std::shared_ptr< const Transform< T > > transform)=0
 Set the transforming function for this parameter instance.
 
virtual void set_value (T value)=0
 Set the untransformed value for this parameter instance.
 
virtual void set_value_transformed (T value_transformed)=0
 Set the transformed value for this parameter instance.
 
virtual void set_unit (std::shared_ptr< const Unit > unit=nullptr)=0
 Set the unit for this parameter instance.
 
virtual ~ParameterBase ()=default
 
virtual std::string repr (bool name_keywords=false, const std::string_view &namespace_separator=CC_NAMESPACE_SEPARATOR) const =0
 Return a full, callable string representation of this.
 
virtual std::string str () const =0
 Return a brief, human-readable string representation of this.
 

Static Public Member Functions

static const UnitTransform< T > & transform_none ()
 

Static Public Attributes

static constexpr std::string_view CC_NAMESPACE_SEPARATOR = "::"
 The C++ namespace separator.
 

Friends

bool operator== (const ParameterBase< T > &first, const ParameterBase< T > &second)
 
bool operator!= (const ParameterBase< T > &first, const ParameterBase< T > &second)
 
bool operator< (const ParameterBase< T > &first, const ParameterBase< T > &second)
 

Detailed Description

template<typename T>
class lsst::modelfit::parameters::ParameterBase< T >

Interface for parameters with values and metadata.

A parameter represents a single numeric value, with metadata like a name, description, unit, as well as optional limits and a transforming function. This class is intended for use in numerical optimization.

Template Parameters
TThe type of the value. Only floating point values are tested.
Note
This base class exists partly because e.g. Python bindings can't understand CRTP. It is probably unnecessary (albeit convenient) in C++ and comes with a performance cost.

Definition at line 58 of file parameter.h.

Constructor & Destructor Documentation

◆ ~ParameterBase()

template<typename T>
virtual lsst::modelfit::parameters::ParameterBase< T >::~ParameterBase ( )
virtualdefault

Member Function Documentation

◆ get_default()

◆ get_desc()

template<typename T>
virtual std::string lsst::modelfit::parameters::ParameterBase< T >::get_desc ( ) const
pure virtual

◆ get_fixed()

template<typename T>
virtual bool lsst::modelfit::parameters::ParameterBase< T >::get_fixed ( ) const
pure virtual

◆ get_free()

template<typename T>
virtual bool lsst::modelfit::parameters::ParameterBase< T >::get_free ( ) const
pure virtual

◆ get_label()

template<typename T>
virtual std::string lsst::modelfit::parameters::ParameterBase< T >::get_label ( ) const
pure virtual

◆ get_limits()

template<typename T>
virtual const Limits< T > & lsst::modelfit::parameters::ParameterBase< T >::get_limits ( ) const
pure virtual

◆ get_limits_maximal()

template<typename T>
virtual const Limits< T > & lsst::modelfit::parameters::ParameterBase< T >::get_limits_maximal ( ) const
pure virtual

◆ get_linear()

template<typename T>
virtual bool lsst::modelfit::parameters::ParameterBase< T >::get_linear ( ) const
pure virtual

◆ get_max()

◆ get_min()

◆ get_name()

template<typename T>
virtual std::string lsst::modelfit::parameters::ParameterBase< T >::get_name ( ) const
pure virtual

◆ get_transform()

template<typename T>
virtual const Transform< T > & lsst::modelfit::parameters::ParameterBase< T >::get_transform ( ) const
pure virtual

◆ get_transform_derivative()

template<typename T>
virtual T lsst::modelfit::parameters::ParameterBase< T >::get_transform_derivative ( ) const
pure virtual

◆ get_transform_ptr()

template<typename T>
virtual std::shared_ptr< const Transform< T > > lsst::modelfit::parameters::ParameterBase< T >::get_transform_ptr ( ) const
pure virtual

◆ get_unit()

template<typename T>
virtual const Unit & lsst::modelfit::parameters::ParameterBase< T >::get_unit ( ) const
pure virtual

◆ get_value()

template<typename T>
virtual T lsst::modelfit::parameters::ParameterBase< T >::get_value ( ) const
pure virtual

◆ get_value_transformed()

template<typename T>
virtual T lsst::modelfit::parameters::ParameterBase< T >::get_value_transformed ( ) const
pure virtual

◆ repr()

virtual std::string lsst::modelfit::parameters::Object::repr ( bool name_keywords = false,
const std::string_view & namespace_separator = CC_NAMESPACE_SEPARATOR ) const
pure virtualinherited

Return a full, callable string representation of this.

Parameters
name_keywordsWhether to prefix arguments with "{name}=", where name is the arg name in the header (as with keyword arguments in Python).
namespace_separatorThe string to use to delimit namespaces, i.e. :: in C++ and . in Python.
Returns
A callable string representation of this, which should return an an identical object to this.
Note
The representation with name_keywords=false must be callable in C++. The representation with name_keywords=true should be callable in Python, if there are any bindings.

Implemented in lsst::gauss2d::fit::InverseTransform, lsst::gauss2d::fit::JanskyToABMagTransform, lsst::gauss2d::fit::Log10Transform, lsst::gauss2d::fit::LogitLimitedTransform, lsst::gauss2d::fit::LogitTransform, lsst::gauss2d::fit::LogTransform, lsst::gauss2d::fit::NanojanskyToABMagTransform, lsst::modelfit::parameters::Limits< T >, lsst::modelfit::parameters::Limits< double >, lsst::modelfit::parameters::Parameter< T, C >, lsst::modelfit::parameters::Parameter< double, T >, lsst::modelfit::parameters::Parameter< double, T >, and lsst::modelfit::parameters::UnitTransform< T >.

◆ set_fixed()

template<typename T>
virtual void lsst::modelfit::parameters::ParameterBase< T >::set_fixed ( bool fixed)
pure virtual

◆ set_free()

template<typename T>
virtual void lsst::modelfit::parameters::ParameterBase< T >::set_free ( bool free)
pure virtual

◆ set_label()

template<typename T>
virtual void lsst::modelfit::parameters::ParameterBase< T >::set_label ( std::string label)
pure virtual

◆ set_limits()

template<typename T>
virtual void lsst::modelfit::parameters::ParameterBase< T >::set_limits ( std::shared_ptr< const Limits< T > > limits)
pure virtual

◆ set_transform()

template<typename T>
virtual void lsst::modelfit::parameters::ParameterBase< T >::set_transform ( std::shared_ptr< const Transform< T > > transform)
pure virtual

◆ set_unit()

template<typename T>
virtual void lsst::modelfit::parameters::ParameterBase< T >::set_unit ( std::shared_ptr< const Unit > unit = nullptr)
pure virtual

◆ set_value()

template<typename T>
virtual void lsst::modelfit::parameters::ParameterBase< T >::set_value ( T value)
pure virtual

◆ set_value_transformed()

template<typename T>
virtual void lsst::modelfit::parameters::ParameterBase< T >::set_value_transformed ( T value_transformed)
pure virtual

◆ str()

◆ transform_none()

template<typename T>
static const UnitTransform< T > & lsst::modelfit::parameters::ParameterBase< T >::transform_none ( )
inlinestatic

Definition at line 111 of file parameter.h.

111{ return UnitTransform<T>::get(); };
static const UnitTransform< T > & get()
Definition transform.h:64

Friends And Related Symbol Documentation

◆ operator!=

template<typename T>
bool operator!= ( const ParameterBase< T > & first,
const ParameterBase< T > & second )
friend

Definition at line 117 of file parameter.h.

117 {
118 return &first != &second;
119 }
Interface for parameters with values and metadata.
Definition parameter.h:58

◆ operator<

template<typename T>
bool operator< ( const ParameterBase< T > & first,
const ParameterBase< T > & second )
friend

Definition at line 121 of file parameter.h.

121 {
122 return std::less<const ParameterBase<T>*>{}(&first, &second) == true;
123 }

◆ operator==

template<typename T>
bool operator== ( const ParameterBase< T > & first,
const ParameterBase< T > & second )
friend

Definition at line 113 of file parameter.h.

113 {
114 return &first == &second;
115 }

Member Data Documentation

◆ CC_NAMESPACE_SEPARATOR

std::string_view lsst::modelfit::parameters::Object::CC_NAMESPACE_SEPARATOR = "::"
staticconstexprinherited

The C++ namespace separator.

Definition at line 42 of file object.h.


The documentation for this class was generated from the following file: