NcmModel

NcmModel — Abstract class for implementing models.

Functions

void (*NcmModelAddSubmodel) ()
gdouble (*NcmModelFunc0) ()
gdouble (*NcmModelFunc1) ()
gdouble (*NcmModelFunc2) ()
gdouble (*NcmModelVFunc0) ()
gdouble (*NcmModelVFunc1) ()
gdouble (*NcmModelVFunc2) ()
void ncm_model_class_add_params ()
void ncm_model_class_set_name_nick ()
void ncm_model_class_set_sparam_obj ()
void ncm_model_class_set_vparam_obj ()
void ncm_model_class_set_sparam ()
void ncm_model_class_set_vparam ()
void ncm_model_class_check_params_info ()
void ncm_model_class_add_impl_opts ()
void ncm_model_class_add_impl_flag ()
NcmModel * ncm_model_dup ()
NcmModel * ncm_model_ref ()
void ncm_model_free ()
void ncm_model_clear ()
void ncm_model_set_reparam ()
gboolean ncm_model_is_equal ()
NcmModelID ncm_model_id ()
NcmModelID ncm_model_id_by_type ()
gboolean ncm_model_check_impl_flag ()
gboolean ncm_model_check_impl_opt ()
gboolean ncm_model_check_impl_opts ()
guint ncm_model_len ()
gboolean ncm_model_state_is_update ()
void ncm_model_state_set_update ()
gboolean ncm_model_lstate_is_update ()
void ncm_model_lstate_set_update ()
void ncm_model_state_mark_outdated ()
guint64 ncm_model_state_get_pkey ()
guint ncm_model_sparam_len ()
guint ncm_model_vparam_array_len ()
void ncm_model_set_vparam_len ()
guint ncm_model_vparam_index ()
guint ncm_model_vparam_len ()
const gchar * ncm_model_name ()
const gchar * ncm_model_nick ()
NcmReparam * ncm_model_peek_reparam ()
gboolean ncm_model_params_finite ()
gboolean ncm_model_param_finite ()
void ncm_model_params_update ()
void ncm_model_orig_params_update ()
NcmVector * ncm_model_orig_params_peek_vector ()
void ncm_model_orig_params_log_all ()
void ncm_model_param_set ()
void ncm_model_param_set0 ()
void ncm_model_param_set_default ()
void ncm_model_orig_param_set ()
void ncm_model_orig_vparam_set ()
void ncm_model_orig_vparam_set_vector ()
gdouble ncm_model_param_get ()
gdouble ncm_model_orig_param_get ()
gdouble ncm_model_orig_vparam_get ()
NcmVector * ncm_model_orig_vparam_get_vector ()
void ncm_model_params_copyto ()
void ncm_model_params_set_default ()
void ncm_model_params_save_as_default ()
void ncm_model_params_set_all ()
void ncm_model_params_set_all_data ()
void ncm_model_params_set_vector ()
void ncm_model_params_set_model ()
void ncm_model_params_print_all ()
void ncm_model_params_log_all ()
NcmVector * ncm_model_params_get_all ()
gboolean ncm_model_params_valid ()
gboolean ncm_model_params_valid_bounds ()
gboolean ncm_model_orig_param_index_from_name ()
gboolean ncm_model_param_index_from_name ()
const gchar * ncm_model_orig_param_name ()
const gchar * ncm_model_param_name ()
const gchar * ncm_model_orig_param_symbol ()
const gchar * ncm_model_param_symbol ()
GPtrArray * ncm_model_param_names ()
void ncm_model_param_set_by_name ()
void ncm_model_orig_param_set_by_name ()
gdouble ncm_model_param_get_by_name ()
gdouble ncm_model_orig_param_get_by_name ()
gdouble ncm_model_orig_param_get_scale ()
gdouble ncm_model_orig_param_get_lower_bound ()
gdouble ncm_model_orig_param_get_upper_bound ()
gdouble ncm_model_orig_param_get_abstol ()
gdouble ncm_model_param_get_scale ()
gdouble ncm_model_param_get_lower_bound ()
gdouble ncm_model_param_get_upper_bound ()
gdouble ncm_model_param_get_abstol ()
NcmParamType ncm_model_param_get_ftype ()
void ncm_model_param_set_scale ()
void ncm_model_param_set_lower_bound ()
void ncm_model_param_set_upper_bound ()
void ncm_model_param_set_abstol ()
void ncm_model_param_set_ftype ()
void ncm_model_params_set_default_ftype ()
gboolean ncm_model_is_submodel ()
NcmModelID ncm_model_main_model ()
void ncm_model_add_submodel ()
guint ncm_model_get_submodel_len ()
NcmModel * ncm_model_peek_submodel ()
NcmModel * ncm_model_peek_submodel_by_mid ()
gint ncm_model_peek_submodel_pos_by_mid ()
gboolean ncm_model_type_is_submodel ()
NcmModelID ncm_model_type_main_model ()
gdouble ncm_model___getitem__ ()
void ncm_model___setitem__ ()
#define NCM_MODEL_OPT2IMPL()
#define NCM_MODEL_2OPT2IMPL()
#define NCM_MODEL_3OPT2IMPL()
#define NCM_MODEL_4OPT2IMPL()
#define NCM_MODEL_SET_IMPL_FUNC()
#define NCM_MODEL_FUNC0_IMPL()
#define NCM_MODEL_FUNC1_IMPL()
#define NCM_MODEL_FUNC2_IMPL()
#define NCM_MODEL_VFUNC0_IMPL()
#define NCM_MODEL_VFUNC1_IMPL()
#define NCM_MODEL_VFUNC2_IMPL()

