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.

Ancestors

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_is_submodel

Tests if model_type is a submodel of other model class.

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___getitem__

Gets the parameter by name.

ncm_model___setitem__

Sets the parameter by name.

ncm_model_add_submodel

Adds the submodel to the model submodels.

ncm_model_check_impl_flag

Checks if the model implements the impl flag.

ncm_model_check_impl_opt

Checks if the model implements the opt option.

ncm_model_check_impl_opts

Checks if the model implements all the opt1, opt2, … options. The last argument must be -1.

ncm_model_dup

Duplicates model by serializing and deserializing it.

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_get_submodel_len

Gets the number of submodels set in model.

ncm_model_id

Gets the model id of model.

ncm_model_is_equal

Compares if model1 and model2 are the same, with same dimension and reparametrization.

ncm_model_is_submodel

Tests if model is a submodel of other model class.

ncm_model_len

Count the total number of parameters of the model.

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_lstate_set_update

Sets the i-th lstate as 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_name

Get the name of the model.

ncm_model_nick

Get the nick of the model.

ncm_model_orig_param_get

Gets the n-th original parameter of model using the original parametrization.

ncm_model_orig_param_get_abstol

Gets the absolute tolerance of the original n-th parameter.

ncm_model_orig_param_get_by_name

Gets the original parameter value by param_name.

ncm_model_orig_param_get_lower_bound

Gets the lower bound of the original n-th parameter.

ncm_model_orig_param_get_scale

Gets the scale of the original n-th parameter.

ncm_model_orig_param_get_upper_bound

Gets the upper bound of the original n-th parameter.

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_name
No description available.

ncm_model_orig_param_set

Sets the n-th original parameter of model using the original parametrization to val.

ncm_model_orig_param_set_by_name

Sets the parameter value val by param_name.

ncm_model_orig_param_symbol
No description available.

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_get
No description available.

ncm_model_orig_vparam_get_vector

Gets the n-th vector parameter of model.

ncm_model_orig_vparam_set
No description available.

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_finite

Check if the i-th parameter is finite.

ncm_model_param_get

Gets the n-th parameter of model.

ncm_model_param_get_abstol

Gets the absolute tolerance of the n-th parameter.

ncm_model_param_get_by_name

Gets the parameter value by param_name.

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_get_ftype

Gets the fitting type of the n-th parameter.

ncm_model_param_get_lower_bound

Gets the lower bound of the n-th parameter.

ncm_model_param_get_scale

Gets the scale of the n-th parameter.

ncm_model_param_get_upper_bound

Gets the upper bound of the n-th 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_name
No description available.

ncm_model_param_names

Gets an array containing the parameters names.

ncm_model_param_set

Sets the n-th parameter of model to val.

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_abstol

Sets abstol as the absolute tolerance of the n-th parameter.

ncm_model_param_set_by_name

Sets the parameter value val by param_name.

ncm_model_param_set_default

Sets the n-th parameter of model to its default value.

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_param_set_ftype

Sets ptype as NcmParamType of the n-th parameter.

ncm_model_param_set_lower_bound

Sets lb as the lower-bound value of the n-th parameter.

ncm_model_param_set_scale

Sets scale as the scale of the n-th parameter.

ncm_model_param_set_upper_bound

Sets ub as the lower-bound value of the n-th parameter.

ncm_model_param_symbol
No description available.

ncm_model_params_copyto

Copies the parameters of model to model_dest.

ncm_model_params_finite

Check if all parameters are finite.

ncm_model_params_get_all

Creates a NcmVector with all parameters of model.

ncm_model_params_log_all

Logs all parameters of model. It prints the values of the parameters in the current reparametrization.

ncm_model_params_print_all

Prints all parameters of model to out.

ncm_model_params_save_as_default

Saves the current parameters as the default values.

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_default

Sets the models parameters to their default values.

ncm_model_params_set_default_ftype

Sets all parameters NcmParamType to their default values.

ncm_model_params_set_model

Sets all parameters of model to the values of model_src.

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_params_valid

Check whenever the parameters are valid.

ncm_model_params_valid_bounds

Check whenever the parameters respect the bounds.

ncm_model_peek_reparam

Peeks the current reparametrization of model.

ncm_model_peek_submodel

Gets the i-th submodel.

ncm_model_peek_submodel_by_mid

Gets the submodel if type NcmModelID mid.

ncm_model_peek_submodel_pos_by_mid

Gets the submodel type NcmModelID mid position.

ncm_model_ref

Increments the reference count of model by one.

ncm_model_set_reparam

Sets the reparametrization of model to reparam.

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_sparam_len

Count the number of scalar parameters of the model.

ncm_model_state_get_pkey

Get the current pkey of the model.

ncm_model_state_is_update

Check if the model is updated.

ncm_model_state_mark_outdated

Set the model as outdated.

ncm_model_state_set_update

Set the model as updated.

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.

ncm_model_vparam_len

Given a vector parameter index, returns the length of the n-th vector.

Methods inherited from GObject (43)

Please see GObject for a full list of methods.

Properties

NumCosmoMath.Model:implementation
No description available.

NumCosmoMath.Model:name
No description available.

NumCosmoMath.Model:nick
No description available.

NumCosmoMath.Model:params-types
No description available.

NumCosmoMath.Model:reparam
No description available.

NumCosmoMath.Model:scalar-params-len
No description available.

NumCosmoMath.Model:sparam-array
No description available.

NumCosmoMath.Model:submodel-array
No description available.

NumCosmoMath.Model:vector-params-len
No description available.

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.

Virtual methods

NumCosmoMath.ModelClass.add_submodel

Adds the submodel to the model submodels.

NumCosmoMath.ModelClass.valid
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_sparam_obj

Sets the sparam as the sparam_id-th scalar parameter of the model.

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().

ncm_model_class_set_vparam_obj

Sets the vparam as the vparam_id-th vector parameter of the model.