#include <RefinableObj.h>
Public Methods | |
void | XMLOutput (ostream &os, const string &name, int indent=0) const |
XMLOutput to stream in well-formed XML. More... | |
void | XMLOutput (ostream &os, int indent=0) const |
XMLOutput to stream in well-formed XML. More... | |
void | XMLInput (istream &is, const XMLCrystTag &tag) |
XMLInput From stream. | |
Destructor & Constructors | |
RefinablePar () | |
Default Constructor. | |
RefinablePar (const string &name, double *refPar, const double min, const double max, const RefParType *type, RefParDerivStepModel derivMode=REFPAR_DERIV_STEP_RELATIVE, const bool hasLimits=true, const bool isFixed=false, const bool isUsed=true, const bool isPeriodic=false, const double humanScale=1., double period=1.) | |
Constructor. More... | |
~RefinablePar () | |
void | Init (const string &name, double *refPar, const double min, const double max, const RefParType *type, RefParDerivStepModel derivMode=REFPAR_DERIV_STEP_RELATIVE, const bool hasLimits=true, const bool isFixed=false, const bool isUsed=true, const bool isPeriodic=false, const double humanScale=1., double period=1.) |
Constructor. More... | |
Access & change the current value of the parameter | |
double | GetValue () const |
of the parameter. More... | |
void | SetValue (const double value) |
of the parameter. More... | |
const double & | GetHumanValue () const |
Current value of parameter, scaled if necessary (for angles) to a human-understandable value. | |
void | SetHumanValue (const double &) |
Current value of parameter, scaled if necessary (for angles) to a human-understandable value. | |
void | Mutate (const double mutateValue) |
Add the given amount to the parameter current value. More... | |
void | MutateTo (const double newValue) |
Change the current value to the given one. More... | |
double | GetSigma () const |
double | GetHumanSigma () const |
void | SetSigma (const double) |
General info | |
const RefParType * | GetType () const |
Parameter type. | |
void | SetType (const RefParType *) |
Parameter type. | |
string | GetName () const |
Get the parameter's name. | |
void | Print () const |
bool | IsFixed () const |
void | SetIsFixed (const bool) |
bool | IsLimited () const |
void | SetIsLimited (const bool) |
bool | IsUsed () const |
Is the parameter used (if not, it is simply irrelevant in the model) ? | |
void | SetIsUsed (const bool) |
Is the parameter used (if not, it is simply irrelevant in the model) ? | |
bool | IsPeriodic () const |
void | SetIsPeriodic (const bool, double period=1) |
double | GetHumanScale () const |
Human scale for this parameter : for angles, this is equal to 180/pi. | |
void | SetHumanScale (const double) |
Human scale for this parameter : for angles, this is equal to 180/pi. | |
Min, max values | |
double | GetMin () const |
Minimum value allowed (if limited or periodic). | |
void | SetMin (const double) |
Set the Minimum value allowed (if limited). | |
double | GetHumanMin () const |
Get the minimum value allowed (if limited). | |
void | SetHumanMin (const double) |
Set the minimum value allowed (if limited). | |
double | GetMax () const |
Get the maximum value allowed (if limited). | |
void | SetMax (const double) |
Get the maximum value allowed (if limited). | |
double | GetHumanMax () const |
Get the maximum value allowed (if limited). | |
void | SetHumanMax (const double) |
Get the maximum value allowed (if limited). | |
double | GetPeriod () const |
Get the period (if periodic). | |
void | SetPeriod (const double) |
Set the period value (if periodic). | |
Steps during refinement | |
double | GetDerivStep () const |
Fixed step to use to compute numerical derivative. | |
void | SetDerivStep (const double) |
Fixed step to use to compute numerical derivative. | |
double | GetGlobalOptimStep () const |
Maximum step to use during Global Optimization algorithms. | |
void | SetGlobalOptimStep (const double) |
Maximum step to use during Global Optimization algorithms. | |
Equations-In development ! ->do not use or even look. | |
void | SetUseEquation (const bool useItOrNot, const double c0=0.) |
void | SetUseEquation (const bool useItOrNot, const double c0, const double c1, const RefinablePar &refpar1) |
void | SetUseEquation (const bool useItOrNot, const double c0, const double c1, const RefinablePar &refpar1, const double c2, const RefinablePar &refpar2) |
void | SetUseEquation (const bool useItOrNot, const double c0, const double c1, const RefinablePar &refpar1, const double c2, const RefinablePar &refpar2, const double c3, const RefinablePar &refpar3) |
Parameter's Clock | |
void | AssignClock (RefinableObjClock &clock) |
Assign a clock to this parameter. Any time this parameter is modified, the clock will be ticked ! | |
Change Limits | |
void | SetLimitsAbsolute (const double min, const double max) |
Change the limits for this object, giving absolute new limits. | |
void | SetLimitsRelative (const double min, const double max) |
Change the limits for this object, giving relative new limits (eg giving -.1 and +.1 will set new limits at the current value + min and current value + max) Thus min should logically be <0 and max >0. | |
void | SetLimitsProportional (const double min, const double max) |
Change the limits for this object, proportionnaly to the current value. min should be < 1. and max > 1. | |
Private Methods | |
void | Click () |
Click the Clock ! to telle the RefinableObj it has been modified. | |
Private Attributes | |
string | mName |
name of the refinable parameter. | |
const RefParType * | mpRefParType |
Type of refined variable. | |
double * | mValue |
Pointer to the refinable value. | |
double | mMin |
Min value. | |
double | mMax |
Max value. | |
bool | mHasLimits |
Does the refinable parameter need limits (min,max) ? | |
bool | mIsFixed |
is the parameter currently fixed ? | |
bool | mIsUsed |
Is the parameter currently used ? | |
bool | mIsPeriodic |
Is the parameter periodic ? If this is the case, then when using the RefinablePar::Mutate() function, if the parameter goes beyond its limits, it will be shifted by the value of its period. | |
double | mPeriod |
Period value (if relevant). | |
double | mGlobalOptimStep |
Step to use for global method search (simulated annealing,...). | |
double | mDerivStep |
Step to use for numerical derivative calculation. | |
RefParDerivStepModel | mRefParDerivStepModel |
Model followed for derivation. | |
double | mSigma |
Calculated sigma on value. | |
double | mHumanScale |
Scale to be used to display 'human' value. This is for angular parameters: the computer stores values in radians, whil the user only understands degrees. So a scale factor of 180/pi is necessary. | |
bool | mUseEquation |
Is this parameter deined by an equation ? eg: mValue= c0 +c1*par1.Value+... | |
int | mEquationNbRefPar |
number of other ref. parameters involved in the equation evaluation. | |
CrystVector_double | mEquationCoeff |
Coefficient Ci used in equation: Value= C0 + C1 * RefPar1 + C2 * RefPar2 +... | |
const RefinablePar * | mEquationRefPar [10] |
Array of pointers to the RefinablePar used in the equation. | |
bool | mHasAssignedClock |
Is there a clock associated with this parameter ? If yes, then it must Click() it each time it is modified. | |
RefinableObjClock * | mpClock |
Static Private Attributes | |
const int | mEquationMaxRefPar = 10 |
Max number of other ref. parameters involved in the equation evaluation. | |
Friends | |
class | RefinableObj |
These must be continuous.
: define some sort of soft constraint, with the possibility of involving several parameters (complex).
|
Constructor.
|
|
of the parameter. Use the The Mutate() and MutateTo() function to change this value. |
|
Constructor.
|
|
Add the given amount to the parameter current value. If limit is hit, set to limit. If the limit is hit and the parameter is periodic, shift by period to bring back to allowed values.
|
|
Change the current value to the given one. If the limit is hit, then set to the limit (unless the pameter is periodic, then shift by the period amount back to allowed values).
|
|
of the parameter. Use the The Mutate() and MutateTo() function to change this value. |
|
XMLOutput to stream in well-formed XML. this will save the fixed & limited flags, as well as limits. In this function the name used is that of the RefPar. |
|
XMLOutput to stream in well-formed XML. this will save the fixed & limited flags, as well as limits
|