Properties

guint64 implementation Read
char * name Read
char * nick Read
GArray * params-types Read
NcmReparam * reparam Read / Write
guint scalar-params-len Read
NcmObjDictInt * sparam-array Read / Write
NcmObjArray * submodel-array Read / Write
guint vector-params-len Read

Types and Values

Object Hierarchy

    GObject
    ╰── NcmModel
        ├── NcClusterMass
        ├── NcClusterRedshift
        ├── NcClusterPseudoCounts
        ├── NcHaloDensityProfile
        ├── NcHICosmo
        ├── NcHICosmoQSplineContPrior
        ├── NcHIPrim
        ├── NcHIReion
        ├── NcPlanckFI
        ├── NcReducedShearCalib
        ├── NcReducedShearClusterMass
        ├── NcSNIADistCov
        ├── NcWLSurfaceMassDensity
        ├── NcXcorLimberKernel
        ├── NcmModelFunnel
        ├── NcmModelMVND
        ╰── NcmModelRosenbrock

Description

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

NcmModelAddSubmodel ()

void
(*NcmModelAddSubmodel) (NcmModel *model,
                        NcmModel *submodel);

NcmModelFunc0 ()

gdouble
(*NcmModelFunc0) (NcmModel *model);

NcmModelFunc1 ()

gdouble
(*NcmModelFunc1) (NcmModel *model,
                  const gdouble x);

NcmModelFunc2 ()

gdouble
(*NcmModelFunc2) (NcmModel *model,
                  const gdouble x,
                  const gdouble y);

NcmModelVFunc0 ()

gdouble
(*NcmModelVFunc0) (NcmModel *model,
                   const guint n);

NcmModelVFunc1 ()

gdouble
(*NcmModelVFunc1) (NcmModel *model,
                   const guint n,
                   const gdouble x);

NcmModelVFunc2 ()

gdouble
(*NcmModelVFunc2) (NcmModel *model,
                   const guint n,
                   const gdouble x,
                   const gdouble y);

ncm_model_class_add_params ()

void
ncm_model_class_add_params (NcmModelClass *model_class,
                            guint sparam_len,
                            guint vparam_len,
                            guint nonparam_prop_len);

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.

Parameters

model_class

a NcmModelClass

 

sparam_len

number of scalar paramters

 

vparam_len

number of vector parameters

 

nonparam_prop_len

number of properties

 

ncm_model_class_set_name_nick ()

void
ncm_model_class_set_name_nick (NcmModelClass *model_class,
                               const gchar *name,
                               const gchar *nick);

Attributes name and nick , respectively, as the name and nickname of the model.

Parameters

model_class

a NcmModelClass

 

name

name and/or very short description of the model

 

nick

model nickname

 

ncm_model_class_set_sparam_obj ()

void
ncm_model_class_set_sparam_obj (NcmModelClass *model_class,
                                guint sparam_id,
                                NcmSParam *sparam);

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

Parameters

model_class

a NcmModelClass

 

sparam_id

id of the scalar parameter

 

sparam

a NcmSParam

 

ncm_model_class_set_vparam_obj ()

void
ncm_model_class_set_vparam_obj (NcmModelClass *model_class,
                                guint vparam_id,
                                NcmVParam *vparam);

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

Parameters

model_class

a NcmModelClass

 

vparam_id

id of the vector parameter

 

vparam

a NcmVParam

 

ncm_model_class_set_sparam ()

void
ncm_model_class_set_sparam (NcmModelClass *model_class,
                            guint sparam_id,
                            const gchar *symbol,
                            const gchar *name,
                            gdouble lower_bound,
                            gdouble upper_bound,
                            gdouble scale,
                            gdouble abstol,
                            gdouble default_value,
                            NcmParamType ppt);

Helper function to set a scalar parameter. It creates a NcmSParam object and calls ncm_model_class_set_sparam_obj().

