-
…ients argument (#1847) The eval_gradients() methods duplicate much of the code of the eval() methods. To increase the maintainability of the code, the eval_gradients() methods have been removed, and the computation of partial derivatives is now done by the eval() methods if the optional gradients argument is set to true.
-
Fixes bug #1153.
-
The coding and design conventions (CDC) document was also updated.
-
Initially, there was a unlogic relation between GModels and GOptimizerPars, where GModels derives from GOptimizerPars, but both classes contained different types of objects. GModels is a model container, while GOptimizerPars is a parameter container. Now, GModels derives directly from GContainer and no longer from GOptimizerPars. The GModels::pars() method has been added to extract a flat array of model parameter pointers into a GOptimizerPars object. GOptimizerPars, which was abstract before, is now a real container class that also derives from GContainer.
-
The GFits class now derives from GContainer and implements all generic container class methods (at(), size(), isempty(), set(), append(), insert(), remove(), reserve(), extend()). The hashdu() method has been renamed to contains() for compliance with other container classes. The hdu() methods have been renamed to at(), also for compliance. Boolean arguments are now passed as const references, and members are returned as const references. HDU access operators[] have been implemented to access FITS extensions without range checking.
-
Add GChatter argument to print() method. The print() method now takes an argument of type GChatter to control the chattiness of the output in a homogenous manner. Pass NORMAL chatter level in __str__ method. Add chatter argument to print() methods. Use GLog::chatter() method to control the chattiness of the log stream operator. Add chatter() methods and provide member access through const references. Add chatter() methods, provide member access through const references, and declare one liners as inline methods. The chatter() methods control the new m_chatter attribute that is used to control the chattiness of the object's print() methods. name() and version() methods return const references. logFileOpen() method now sets the chattiness from the applications's chatter parameter, and name() and version() methods now return a const reference.
-
…d Doxygen documentation for class with examples. The index access operators [] have now be placed inline so that faster code can be generated (as the index operator does not index checking it is now pretty short code). The hasmodel() methods should semantically be named contains() (in general, a container should always have the contains() method to check for names). The Doxygen documentation of the class has been enhanced, adding usage example to the general description.
-
The set(), append(), insert(), and extend() methods now verify that the added models have unique names, i.e. that the name of a model that is added does not exist already in the model container. In that way, all models in a model container *should* have unique names. Note, however, that a client can still violate this rule by retrieving a pointer to a model and by changing the name of the model explicitly.
-
The at() methods provide model access by index with index validity checking. The hasmodel() method checks whether a model with a given name exists in the container.
-
A special treatment was added for insertion of elements in empty objects. This was not possible before because any index was outside the valid range for an empty object. The number of elements is now set before appending a container to a container, so that self-extension does not lead to an endless loop. Before, if a container was self-extended, the size parameter grew with the extension, leading to a situation where the loop never ended.
-
Checks for pointer validity are not needed, as pointers should be always valid by construction.
-
This reverts commit 813252eb589e317fd139d0cdde4f20bdd7959ef2.
-
This reverts commit 813252eb589e317fd139d0cdde4f20bdd7959ef2.
-
The GModels model access operator[] now returns a reference instead of a pointer. This needed a couple of minor adjustments of the code.
-
The container class method name pop() was changed to remove() to be complatible with the Python syntax for lists.
-
GModels derives from GOptimizerPars, which is now a container class. GModels needs therefore to implement all container class methods. Methods have been added to insert and remove models, and to extend the model container by another model container.
-
In principle, the model clone method may return a NULL pointer. We thus check if the deep copy was successul before we append it to the model container.
-
All classes now derive from GBase. ostream and GLog friends are removed since they are now implement at the GBase level.
-
Following the coding & design standard, the GModel argument in the set() method is now passed by reference. This removes the possibility of setting a model pointer to NULL. Thus, by construction, the container should never hold any NULL pointer.
-
The set method now takes a pointer instead of a reference. This allows assignment of a NULL pointer to the list of pointers in the container.
-
The GModel access operator now returns a simple GModel pointer, hence it cannot be used as an lvalue anymore. This is required to proteced the class from code slicing or memory leaks. Setting of GModel elements is now achieved by the set methods. Two variants have been implemented, one taking an index, the other taking a model name.
-
The GModel access operator returns now a reference to a pointer instead of a reference. This allows proper assignment in C++ using constructs such as m[0] = &model;. Also in Python assignment is now possible. For the Python interface we selected to make a deep copy to get a behavior that is compliant with Python list access.
-
…td::vector<GModelPar*> instead of GModelPar**
-
…val() and eval_gradients() const