-
… of GModelSpectralNodes and GModelSpectralFunc
-
…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.
-
…eval_gradients() methods.
-
A segmentation fault occured in GModelSpectralNodes::update_flux_cache when no nodes are present. The reason is that m_energies.size() returns an unsigned integer, and m_energies.size()-1 is not -1 for no nodes but 18446744073709551615, hence the loop was entered despite the fact that no nodes existed. No, m_energies.size() is converted to int first, and then nodes-1 should give indeed -1 if nodes=0.
-
The coding and design conventions (CDC) document was also updated.
-
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.
-
The update_pars() now also sets energy and intensity names so that each parameter has a distinct name. The names are constructed by "Energy" and "Intensity" with the index appended (starting from 0). This means, the first energy is "Energy0", the second is "Energy1", and so on.
-
We now copy over the members directly instead of using the operator[] for access, as the later led to a segmentation fault.
-
A set of methods have been added for node manipulation, such as retrieval of node energy and intensity, but also appending, inserting and removing of nodes or extending the node function.
-
The eval_gradients() method is no longer const to reflect the fact that the method explicitly sets the gradient attribute of the model parameters.
-
The GModelPar interface has been revisited and the code has been adapted to satisfy the new interface.
-
Due to a copy-paste error, the global for the registry was identical to the global for the FileFunction. It is surprising that this did not produce an error. This has now been corrected. Proper global variables were introduced for the NodeFunction.