Parameters

model_class

a NcmModelClass

 

sparam_id

id of the scalar parameter

 

symbol

symbol of the scalar parameter

 

name

name of the sacalar parameter

 

lower_bound

lower-bound value

 

upper_bound

upper-bound value

 

scale

parameter scale

 

abstol

parameter absolute tolerance

 

default_value

default value

 

ppt

a NcmParamType

 

ncm_model_class_set_vparam ()

void
ncm_model_class_set_vparam (NcmModelClass *model_class,
                            guint vparam_id,
                            guint default_length,
                            const gchar *symbol,
                            const gchar *name,
                            gdouble lower_bound,
                            gdouble upper_bound,
                            gdouble scale,
                            gdouble abstol,
                            gdouble default_value,
                            NcmParamType ppt);

Helper function to set a vector parameter. It creates a NcmVParam object and calls ncm_model_class_set_vparam_obj().

Parameters

model_class

a NcmModelClass

 

vparam_id

id of the vector parameter

 

default_length

default length of the vector parameter

 

symbol

symbol of the vector parameter

 

name

name of the vector parameter

 

lower_bound

parameter lower bound

 

upper_bound

parameter upper bound

 

scale

parameter scale

 

abstol

parameter absolute tolerance

 

default_value

default value

 

ppt

a NcmParamType

 

ncm_model_class_check_params_info ()

void
ncm_model_class_check_params_info (NcmModelClass *model_class);

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.

Parameters

model_class

a NcmModelClass

 

ncm_model_class_add_impl_opts ()

void
ncm_model_class_add_impl_opts (NcmModelClass *model_class,
                               gint opt1,
                               ...);

Class function to be used when implementing NcmModels, it defines the implementation options of the model.

[skip]

Parameters

model_class

a NcmModelClass

 

opt1

first option

 

...

other options, must end with -1

 

ncm_model_class_add_impl_flag ()

void
ncm_model_class_add_impl_flag (NcmModelClass *model_class,
                               guint64 flag);

Class function to be used when implementing NcmModels, it defines the implementation flags of the model.

[skip]

Parameters

model_class

a NcmModelClass

 

flag

implementation flag

 

ncm_model_dup ()

NcmModel *
ncm_model_dup (NcmModel *model,
               NcmSerialize *ser);

Duplicates model by serializing and deserializing it.

Parameters

model

a NcmModel

 

ser

a NcmSerialize

 

Returns

a duplicate of model .

[transfer full]


ncm_model_ref ()

NcmModel *
ncm_model_ref (NcmModel *model);

Increments the reference count of model by one.

Parameters

model

a NcmModel

 

Returns

the same model .

[transfer full]


ncm_model_free ()

void
ncm_model_free (NcmModel *model);

Atomically decrements the reference count of model by one. If the reference count drops to 0, all memory allocated by model is released.

Parameters

model

a NcmModel

 

ncm_model_clear ()

void
ncm_model_clear (NcmModel **model);

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.

Parameters

model

a NcmModel

 

ncm_model_set_reparam ()

void
ncm_model_set_reparam (NcmModel *model,
                       NcmReparam *reparam);

Sets the reparametrization of model to reparam .

Parameters

model

a NcmModel

 

reparam

a NcmReparam

 

ncm_model_is_equal ()

gboolean
ncm_model_is_equal (NcmModel *model1,
                    NcmModel *model2);

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

Parameters

model1

a NcmModel

 

model2

a NcmModel

 

ncm_model_id ()

NcmModelID
ncm_model_id (NcmModel *model);

Gets the model id of model .

Parameters

model

a NcmModel

 

Returns

The model id of model .


ncm_model_id_by_type ()

