Each parameter can be masked. The mask can, e.g., be used to indicate to a
generic least-squares fitting routine to only adjust parameters with
a True mask (the default). For that reason methods that only
handle True data items have names with Adjust in
the names. In general the user should not be concerned with these
methods, but should only manipulate the parameter flags and
values.
Copy assignment (deep copy)
Return the number of parameters
Manipulate the mask associated with the nth parameter
(e.g. to indicate whether the parameter is adjustable or nonadjustable).
Note no index check.
Get all parameters at once. Returns zero length
Vector if there are no parameters.
Get all parameter masks at once. Returns zero length
Vector if there are no parameters.
Operations on the masked parameters only. For possible re-use the
results are cached.
Number of masked (=True) parameters
Operations on the masked parameters only. For possible re-use the
results are cached.
Output the parameters
Create a cached version of the masked parameter list
Synopsis
FunctionParam is used to provide an interface to an entity which
has parameters that can be flagged.
This is useful, for example, in implementing parameter
fitting which operates on generic function objects.
Example
See the Function class for a usage
interface.
Motivation
Generically manipulatable adjustable parameters are important for fitting.
Template Type Argument Requirements (T)
To Do
Member Description
FunctionParam()
Construct a default FunctionParam with 0 parameters
explicit FunctionParam(const uInt n)
Construct a FunctionParam with n parameters with zero value and
all masks True
explicit FunctionParam(const Vector<T> &in)
Construct a FunctionParam from the given vector, with all masks
True
FunctionParam(const FunctionParam<T> &other)
Copy constructor (deep copy)
virtual ~FunctionParam()
Destructor
FunctionParam &operator=(const FunctionParam<T> &other)
T &operator[](const uInt n)
Manipulate the nth parameter (0-based) with no index check
const T &operator[](const uInt n) const
Bool operator==(const FunctionParam<T> &other) const
Compare two parameter sets for equal size, values and masks.
Bool operator!=(const FunctionParam<T> &other) const
uInt nelements() const
T ¶meter(const uInt n)
Manipulate the nth parameter (0-based) with no index check
const T ¶meter(const uInt n) const
Bool &mask(const uInt n)
const Bool &mask(const uInt n) const
const Vector<T> &getParameters() const
void setParameters(const Vector<T> ¶ms)
Set all the parameters at once. Only the minimum of the input number and
the object number of parameters will be set.
const Vector<Bool> &getParamMasks() const
void setParamMasks(const Vector<Bool> &masks)
Set all parameter masks at once. Only the minimum of the input number and
the object number of parameters will be set.
uInt nMaskedParameters() const
Vector<T> &getMaskedParameters() const
void setMaskedParameters(Vector<T> &in)
ostream &print(ostream &os) const
void createMaskedPtr() const
void clearMaskedPtr() const
Clear the masked parameter list
Global functions (source)
Interface
Description
Member Description
ostream &operator<<(ostream &os, const FunctionParam<T> &par)
Output declaration