Class
NumCosmoMathModel
Description [src]
abstract class NumCosmoMath.Model : GObject.Object
{
/* No available fields */
}
Abstract class for implementing models.
The NcmModel abstract class represents a general model. This object serves for two
general objectives. First, all the numerical properties (doubles), i.e., parameters,
are implemented by the class functions described below, this allows the
implementation of a general statistical analyses based on these models. Second, each
child of NcmModel can register itself as a model type. This allows multiples models
types to be used simultaneously.
Functions
ncm_model_clear
Atomically decrements the reference count of model by one. If the reference count drops to 0,
all memory allocated by model is released. Set pointer to NULL.
ncm_model_id_by_type
Gets the model id of a model type. It is an error to call this function
with a type that is not a subclass of NcmModel.
ncm_model_type_main_model
If model_type is a submodel returns the NcmModelID of its
main model, otherwise returns -1.
Instance methods
ncm_model_check_impl_opts
Checks if the model implements all the opt1, opt2, … options.
The last argument must be -1.
ncm_model_free
Atomically decrements the reference count of model by one. If the reference count drops to 0,
all memory allocated by model is released.
ncm_model_is_equal
Compares if model1 and model2 are the same, with same dimension and reparametrization.
ncm_model_lstate_is_update
Check if the i-th lstate is updated.
The parameter i must be smaller than #NCM_MODEL_MAX_STATES.
ncm_model_main_model
If model is a submodel returns the NcmModelID of its
main model, otherwise returns -1.
ncm_model_orig_param_get
Gets the n-th original parameter of model using the original parametrization.
ncm_model_orig_param_index_from_name
Looks for parameter named param_name in the original parameters of model
and puts its index in i and returns TRUE if found.
ncm_model_orig_param_set
Sets the n-th original parameter of model using the original
parametrization to val.
ncm_model_orig_params_log_all
Logs all original parameters of model. That is if there is a reparametrization
set, it return the values of the original parameters.
ncm_model_orig_params_peek_vector
Peeks the original parameters vector. This functions is provided for reparametrization implementations and subclassing, do not use it in other contexts.
ncm_model_orig_params_update
Update the new parameters. It causes an error to call this function with a model without reparametrization.
ncm_model_orig_vparam_set_vector
Sets the n-th vector parameter of model to val.
The size of val must be equal to the length of the n-th vector parameter.
ncm_model_param_get_desc
Gets the description of the parameter param. The output is a GHashTable which
contains the following keys:
- “name”: the name of the parameter.
- “symbol”: the symbol of the parameter.
- “scale”: the scale of the parameter.
- “lower-bound”: the lower bound of the parameter.
- “upper-bound”: the upper bound of the parameter.
- “abstol”: the absolute tolerance of the parameter.
- “fit”: whether the parameter is a fitting parameter.
- “value”: the current value of the parameter.
ncm_model_param_index_from_name
Looks for parameter named param_name in model and puts its index in i
and returns TRUE if found.
ncm_model_param_set0
Sets the n-th parameter of model to val. This function does not
update the model after setting the parameter. It is provided when
multiple parameters are set at once the model is updated only once.
ncm_model_params_update() must be called after setting all parameters.
ncm_model_param_set_desc
Sets the description of the parameter param. The input is a GHashTable which
may contain the following keys:.
ncm_model_params_log_all
Logs all parameters of model. It prints the values of the parameters
in the current reparametrization.
ncm_model_params_set_all
Sets all parameters of model to the values passed as arguments.
The number of arguments must be equal to the number of parameters.
ncm_model_params_set_all_data
Sets all parameters of model to the values passed as arguments.
The size of the array must be equal to the number of parameters.
ncm_model_params_set_vector
Sets all parameters of model to the values of v.
The size of v must be equal to the number of parameters.
ncm_model_params_update
Force the parameters to the update its internal flags and update the original parameters if necessary.
ncm_model_set_vparam_len
Given a vector parameter index, sets the length of the n-th vector to len.
This function is provided for model implementations, do not use it in
other contexts. It will be removed in future versions.
ncm_model_vparam_array_len
Count the number of vector parameters of the model. Note that this function returns the number of vector parameters of the model, not the length of the vector parameters.
ncm_model_vparam_index
Given a vector parameter index and a component index, returns the index of the
i-th component of the n-th vector in the full parameter vector.
Signals
Signals inherited from GObject (1)
GObject::notify
The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.
Class structure
struct NumCosmoMathModelClass {
void (* get_property) (
GObject* object,
guint prop_id,
GValue* value,
GParamSpec* pspec
);
void (* set_property) (
GObject* object,
guint prop_id,
const GValue* value,
GParamSpec* pspec
);
gboolean (* valid) (
NcmModel* model
);
}
No description available.
Class members
get_property: void (* get_property) ( GObject* object, guint prop_id, GValue* value, GParamSpec* pspec )No description available.
set_property: void (* set_property) ( GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec )No description available.
valid: gboolean (* valid) ( NcmModel* model )No description available.
Class methods
ncm_model_class_add_impl_flag
Class function to be used when implementing NcmModels, it defines the implementation flags of the model.
ncm_model_class_add_impl_opts
Class function to be used when implementing NcmModels, it defines the implementation options of the model.
ncm_model_class_add_params
Class function to be used when implementing NcmModels, it defines the number of scalar and vector parameters and the number of properties of the model.
ncm_model_class_check_params_info
Class function to be used when implementing NcmModels, it checks if the parameters information is correctly set. It must be called after all parameters are set during the class initialization.
ncm_model_class_set_name_nick
Attributes name and nick, respectively, as the name and nickname of the model.
ncm_model_class_set_sparam
Helper function to set a scalar parameter. It creates a NcmSParam object
and calls ncm_model_class_set_sparam_obj().
ncm_model_class_set_vparam
Helper function to set a vector parameter. It creates a NcmVParam object
and calls ncm_model_class_set_vparam_obj().