FOX/ObjCryst++
1.10.X (development)
|
Generic Refinable Object. More...
Public Member Functions | |
RefinableObj () | |
Constructor. | |
RefinableObj (const bool internalUseOnly) | |
Constructor. More... | |
RefinableObj (const RefinableObj &old) | |
Defined not implemented... More... | |
virtual | ~RefinableObj () |
Destructor. | |
virtual const string & | GetClassName () const |
Name for this class ("RefinableObj", "Crystal",...). More... | |
virtual const string & | GetName () const |
Name of the object. | |
virtual void | SetName (const string &name) |
Name of the object. | |
void | operator= (const RefinableObj &old) |
Defined not implemented... More... | |
void | PrepareForRefinement () const |
Find which parameters are used and not fixed, for a refinement /optimization. More... | |
void | FixAllPar () |
Fix All parameters. | |
void | UnFixAllPar () |
UnFix All parameters. | |
void | SetParIsFixed (const long parIndex, const bool fix) |
Fix/un-fix one parameter from its #. | |
void | SetParIsFixed (const string &parName, const bool fix) |
Fix/un-fix one parameter from its name. | |
void | SetParIsFixed (const RefParType *type, const bool fix) |
Fix/un-fix one family of parameters. | |
void | SetParIsUsed (const string &parName, const bool use) |
Set whether a parameter is used. | |
void | SetParIsUsed (const RefParType *type, const bool use) |
Set whether a family of parameters is used. | |
long | GetNbPar () const |
Total number of refinable parameter in the object. More... | |
long | GetNbParNotFixed () const |
Total number of non-fixed parameters. Is initialized by PrepareForRefinement() | |
RefinablePar & | GetPar (const long i) |
Access all parameters in the order they were inputted. | |
const RefinablePar & | GetPar (const long i) const |
Access all parameters in the order they were inputted. | |
RefinablePar & | GetPar (const string &name) |
Access all parameters from their name. | |
const RefinablePar & | GetPar (const string &name) const |
Access all parameters from their name. | |
RefinablePar & | GetPar (const REAL *) |
Access parameter from its adress. | |
const RefinablePar & | GetPar (const REAL *) const |
Access parameter from its adress. | |
RefinablePar & | GetParNotFixed (const long i) |
Access all parameters in the order they were inputted, skipping fixed parameters. More... | |
const RefinablePar & | GetParNotFixed (const long i) const |
Access all parameters in the order they were inputed, skipping fixed parameters. More... | |
void | AddPar (const RefinablePar &newRefPar) |
Add a refinable parameter. More... | |
void | AddPar (RefinablePar *newRefPar) |
Add a refinable parameter. More... | |
void | AddPar (RefinableObj &newRefParList, const bool copyParam=false) |
Add all the parameters in another RefinableObj. More... | |
vector< RefinablePar * >::iterator | RemovePar (RefinablePar *refPar) |
Remove a refinable parameter. More... | |
virtual void | Print () const |
unsigned long | CreateParamSet (const string name="") const |
Save the current set of refined values in a new set. More... | |
void | ClearParamSet (const unsigned long id) const |
Erase the param set with the given id, releasing memory. | |
void | SaveParamSet (const unsigned long id) const |
Save the current set of refined values over a previously-created set of saved values. More... | |
void | RestoreParamSet (const unsigned long id) |
Restore a saved set of values. More... | |
const CrystVector_REAL & | GetParamSet (const unsigned long setId) const |
Access one save refpar set. More... | |
CrystVector_REAL & | GetParamSet (const unsigned long setId) |
Access one save refpar set. More... | |
REAL | GetParamSet_ParNotFixedHumanValue (const unsigned long setId, const long parNumber) const |
Access the (human) value of one refined parameter in a saved set of parameters. More... | |
const void | EraseAllParamSet () |
Erase all saved refpar sets. More... | |
const string & | GetParamSetName (const unsigned long setId) const |
Get the name associated to a refpar set. More... | |
void | SetLimitsAbsolute (const string &parName, const REAL min, const REAL max) |
Change the limits for a given parameter, giving absolute new limits. | |
void | SetLimitsAbsolute (const RefParType *type, const REAL min, const REAL max) |
Change the limits for a category of parameters, giving absolute new limits. | |
void | SetLimitsRelative (const string &parName, const REAL min, const REAL max) |
Change the limits for a given parameter, 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. More... | |
void | SetLimitsRelative (const RefParType *type, const REAL min, const REAL max) |
Change the limits for a category of parameters, giving relative new limits (eg giving -.1 and +.1 will set new limits at the current value + min and current value + max). More... | |
void | SetLimitsProportional (const string &parName, const REAL min, const REAL max) |
Change the limits for a given parameter, proportionnaly to the current value. More... | |
void | SetLimitsProportional (const RefParType *type, const REAL min, const REAL max) |
Change the limits for a category of parameters, proportionnaly to their current value. More... | |
void | SetGlobalOptimStep (const RefParType *type, const REAL step) |
Change the maximum step to use during Global Optimization algorithms. | |
ObjRegistry< RefinableObj > & | GetSubObjRegistry () |
Access to the registry of RefinableObj used by this object. | |
const ObjRegistry< RefinableObj > & | GetSubObjRegistry () const |
Access to the registry of RefinableObj used by this object. | |
virtual void | RegisterClient (RefinableObj &) const |
Register a new object using this object. More... | |
virtual void | DeRegisterClient (RefinableObj &) const |
Deregister an object (which not any more) using this object. | |
virtual const ObjRegistry < RefinableObj > & | GetClientRegistry () const |
Get the list of clients. | |
virtual ObjRegistry < RefinableObj > & | GetClientRegistry () |
Get the list of clients. | |
bool | IsBeingRefined () const |
Is the object being refined ? (Can be refined by one algorithm at a time only.) | |
virtual void | BeginOptimization (const bool allowApproximations=false, const bool enableRestraints=false) |
This should be called by any optimization class at the begining of an optimization. More... | |
virtual void | EndOptimization () |
This should be called by any optimization class at the end of an optimization. More... | |
virtual void | SetApproximationFlag (const bool allow) |
Enable or disable numerical approximations. More... | |
virtual void | RandomizeConfiguration () |
Randomize Configuration (before a global optimization). More... | |
virtual void | GlobalOptRandomMove (const REAL mutationAmplitude, const RefParType *type=gpRefParTypeObjCryst) |
Make a random move of the current configuration. More... | |
void | BeginGlobalOptRandomMove () |
Raise a flag, to be sure not to make a random change more than once in each RefinableObj. More... | |
virtual REAL | GetLogLikelihood () const |
Get -log(likelihood) of the current configuration for the object. More... | |
virtual unsigned int | GetNbLSQFunction () const |
Number of LSQ functions. | |
virtual const CrystVector_REAL & | GetLSQCalc (const unsigned int) const |
Get the current calculated value for the LSQ function. | |
virtual const CrystVector_REAL & | GetLSQObs (const unsigned int) const |
Get the observed values for the LSQ function. | |
virtual const CrystVector_REAL & | GetLSQWeight (const unsigned int) const |
Get the weight values for the LSQ function. | |
virtual const CrystVector_REAL & | GetLSQDeriv (const unsigned int, RefinablePar &) |
Get the first derivative values for the LSQ function, for a given parameter. More... | |
virtual std::map< RefinablePar *, CrystVector_REAL > & | GetLSQ_FullDeriv (const unsigned int, std::set< RefinablePar * > &vPar) |
Get the first derivative for the LSQ function for each parameter supplied in a list. More... | |
void | ResetParList () |
Re-init the list of refinable parameters, removing all parameters. More... | |
virtual void | XMLOutput (ostream &os, int indent=0) const |
Output to stream in well-formed XML. More... | |
virtual void | XMLInput (istream &is, const XMLCrystTag &tag) |
Input From stream. More... | |
virtual void | UpdateDisplay () const |
If there is an interface, this should be automatically be called each time there is a 'new, significant' configuration to report. More... | |
unsigned int | GetNbOption () const |
Number of Options for this object. | |
RefObjOpt & | GetOption (const unsigned int i) |
Access to the options. | |
const RefObjOpt & | GetOption (const unsigned int i) const |
const access to the options | |
virtual void | GetGeneGroup (const RefinableObj &obj, CrystVector_uint &groupIndex, unsigned int &firstGroup) const |
Get the gene group assigned to each parameter. More... | |
void | SetDeleteRefParInDestructor (const bool b) |
Set this object not to delete its list of parameters when destroyed. More... | |
const RefinableObjClock & | GetRefParListClock () const |
What was the last time a RefinablePar was added/removed ? More... | |
virtual REAL | GetRestraintCost () const |
Get the restraint cost (overall penalty of all restraints) More... | |
void | AddRestraint (Restraint *pNewRestraint) |
Add a new restraint. More... | |
vector< Restraint * >::iterator | RemoveRestraint (Restraint *pRestraint) |
Remove a restraint from the list of known restraints. More... | |
virtual void | TagNewBestConfig () const |
During a global optimization, tells the object that the current config is the latest "best" config. More... | |
const RefinableObjClock & | GetClockMaster () const |
This clocks records any change in the object. See refinableObj::mClockMaster. | |
Protected Member Functions | |
long | FindPar (const string &name) const |
Find a refinable parameter with a given name. | |
long | FindPar (const REAL *) const |
Find a refinable parameter from the adress of its value. | |
void | AddSubRefObj (RefinableObj &) |
void | RemoveSubRefObj (RefinableObj &) |
void | AddOption (RefObjOpt *opt) |
virtual void | Prepare () |
map< unsigned long, pair < CrystVector_REAL, string > >::iterator | FindParamSet (unsigned long id) const |
Find a parameter set with a given id (and check if it is there) | |
Protected Attributes | |
string | mName |
Name for this RefinableObject. Should be unique, at least in the same scope.+. | |
vector< RefinablePar * > | mvpRefPar |
Vector of pointers to the refinable parameters. | |
vector< Restraint * > | mvpRestraint |
Vector of pointers to the restraints for this object. More... | |
map< unsigned long, pair < CrystVector_REAL, string > > | mvpSavedValuesSet |
Map of (index,pointers to arrays) used to save sets of values for all parameters. More... | |
long | mNbRefParNotFixed |
Total of not-fixed parameters. | |
CrystVector_long | mRefparNotFixedIndex |
Index of not-fixed parameters. | |
int | mOptimizationDepth |
Is the object being refined or optimized ? if mOptimizationDepth=0, no optimization is taking place. More... | |
ObjRegistry< RefinableObj > | mSubObjRegistry |
Registry of RefinableObject needed for this object (owned by this object or not) | |
ObjRegistry< RefinableObj > | mClientObjRegistry |
Registry of RefinableObject using this object. More... | |
ObjRegistry< RefObjOpt > | mOptionRegistry |
List of options for this object. More... | |
bool | mDeleteRefParInDestructor |
If true (the default), then all RefinablePar will be deleted when the the object is deleted. More... | |
RefinableObjClock | mRefParListClock |
Last time the RefinableParList was modified (a parameter added or removed). | |
bool | mRandomMoveIsDone |
CrystVector_REAL | mLSQDeriv |
Temporary array used to return derivative values of the LSQ function for given parameters. More... | |
std::map< unsigned int, std::map< RefinablePar *, CrystVector_REAL > > | mLSQ_FullDeriv |
Temporary map to return the derivative of the LSQ function versus a list of parameters. More... | |
RefinableObjClock | mClockMaster |
Master clock, which is changed whenever the object has been altered. More... | |
Generic Refinable Object.
This is basically a list of refinable parameters, with other basic common properties such as a name,. etc... This allows optimization/refinement algorithms to access the parameters without knowing what the object really is.
Definition at line 752 of file RefinableObj.h.
ObjCryst::RefinableObj::RefinableObj | ( | const bool | internalUseOnly | ) |
Constructor.
Using internalUseOnly=true will avoid registering the the object to any registry, and thus (for example) no display will be created, nor will this object be automatically be saved.
Definition at line 1188 of file RefinableObj.cpp.
ObjCryst::RefinableObj::RefinableObj | ( | const RefinableObj & | old | ) |
Defined not implemented...
Should never be called (copying the refinable parameters would allow you to modify the input object). Use the default constructor and RefinableObj::AddPar(RefinableObj&) instead.
Definition at line 1203 of file RefinableObj.cpp.
|
protected |
Add an option for this parameter
Definition at line 1973 of file RefinableObj.cpp.
void ObjCryst::RefinableObj::AddPar | ( | const RefinablePar & | newRefPar | ) |
Add a refinable parameter.
The parameter is copied, so it need only be allocated temporarily.
Definition at line 1416 of file RefinableObj.cpp.
void ObjCryst::RefinableObj::AddPar | ( | RefinablePar * | newRefPar | ) |
Add a refinable parameter.
The parameter is not copied, so it should be allocated in the heap.
Definition at line 1434 of file RefinableObj.cpp.
void ObjCryst::RefinableObj::AddPar | ( | RefinableObj & | newRefParList, |
const bool | copyParam = false |
||
) |
Add all the parameters in another RefinableObj.
Parameters are copied, so they should be allocated in the heap.
copyParam | if false (default), then parameters are not copied from the object but just referenced. Use RefinableObj::SetDeleteRefParInDestructor(false) accordingly. If true, then the parameters are copied, so that any modification to the fixed/limited/used attributes do not affect the original parameter. Only the value and the parameter's clock can then be modified by the copied parameter |
Definition at line 1451 of file RefinableObj.cpp.
void ObjCryst::RefinableObj::AddRestraint | ( | Restraint * | pNewRestraint | ) |
Add a new restraint.
This returns an iterator pointing to the next Restraint in the vector.
Definition at line 1889 of file RefinableObj.cpp.
|
protected |
Add an object in the registry of used objects.
Definition at line 1959 of file RefinableObj.cpp.
void ObjCryst::RefinableObj::BeginGlobalOptRandomMove | ( | ) |
Raise a flag, to be sure not to make a random change more than once in each RefinableObj.
This calls recursively all sub-objects.
This is necessary since one object may be included in several others. This must be called before making a random configuration change on a list of objects.
Definition at line 1750 of file RefinableObj.cpp.
|
virtual |
This should be called by any optimization class at the begining of an optimization.
This will also check that everything is ready, eg call the RefinableObj::Prepare() function. This also affects all sub-objects.
allowApproximations | if true, then the object can use faster but less precise functions during the optimization. This is useful for global optimization not using derivatives. |
enableRestraints | xrefitem deprecated 28. |
Reimplemented in ObjCryst::PowderPattern, ObjCryst::Molecule, ObjCryst::ScatteringData, ObjCryst::Crystal, ObjCryst::PowderPatternDiffraction, ObjCryst::CellExplorer, ObjCryst::TextureEllipsoid, ObjCryst::PowderPatternBackground, and ObjCryst::TextureMarchDollase.
Definition at line 1661 of file RefinableObj.cpp.
unsigned long ObjCryst::RefinableObj::CreateParamSet | ( | const string | name = "" | ) | const |
Save the current set of refined values in a new set.
name | : the name associated to this set of values. Names should be unique. |
Definition at line 1503 of file RefinableObj.cpp.
|
virtual |
This should be called by any optimization class at the end of an optimization.
This also affects all sub-objects.
Reimplemented in ObjCryst::Molecule, ObjCryst::ScatteringData, ObjCryst::PowderPatternDiffraction, and ObjCryst::ZScatterer.
Definition at line 1682 of file RefinableObj.cpp.
const void ObjCryst::RefinableObj::EraseAllParamSet | ( | ) |
Erase all saved refpar sets.
Definition at line 1572 of file RefinableObj.cpp.
|
virtual |
Name for this class ("RefinableObj", "Crystal",...).
This is only useful to distinguish different classes when picking up objects from the RefinableObj Global Registry
Reimplemented in ObjCryst::Molecule, ObjCryst::PowderPattern, ObjCryst::ScatteringPowerAtom, ObjCryst::PowderPatternDiffraction, ObjCryst::ReflectionProfileDoubleExponentialPseudoVoigt, ObjCryst::CellExplorer, ObjCryst::TextureEllipsoid, ObjCryst::ZScatterer, ObjCryst::Radiation, ObjCryst::PowderPatternBackground, ObjCryst::ReflectionProfilePseudoVoigtAnisotropic, ObjCryst::TextureMarchDollase, ObjCryst::Scatterer, ObjCryst::Crystal, ObjCryst::ScatteringPower, ObjCryst::ReflectionProfilePseudoVoigt, ObjCryst::UnitCell, ObjCryst::Atom, ObjCryst::DiffractionDataSingleCrystal, ObjCryst::ScatteringPowerSphere, ObjCryst::PowderPatternComponent, and ObjCryst::PowderPatternBackgroundBayesianMinimiser.
Definition at line 1243 of file RefinableObj.cpp.
|
virtual |
Get the gene group assigned to each parameter.
Each parameter (a gene in terms of genetic algorithms) can be assigned to a gene group. Thus when mating two configurations, genes will be exchanged by groups. By default (in the base RefinabeObj class), each parameter is alone in its group. Derived classes can group genes for a better s** life.
The number identifying a gene group only has a meaning in a given object. It can also change on subsequent calls, and thus is not unique.
obj | the , supplied by an algorithm class (OptimizationObj,..), which contains a list of parameters, some of which (but possibly all or none) are parameters belonging to this object. |
groupIndex | a vector of unsigned integers, one for each parameter in the input object, giving an unsigned integer value as gene group index. At the beginning this vector should contain only zeros (no group assigned). |
firstGroup | this is the number of groups which have already been assigned, plus one. The gene groups returned by this object will start from this value, and increment firstGroup for each gene group used, so that different RefinableObj cannot share a gene group. |
Reimplemented in ObjCryst::PowderPattern, ObjCryst::Crystal, ObjCryst::PowderPatternDiffraction, ObjCryst::ZScatterer, ObjCryst::ScatteringPower, ObjCryst::PowderPatternBackground, and ObjCryst::Atom.
Definition at line 1867 of file RefinableObj.cpp.
|
virtual |
Get -log(likelihood) of the current configuration for the object.
By default (no likelihood evaluation available), this is equal to 0.
This call should not be recursive, it is the task of the algorithm to get the sum of likelihoods for all objects invlolved.
Reimplemented in ObjCryst::PowderPattern, ObjCryst::Molecule, ObjCryst::Crystal, ObjCryst::DiffractionDataSingleCrystal, ObjCryst::ZMoveMinimizer, and ObjCryst::PowderPatternBackgroundBayesianMinimiser.
Definition at line 1759 of file RefinableObj.cpp.
|
virtual |
Get the first derivative for the LSQ function for each parameter supplied in a list.
Reimplemented in ObjCryst::PowderPattern, and ObjCryst::DiffractionDataSingleCrystal.
Definition at line 1819 of file RefinableObj.cpp.
|
virtual |
Get the first derivative values for the LSQ function, for a given parameter.
Note that the default method in the base RefinableObj class is to use numerical derivatives, so it should be overridden for better precision.
Reimplemented in ObjCryst::Molecule, and ObjCryst::CellExplorer.
Definition at line 1806 of file RefinableObj.cpp.
long ObjCryst::RefinableObj::GetNbPar | ( | ) | const |
Total number of refinable parameter in the object.
Note that some may be actually fixed or even not used !! For refinement use PrepareForRefinement(), NbRefParNotFixed(), and ParNotFixed(i)
Definition at line 1348 of file RefinableObj.cpp.
const CrystVector_REAL & ObjCryst::RefinableObj::GetParamSet | ( | const unsigned long | setId | ) | const |
Access one save refpar set.
setId | : the number identifying the set. |
Definition at line 1550 of file RefinableObj.cpp.
CrystVector_REAL & ObjCryst::RefinableObj::GetParamSet | ( | const unsigned long | setId | ) |
Access one save refpar set.
setId | : the number identifying the set. |
Definition at line 1557 of file RefinableObj.cpp.
REAL ObjCryst::RefinableObj::GetParamSet_ParNotFixedHumanValue | ( | const unsigned long | setId, |
const long | parNumber | ||
) | const |
Access the (human) value of one refined parameter in a saved set of parameters.
setId | : the number identifying the set. |
parNumber | : the number identifying the parameter in the list of refined parameters |
Definition at line 1564 of file RefinableObj.cpp.
const string & ObjCryst::RefinableObj::GetParamSetName | ( | const unsigned long | setId | ) | const |
Get the name associated to a refpar set.
setId | : the number identifying the set. |
Definition at line 1577 of file RefinableObj.cpp.
RefinablePar & ObjCryst::RefinableObj::GetParNotFixed | ( | const long | i | ) |
Access all parameters in the order they were inputted, skipping fixed parameters.
Must call PrepareForRefinement() before !
Definition at line 1406 of file RefinableObj.cpp.
const RefinablePar & ObjCryst::RefinableObj::GetParNotFixed | ( | const long | i | ) | const |
Access all parameters in the order they were inputed, skipping fixed parameters.
Must call PrepareForRefinement() before !
Definition at line 1411 of file RefinableObj.cpp.
const RefinableObjClock & ObjCryst::RefinableObj::GetRefParListClock | ( | ) | const |
What was the last time a RefinablePar was added/removed ?
Definition at line 1878 of file RefinableObj.cpp.
|
virtual |
Get the restraint cost (overall penalty of all restraints)
By default this returns 0, so this must be overloaded by any object which actually uses restraint.
Definition at line 1880 of file RefinableObj.cpp.
|
virtual |
Make a random move of the current configuration.
This is for global optimization algorithms. the moves for each parameter are less than their global optimization step, multiplied by the mutation amplitude.
mutationAmplitude | multiplier for the maximum move amplitude, for all parameters |
type | restrain the change exclusively to parameters of a given type (same type or descendant from this RefParType). |
Reimplemented in ObjCryst::PowderPattern, ObjCryst::Molecule, ObjCryst::Crystal, ObjCryst::ZScatterer, ObjCryst::DiffractionDataSingleCrystal, ObjCryst::TextureEllipsoid, and ObjCryst::TextureMarchDollase.
Definition at line 1734 of file RefinableObj.cpp.
void ObjCryst::RefinableObj::operator= | ( | const RefinableObj & | old | ) |
Defined not implemented...
Should never be called
|
protectedvirtual |
Prepare everything (if necessary) for an optimization/calculation.
Reimplemented in ObjCryst::PowderPattern, ObjCryst::PowderPatternDiffraction, ObjCryst::PowderPatternBackground, and ObjCryst::PowderPatternComponent.
Definition at line 1982 of file RefinableObj.cpp.
void ObjCryst::RefinableObj::PrepareForRefinement | ( | ) | const |
Find which parameters are used and not fixed, for a refinement /optimization.
This must be called before any refinement...
Definition at line 1273 of file RefinableObj.cpp.
|
virtual |
Randomize Configuration (before a global optimization).
This Affects only parameters which are limited and not fixed. The randomization also affects all sub-objects (recursive).
Reimplemented in ObjCryst::Molecule.
Definition at line 1709 of file RefinableObj.cpp.
|
virtual |
Register a new object using this object.
Definition at line 1648 of file RefinableObj.cpp.
vector< RefinablePar * >::iterator ObjCryst::RefinableObj::RemovePar | ( | RefinablePar * | refPar | ) |
Remove a refinable parameter.
This returns an iterator to the next parameter in the vector.
Definition at line 1463 of file RefinableObj.cpp.
Remove a restraint from the list of known restraints.
This does not delete the Restraint object.
Definition at line 1895 of file RefinableObj.cpp.
|
protected |
Remove an object in the registry of used objects.
Definition at line 1966 of file RefinableObj.cpp.
void ObjCryst::RefinableObj::ResetParList | ( | ) |
Re-init the list of refinable parameters, removing all parameters.
This does not delete the RefinablePar if RefinableObj::mDeleteRefParInDestructor is false
Definition at line 1829 of file RefinableObj.cpp.
void ObjCryst::RefinableObj::RestoreParamSet | ( | const unsigned long | id | ) |
Restore a saved set of values.
id | : the number identifying the set. |
Definition at line 1536 of file RefinableObj.cpp.
void ObjCryst::RefinableObj::SaveParamSet | ( | const unsigned long | id | ) | const |
Save the current set of refined values over a previously-created set of saved values.
id | the number identifying the set of saved values. |
Definition at line 1527 of file RefinableObj.cpp.
|
virtual |
Enable or disable numerical approximations.
This can be used for global optimization to get faster calculations. Depending on the type of object, this may do something or not (it does not do anything in a base RefinableObj, except calling this function for all sub-objects).
Also see:
Reimplemented in ObjCryst::ScatteringData, and ObjCryst::PowderPatternDiffraction.
Definition at line 1703 of file RefinableObj.cpp.
void ObjCryst::RefinableObj::SetDeleteRefParInDestructor | ( | const bool | b | ) |
Set this object not to delete its list of parameters when destroyed.
This is used for the RefinableObj in algorithms objects (OptimizationObj), which only hold copies of parameters from the refined objects.
Definition at line 1876 of file RefinableObj.cpp.
void ObjCryst::RefinableObj::SetLimitsProportional | ( | const string & | parName, |
const REAL | min, | ||
const REAL | max | ||
) |
Change the limits for a given parameter, proportionnaly to the current value.
min should be < 1. and max > 1.
Definition at line 1618 of file RefinableObj.cpp.
void ObjCryst::RefinableObj::SetLimitsProportional | ( | const RefParType * | type, |
const REAL | min, | ||
const REAL | max | ||
) |
Change the limits for a category of parameters, proportionnaly to their current value.
min should be < 1. and max > 1.
Definition at line 1624 of file RefinableObj.cpp.
void ObjCryst::RefinableObj::SetLimitsRelative | ( | const string & | parName, |
const REAL | min, | ||
const REAL | max | ||
) |
Change the limits for a given parameter, 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.
Definition at line 1599 of file RefinableObj.cpp.
void ObjCryst::RefinableObj::SetLimitsRelative | ( | const RefParType * | type, |
const REAL | min, | ||
const REAL | max | ||
) |
Change the limits for a category of parameters, 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.
Definition at line 1605 of file RefinableObj.cpp.
|
virtual |
During a global optimization, tells the object that the current config is the latest "best" config.
This can be used by the object to make more intellingent random moves (use with caution: highly experimental !).
Reimplemented in ObjCryst::Molecule, ObjCryst::PowderPatternBackground, and ObjCryst::TextureMarchDollase.
Definition at line 1911 of file RefinableObj.cpp.
|
virtual |
If there is an interface, this should be automatically be called each time there is a 'new, significant' configuration to report.
Reimplemented in ObjCryst::Molecule.
Definition at line 1917 of file RefinableObj.cpp.
|
virtual |
Input From stream.
Reimplemented in ObjCryst::PowderPattern, ObjCryst::Molecule, ObjCryst::ScatteringPowerAtom, ObjCryst::PowderPatternDiffraction, ObjCryst::Crystal, ObjCryst::ZScatterer, ObjCryst::ReflectionProfileDoubleExponentialPseudoVoigt, ObjCryst::DiffractionDataSingleCrystal, ObjCryst::Radiation, ObjCryst::TextureEllipsoid, ObjCryst::PowderPatternBackground, ObjCryst::ReflectionProfilePseudoVoigtAnisotropic, ObjCryst::TextureMarchDollase, ObjCryst::Atom, ObjCryst::ReflectionProfilePseudoVoigt, ObjCryst::ReflectionProfile, and ObjCryst::ScatteringPowerSphere.
Definition at line 341 of file RefinableObj/IO.cpp.
|
virtual |
Output to stream in well-formed XML.
Reimplemented in ObjCryst::PowderPattern, ObjCryst::Molecule, ObjCryst::ScatteringPowerAtom, ObjCryst::PowderPatternDiffraction, ObjCryst::Crystal, ObjCryst::ZScatterer, ObjCryst::ReflectionProfileDoubleExponentialPseudoVoigt, ObjCryst::DiffractionDataSingleCrystal, ObjCryst::Radiation, ObjCryst::TextureEllipsoid, ObjCryst::PowderPatternBackground, ObjCryst::ReflectionProfilePseudoVoigtAnisotropic, ObjCryst::TextureMarchDollase, ObjCryst::Atom, ObjCryst::ReflectionProfilePseudoVoigt, ObjCryst::ReflectionProfile, and ObjCryst::ScatteringPowerSphere.
Definition at line 336 of file RefinableObj/IO.cpp.
|
mutableprotected |
Registry of RefinableObject using this object.
This is mutable so that client can modify it (kludge?)
Definition at line 1258 of file RefinableObj.h.
|
protected |
Master clock, which is changed whenever the object has been altered.
It should be parent to all clocks recording changes in derived classes.
Definition at line 1291 of file RefinableObj.h.
|
protected |
If true (the default), then all RefinablePar will be deleted when the the object is deleted.
The opposite option (false) should only be used in RefinableObj holding 'copies' of other objects, such as in algorithms.
Definition at line 1268 of file RefinableObj.h.
|
mutableprotected |
Temporary map to return the derivative of the LSQ function versus a list of parameters.
Several LSQ functions can be stored.
Definition at line 1282 of file RefinableObj.h.
|
mutableprotected |
Temporary array used to return derivative values of the LSQ function for given parameters.
Definition at line 1276 of file RefinableObj.h.
|
protected |
Is the object being refined or optimized ? if mOptimizationDepth=0, no optimization is taking place.
mOptimizationDepth>0 indicates the object is being optimized. Values larger than 1 indicate that several level of optimizations are taking place, e.g. one least-square optimization during a global optimization, etc...
Definition at line 1252 of file RefinableObj.h.
|
protected |
List of options for this object.
Note that these are just references, to options allocated by the object, to have a simple global access to all options
Definition at line 1264 of file RefinableObj.h.
|
protected |
This true is false if RefinableObj::GlobalOptRandomMove() has been called since RefinableObj::BeginGlobalOptRandomMove() was called.
Definition at line 1273 of file RefinableObj.h.
|
protected |
Vector of pointers to the restraints for this object.
This excludes all RefinablePar declared in RefinableObj::mpRefPar, which also are Restraint.
Definition at line 1232 of file RefinableObj.h.
|
mutableprotected |
Map of (index,pointers to arrays) used to save sets of values for all parameters.
Currently there is no limit to the number of saved sets.
This is mutable since creating/storing a param set does not affect the 'real' part of the object.
Definition at line 1240 of file RefinableObj.h.