NcmModelID
ncm_model_id_by_type (GType model_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.

Parameters

model_type

a GType

 

Returns

The model id of model_type .


ncm_model_check_impl_flag ()

gboolean
ncm_model_check_impl_flag (NcmModel *model,
                           guint64 impl);

Checks if the model implements the impl flag.

Parameters

model

a NcmModel

 

impl

implementation flag

 

Returns

TRUE if the model implements the impl flag.


ncm_model_check_impl_opt ()

gboolean
ncm_model_check_impl_opt (NcmModel *model,
                          gint opt);

Checks if the model implements the opt option.

Parameters

model

a NcmModel

 

opt

implementation option

 

Returns

TRUE if the model implements the opt option.


ncm_model_check_impl_opts ()

gboolean
ncm_model_check_impl_opts (NcmModel *model,
                           gint opt1,
                           ...);

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

Parameters

model

a NcmModel

 

opt1

first implementation option

 

...

implementation options, must end with -1

 

Returns

TRUE if the model implements all the opt1 , opt2 , ... options.


ncm_model_len ()

guint
ncm_model_len (NcmModel *model);

Count the total number of parameters of the model.

Parameters

model

a NcmModel

 

Returns

the total number of parameters of the model.


ncm_model_state_is_update ()

gboolean
ncm_model_state_is_update (NcmModel *model);

Check if the model is updated.

Parameters

model

a NcmModel

 

Returns

TRUE if the model is updated.


ncm_model_state_set_update ()

void
ncm_model_state_set_update (NcmModel *model);

Set the model as updated.

Parameters

model

a NcmModel

 

ncm_model_lstate_is_update ()

gboolean
ncm_model_lstate_is_update (NcmModel *model,
                            guint i);

Check if the i -th lstate is updated. The parameter i must be smaller than NCM_MODEL_MAX_STATES.

Parameters

model

a NcmModel

 

i

lstate index

 

Returns

whether the i -th lstate is updated.


ncm_model_lstate_set_update ()

void
ncm_model_lstate_set_update (NcmModel *model,
                             guint i);

Sets the i -th lstate as updated. The parameter i must be smaller than NCM_MODEL_MAX_STATES.

Parameters

model

a NcmModel

 

i

lstate index

 

ncm_model_state_mark_outdated ()

void
ncm_model_state_mark_outdated (NcmModel *model);

Set the model as outdated.

Parameters

model

a NcmModel

 

ncm_model_state_get_pkey ()

guint64
ncm_model_state_get_pkey (NcmModel *model);

Get the current pkey of the model.

Parameters

model

a NcmModel

 

Returns

the current pkey of the model.


ncm_model_sparam_len ()

guint
ncm_model_sparam_len (NcmModel *model);

Count the number of scalar parameters of the model.

Parameters

model

a NcmModel

 

Returns

the number of scalar parameters of the model.


ncm_model_vparam_array_len ()

guint
ncm_model_vparam_array_len (NcmModel *model);

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.

Parameters

model

a NcmModel

 

Returns

the number of vector parameters of the model.


ncm_model_set_vparam_len ()

void
ncm_model_set_vparam_len (NcmModel *model,
                          guint n,
                          guint 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.

Parameters

model

a NcmModel

 

n

vector parameter index

 

len

vector length

 

ncm_model_vparam_index ()

guint
ncm_model_vparam_index (NcmModel *model,
                        guint n,
                        guint i);

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.

Parameters

model

a NcmModel

 

n

vector parameter index

 

i

vector component index

 

Returns

index of the i-th component of the n-th vector


ncm_model_vparam_len ()

guint
ncm_model_vparam_len (NcmModel *model,
                      guint n);

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

Parameters

model

a NcmModel

 

n

vector parameter index

 

Returns

length of the n-th vector


ncm_model_name ()

const gchar *
ncm_model_name (NcmModel *model);

Get the name of the model.

Parameters

model

a NcmModel

 

Returns

the name of the model.

[transfer none]


ncm_model_nick ()

const gchar *
ncm_model_nick (NcmModel *model);

Get the nick of the model.

Parameters

model

a NcmModel

 

Returns

the nick of the model.

[transfer none]


ncm_model_peek_reparam ()

NcmReparam *
ncm_model_peek_reparam (NcmModel *model);

Peeks the current reparametrization of model .

Parameters

model

a NcmModel

 

Returns

the current reparametrization of model or NULL if it does not have one.

[transfer none]


ncm_model_params_finite ()

gboolean
ncm_model_params_finite (NcmModel *model);

Check if all parameters are finite.

Parameters

model

a NcmModel

 

Returns

whether all parameters are finite.


ncm_model_param_finite ()

gboolean
ncm_model_param_finite (NcmModel *model,
                        guint i);

Check if the i -th parameter is finite.

Parameters

model

a NcmModel

 

i

parameter index

 

Returns

whether the i -th parameter is finite.


ncm_model_params_update ()

void
ncm_model_params_update (NcmModel *model);

Force the parameters to the update its internal flags and update the original parameters if necessary.

Parameters

model

a NcmModel

 

ncm_model_orig_params_update ()

void
ncm_model_orig_params_update (NcmModel *model);

Update the new parameters. It causes an error to call this function with a model without reparametrization.

Parameters

model

a NcmModel

 

ncm_model_orig_params_peek_vector ()

NcmVector *
ncm_model_orig_params_peek_vector (NcmModel *model);

Peeks the original parameters vector. This functions is provided for reparametrization implementations and subclassing, do not use it in other contexts.

The returned vector is the original parameters vector, that is, the parameters before the reparametrization. It is guaranteed that the returned vector is always the same and will stay valid until the model is destroyed. The vector also always have stride 1, so it is safe to call ncm_vector_fast_get().

Parameters

model

a NcmModel

 

Returns

the original parameters NcmVector.

[transfer none]


ncm_model_orig_params_log_all ()

void
ncm_model_orig_params_log_all (NcmModel *model);

Logs all original parameters of model . That is if there is a reparametrization set, it return the values of the original parameters.

Parameters

model

a NcmModel

 

ncm_model_param_set ()

void
ncm_model_param_set (NcmModel *model,
                     guint n,
                     gdouble val);

Sets the n -th parameter of model to val .

Parameters

model

a NcmModel

 

n

parameter index

 

val

a double

 

ncm_model_param_set0 ()

void
ncm_model_param_set0 (NcmModel *model,
                      guint n,
                      gdouble val);

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.

Parameters

model

a NcmModel

 

n

parameter index

 

val

a double

 

ncm_model_param_set_default ()

void
ncm_model_param_set_default (NcmModel *model,
                             guint n);

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

Parameters

model

a NcmModel

 

n

a parameter index

 

ncm_model_orig_param_set ()

void
ncm_model_orig_param_set (NcmModel *model,
                          guint n,
                          gdouble val);

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

Parameters

model

a NcmModel

 

n

a parameter index

 

val

a double

 

ncm_model_orig_vparam_set ()

void
ncm_model_orig_vparam_set (NcmModel *model,
                           guint n,
                           guint i,
                           gdouble val);

ncm_model_orig_vparam_set_vector ()

void
ncm_model_orig_vparam_set_vector (NcmModel *model,
                                  guint n,
                                  NcmVector *val);

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.

Parameters

model

a NcmModel

 

n

a vector parameter index

 

val

a NcmVector

 

ncm_model_param_get ()

gdouble
ncm_model_param_get (NcmModel *model,
                     guint n);

Gets the n -th parameter of model .

Parameters

model

a NcmModel

 

n

a parameter index

 

Returns

the n -th parameter of model .


ncm_model_orig_param_get ()

gdouble
ncm_model_orig_param_get (NcmModel *model,
                          guint n);

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

Parameters

model

a NcmModel

 

n

a parameter index

 

Returns

the n -th original parameter of model .


ncm_model_orig_vparam_get ()

gdouble
ncm_model_orig_vparam_get (NcmModel *model,
                           guint n,
                           guint i);

ncm_model_orig_vparam_get_vector ()

NcmVector *
ncm_model_orig_vparam_get_vector (NcmModel *model,
                                  guint n);

Gets the n -th vector parameter of model .

Parameters

model

a NcmModel

 

n

a vector parameter index

 

Returns

the n -th vector parameter of model .

[transfer full]


ncm_model_params_copyto ()

void
ncm_model_params_copyto (NcmModel *model,
                         NcmModel *model_dest);

Copies the parameters of model to model_dest .

Parameters

model

a NcmModel

 

model_dest

a NcmModel

 

ncm_model_params_set_default ()

void
ncm_model_params_set_default (NcmModel *model);

Sets the models parameters to their default values.

Parameters

model

a NcmModel

 

ncm_model_params_save_as_default ()

void
ncm_model_params_save_as_default (NcmModel *model);

Saves the current parameters as the default values.

Parameters

model

a NcmModel

 

ncm_model_params_set_all ()

void
ncm_model_params_set_all (NcmModel *model,
                          ...);

Sets all parameters of model to the values passed as arguments. The number of arguments must be equal to the number of parameters.

Parameters

model

a NcmModel

 

...

a list of doubles

 

ncm_model_params_set_all_data ()

void
ncm_model_params_set_all_data (NcmModel *model,
                               gdouble *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.

Parameters

model

a NcmModel

 

data

an array of doubles

 

ncm_model_params_set_vector ()

void
ncm_model_params_set_vector (NcmModel *model,
                             NcmVector *v);

Sets all parameters of model to the values of v . The size of v must be equal to the number of parameters.

Parameters

model

a NcmModel

 

v

a NcmVector

 

ncm_model_params_set_model ()

void
ncm_model_params_set_model (NcmModel *model,
                            NcmModel *model_src);

Sets all parameters of model to the values of model_src .

Parameters

model

a NcmModel

 

model_src

a NcmModel

 

ncm_model_params_print_all ()

void
ncm_model_params_print_all (NcmModel *model,
                            FILE *out);

Prints all parameters of model to out .

[skip]

Parameters

model

a NcmModel

 

out

a file handle

 

ncm_model_params_log_all ()

void
ncm_model_params_log_all (NcmModel *model);

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

Parameters

model

a NcmModel

 

ncm_model_params_get_all ()

NcmVector *
ncm_model_params_get_all (NcmModel *model);

Creates a NcmVector with all parameters of model .

Parameters

model

a NcmModel

 

Returns

a NcmVector with all parameters of model .

[transfer full]


ncm_model_params_valid ()

gboolean
ncm_model_params_valid (NcmModel *model);

Check whenever the parameters are valid.

Parameters

model

a NcmModel

 

Returns

TRUE if the parameter are valid.


ncm_model_params_valid_bounds ()

gboolean
ncm_model_params_valid_bounds (NcmModel *model);

Check whenever the parameters respect the bounds.

Parameters

model

a NcmModel

 

Returns

if the parameter respect the bounds.


ncm_model_orig_param_index_from_name ()

gboolean
ncm_model_orig_param_index_from_name (NcmModel *model,
                                      const gchar *param_name,
                                      guint *i);

Looks for parameter named param_name in the original parameters of model and puts its index in i and returns TRUE if found.

Parameters

model

a NcmModel

 

param_name

parameter name

 

i

parameter index.

[out]

Returns

whether the parameter param_name is found in the model .


ncm_model_param_index_from_name ()

gboolean
ncm_model_param_index_from_name (NcmModel *model,
                                 const gchar *param_name,
                                 guint *i);

Looks for parameter named param_name in model and puts its index in i and returns TRUE if found.

Parameters

model

a NcmModel

 

param_name

parameter name

 

i

parameter index.

[out]

Returns

whether the parameter param_name is found in the model .


ncm_model_orig_param_name ()

const gchar *
ncm_model_orig_param_name (NcmModel *model,
                           guint n);

ncm_model_param_name ()

const gchar *
ncm_model_param_name (NcmModel *model,
                      guint n);

ncm_model_orig_param_symbol ()

const gchar *
ncm_model_orig_param_symbol (NcmModel *model,
                             guint n);

ncm_model_param_symbol ()

const gchar *
ncm_model_param_symbol (NcmModel *model,
                        guint n);

ncm_model_param_names ()

GPtrArray *
ncm_model_param_names (NcmModel *model);

Gets an array containing the parameters names.

Parameters

model

a NcmModel

 

Returns

an array containing the parameters names.

[transfer full][element-type utf8]


ncm_model_param_set_by_name ()

void
ncm_model_param_set_by_name (NcmModel *model,
                             const gchar *param_name,
                             gdouble val);

Sets the parameter value val by param_name .

Parameters

model

a NcmModel

 

param_name

parameter name

 

val

parameter value

 

ncm_model_orig_param_set_by_name ()

void
ncm_model_orig_param_set_by_name (NcmModel *model,
                                  const gchar *param_name,
                                  gdouble val);

Sets the parameter value val by param_name .

Parameters

model

a NcmModel

 

param_name

parameter name

 

val

parameter value

 

ncm_model_param_get_by_name ()

gdouble
ncm_model_param_get_by_name (NcmModel *model,
                             const gchar *param_name);

Gets the parameter value by param_name .

Parameters

model

a NcmModel

 

param_name

parameter name

 

Returns

parameter value.


ncm_model_orig_param_get_by_name ()

gdouble
ncm_model_orig_param_get_by_name (NcmModel *model,
                                  const gchar *param_name);

Gets the original parameter value by param_name .

Parameters

model

a NcmModel

 

param_name

parameter name

 

Returns

parameter value.


ncm_model_orig_param_get_scale ()

gdouble
ncm_model_orig_param_get_scale (NcmModel *model,
                                guint n);

Gets the scale of the original n -th parameter.

Parameters

model

a NcmModel

 

n

parameter index.

 

Returns

the scale of the original n -th parameter.


ncm_model_orig_param_get_lower_bound ()

gdouble
ncm_model_orig_param_get_lower_bound (NcmModel *model,
                                      guint n);

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

Parameters

model

a NcmModel

 

n

parameter index

 

Returns

the lower bound of the original n -th parameter.


ncm_model_orig_param_get_upper_bound ()

gdouble
ncm_model_orig_param_get_upper_bound (NcmModel *model,
                                      guint n);

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

Parameters

model

a NcmModel

 

n

parameter index

 

Returns

the upper bound of the original n -th parameter.


ncm_model_orig_param_get_abstol ()

gdouble
ncm_model_orig_param_get_abstol (NcmModel *model,
                                 guint n);

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

Parameters

model

a NcmModel

 

n

parameter index.

 

Returns

the absolute tolerance of the original n -th parameter.


ncm_model_param_get_scale ()

gdouble
ncm_model_param_get_scale (NcmModel *model,
                           guint n);

Gets the scale of the n -th parameter.

Parameters

model

a NcmModel

 

n

parameter index.

 

Returns

the scale of the n -th parameter.


ncm_model_param_get_lower_bound ()

gdouble
ncm_model_param_get_lower_bound (NcmModel *model,
                                 guint n);

Gets the lower bound of the n -th parameter.

Parameters

model

a NcmModel

 

n

parameter index

 

Returns

the lower bound of the n -th parameter.


ncm_model_param_get_upper_bound ()

gdouble
ncm_model_param_get_upper_bound (NcmModel *model,
                                 guint n);

Gets the upper bound of the n -th parameter.

Parameters

model

a NcmModel

 

n

parameter index

 

Returns

the upper bound of the n -th parameter.


ncm_model_param_get_abstol ()

gdouble
ncm_model_param_get_abstol (NcmModel *model,
                            guint n);

Gets the absolute tolerance of the n -th parameter.

Parameters

model

a NcmModel

 

n

parameter index.

 

Returns

the absolute tolerance of the n -th parameter.


ncm_model_param_get_ftype ()

NcmParamType
ncm_model_param_get_ftype (NcmModel *model,
                           guint n);

Gets the fitting type of the n -th parameter.

Parameters

model

a NcmModel

 

n

parameter index

 

Returns

the fitting type of the n -th parameter.


ncm_model_param_set_scale ()

void
ncm_model_param_set_scale (NcmModel *model,
                           guint n,
                           const gdouble scale);

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

Parameters

model

a NcmModel

 

n

parameter index

 

scale

a double

 

ncm_model_param_set_lower_bound ()

void
ncm_model_param_set_lower_bound (NcmModel *model,
                                 guint n,
                                 const gdouble lb);

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

Parameters

model

a NcmModel

 

n

parameter index

 

lb

lower-bound value

 

ncm_model_param_set_upper_bound ()

void
ncm_model_param_set_upper_bound (NcmModel *model,
                                 guint n,
                                 const gdouble ub);

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

Parameters

model

a NcmModel

 

n

parameter index

 

ub

upper-bound value

 

ncm_model_param_set_abstol ()

void
ncm_model_param_set_abstol (NcmModel *model,
                            guint n,
                            const gdouble abstol);

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

Parameters

model

a NcmModel

 

n

parameter index

 

abstol

the absolute tolerance

 

ncm_model_param_set_ftype ()

void
ncm_model_param_set_ftype (NcmModel *model,
                           guint n,
                           const NcmParamType ptype);

Sets ptype as NcmParamType of the n -th parameter.

Parameters

model

a NcmModel

 

n

parameter index

 

ptype

a NcmParamType

 

ncm_model_params_set_default_ftype ()

void
ncm_model_params_set_default_ftype (NcmModel *model);

Sets all parameters NcmParamType to their default values.

Parameters

model

a NcmModel

 

ncm_model_is_submodel ()

gboolean
ncm_model_is_submodel (NcmModel *model);

Tests if model is a submodel of other model class.

Parameters

model

a NcmModel

 

Returns

TRUE if model is a submodel of other model class.


ncm_model_main_model ()

NcmModelID
ncm_model_main_model (NcmModel *model);

If model is a submodel returns the NcmModelID of its main model, otherwise returns -1.

Parameters

model

a NcmModel

 

Returns

main model NcmModelID or -1.


ncm_model_add_submodel ()

void
ncm_model_add_submodel (NcmModel *model,
                        NcmModel *submodel);

Adds the submodel to the model submodels.

[virtual add_submodel]

Parameters

model

a NcmModel

 

submodel

a NcmModel

 

ncm_model_get_submodel_len ()

guint
ncm_model_get_submodel_len (NcmModel *model);

Gets the number of submodels set in model .

Parameters

model

a NcmModel

 

Returns

the number of submodels set in model .


ncm_model_peek_submodel ()

NcmModel *
ncm_model_peek_submodel (NcmModel *model,
                         guint i);

Gets the i -th submodel.

Parameters

model

a NcmModel

 

i

submodel position

 

Returns

a NcmModel.

[transfer none]


ncm_model_peek_submodel_by_mid ()

NcmModel *
ncm_model_peek_submodel_by_mid (NcmModel *model,
                                NcmModelID mid);

Gets the submodel if type NcmModelID mid .

Parameters

model

a NcmModel

 

mid

a NcmModelID

 

Returns

a NcmModel.

[transfer none]


ncm_model_peek_submodel_pos_by_mid ()

gint
ncm_model_peek_submodel_pos_by_mid (NcmModel *model,
                                    NcmModelID mid);

Gets the submodel type NcmModelID mid position.

Parameters

model

a NcmModel

 

mid

a NcmModelID

 

Returns

the mid position or -1 if not found.


ncm_model_type_is_submodel ()

gboolean
ncm_model_type_is_submodel (GType model_type);

Tests if model_type is a submodel of other model class.

Parameters

model_type

a GType

 

Returns

TRUE if model_type is a submodel of other model class.


ncm_model_type_main_model ()

NcmModelID
ncm_model_type_main_model (GType model_type);

If model_type is a submodel returns the NcmModelID of its main model, otherwise returns -1.

Parameters

model_type

a GType

 

Returns

main model NcmModelID or -1.


ncm_model___getitem__ ()

gdouble
ncm_model___getitem__ (NcmModel *model,
                       gchar *param,
                       GError **err);

Gets the parameter by name.

Parameters

model

a NcmModel

 

param

parameter name

 

err

a GError

 

Returns

parameter value


ncm_model___setitem__ ()

void
ncm_model___setitem__ (NcmModel *model,
                       gchar *param,
                       gdouble val,
                       GError **err);

Sets the parameter by name.

Parameters

model

a NcmModel

 

param

parameter name

 

val

parameter value

 

err

a pointer for GError

 

NCM_MODEL_OPT2IMPL()

#define NCM_MODEL_OPT2IMPL(opt) (((guint64) 1) << ((guint64) (opt)))

NCM_MODEL_2OPT2IMPL()

#define NCM_MODEL_2OPT2IMPL(opt1, opt2) (NCM_MODEL_OPT2IMPL (opt1) | NCM_MODEL_OPT2IMPL (opt2))

NCM_MODEL_3OPT2IMPL()

#define NCM_MODEL_3OPT2IMPL(opt1, opt2, opt3) (NCM_MODEL_2OPT2IMPL (opt1, opt2) | NCM_MODEL_OPT2IMPL (opt3))

NCM_MODEL_4OPT2IMPL()

#define NCM_MODEL_4OPT2IMPL(opt1, opt2, opt3, opt4) (NCM_MODEL_2OPT2IMPL (opt1, opt2) | NCM_MODEL_2OPT2IMPL (opt3, opt4))

NCM_MODEL_SET_IMPL_FUNC()

#define             NCM_MODEL_SET_IMPL_FUNC(NS_NAME, NsName, ns_name, type, name)

NCM_MODEL_FUNC0_IMPL()

#define             NCM_MODEL_FUNC0_IMPL(NS_NAME, NsName, ns_name, name)

NCM_MODEL_FUNC1_IMPL()

#define             NCM_MODEL_FUNC1_IMPL(NS_NAME, NsName, ns_name, name, var)

NCM_MODEL_FUNC2_IMPL()

#define             NCM_MODEL_FUNC2_IMPL(NS_NAME, NsName, ns_name, name)

NCM_MODEL_VFUNC0_IMPL()

#define             NCM_MODEL_VFUNC0_IMPL(NS_NAME, NsName, ns_name, name)

NCM_MODEL_VFUNC1_IMPL()

#define             NCM_MODEL_VFUNC1_IMPL(NS_NAME, NsName, ns_name, name, var)

NCM_MODEL_VFUNC2_IMPL()

#define             NCM_MODEL_VFUNC2_IMPL(NS_NAME, NsName, ns_name, name)

Types and Values

NCM_TYPE_MODEL

#define NCM_TYPE_MODEL (ncm_model_get_type ())

NcmModelID

typedef gint32 NcmModelID;

struct NcmModelClass

struct NcmModelClass {
};

NCM_MODEL_MAX_STATES

#define NCM_MODEL_MAX_STATES (10)

NCM_MODEL_CLASS_IMPL_ALL

#define NCM_MODEL_CLASS_IMPL_ALL ((guint64) (~((guint64) 0)))

NcmModel

typedef struct _NcmModel NcmModel;

Property Details

The “implementation” property

  “implementation”           guint64

Bitwise specification of functions implementation.

Owner: NcmModel

Flags: Read

Default value: 0


The “name” property

  “name”                     char *

Model's name.

Owner: NcmModel

Flags: Read

Default value: NULL


The “nick” property

  “nick”                     char *

Model's nick.

Owner: NcmModel

Flags: Read

Default value: NULL


The “params-types” property

  “params-types”             GArray *

Parameters' types.

Owner: NcmModel

Flags: Read


The “reparam” property

  “reparam”                  NcmReparam *

Model reparametrization.

Owner: NcmModel

Flags: Read / Write


The “scalar-params-len” property

  “scalar-params-len”        guint

Number of scalar parameters.

Owner: NcmModel

Flags: Read

Default value: 0


The “sparam-array” property

  “sparam-array”             NcmObjDictInt *

NcmModel array of NcmSParam.

Owner: NcmModel

Flags: Read / Write


The “submodel-array” property

  “submodel-array”           NcmObjArray *

NcmModel array of submodels.

Owner: NcmModel

Flags: Read / Write


The “vector-params-len” property

  “vector-params-len”        guint

Number of vector parameters.

Owner: NcmModel

Flags: Read

Default value: 0