Model Abstract Class

Model Abstract Class — Base class for implementing models

Functions

gdouble (*NcmModelFunc0) ()
gdouble (*NcmModelFunc1) ()
gdouble (*NcmModelFunc2) ()
void ncm_model_class_add_params ()
void ncm_model_class_set_name_nick ()
void ncm_model_class_set_sparam ()
void ncm_model_class_set_vparam ()
void ncm_model_class_check_params_info ()
NcmModel * ncm_model_dup ()
void ncm_model_free ()
void ncm_model_clear ()
void ncm_model_set_reparam ()
gboolean ncm_model_is_equal ()
NcmModel * ncm_model_ref ()
NcmModelID ncm_model_id ()
NcmModelID ncm_model_id_by_type ()
guint64 ncm_model_impl ()
guint ncm_model_len ()
gboolean ncm_model_state_is_update ()
void ncm_model_state_set_update ()
guint ncm_model_sparam_len ()
guint ncm_model_vparam_array_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 ()
void ncm_model_param_set ()
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 ()
NcmSParam * ncm_model_param_peek_desc ()
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_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 ()
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_reparam_df ()
void ncm_model_reparam_J ()
#define NCM_MODEL_SET_IMPL_FUNC()
#define NCM_MODEL_FUNC0_IMPL()
#define NCM_MODEL_FUNC1_IMPL()
#define NCM_MODEL_FUNC2_IMPL()
NcmSParam * ncm_model_orig_param_peek_desc ()

Properties

Types and Values

typedef NcmModelID
struct NcmModel

Object Hierarchy

    GObject
    ╰── NcmModel
        ├── NcClusterMass
        ├── NcHICosmo
        ├── NcHICosmoQSplineContPrior
        ╰── NcSNIADistCov

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.

For example, in a problem where one must describe some physical model and some model for the measurement tool, lets say FooPhysical model and FooTool both defined in the Foo namespace.

The FooPhysical and FooTools define virtual functions called respectively foo_physical_value and foo_tool_value which calculates some quantities needed to compare the model with data. Note that both models do not implement anything thay just define which virtual functions must be implemented in order to define a model of each type.

Here is an example of the definition of the FooPhysical model type, note that most of it is just the usual GObject framework boilerplate code.

Example 1. Implementing a NcmModel (header: foo_physical.h).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <glib.h>
#include <numcosmo/numcosmo.h> // Including NumCosmo headers

#define FOO_TYPE_PHYSICAL             (foo_physical_get_type ())
#define FOO_PHYSICAL(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), FOO_TYPE_PHYSICAL, FooPhysical))
#define FOO_PHYSICAL_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), FOO_TYPE_PHYSICAL, FooPhysicalClass))
#define FOO_IS_PHYSICAL(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), FOO_TYPE_PHYSICAL))
#define FOO_IS_PHYSICAL_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), FOO_TYPE_PHYSICAL))
#define FOO_PHYSICAL_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), NCM_TYPE_PHYSICAL, FooPhysicalClass))

// The lines above are just the basic GObject definition macros

typedef struct _FooPhysicalClass FooPhysicalClass;
typedef struct _FooPhysical FooPhysical;

// To avoid a gtkdoc bug always declare the instance struct before the class
// struct
struct _FooPhysical 
{
  NcmModel parent_instance;
  ...
};

struct _FooPhysicalClass
{
  NcmModelClass parent_class;
  gdouble (*value) (NcmModel *model); // Virtual function.
  ...
};

...

GType foo_physical_get_type (void) G_GNUC_CONST;
NCM_MSET_MODEL_DECLARE_ID (foo_physical); 
// The last line above is part of the model type registry.

gdouble foo_physical_value (FooPhysical *phys); // The virtual function caller.

Example 2. Implementing a NcmModel (source: foo_physical.c).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include "foo_physical.h"
G_DEFINE_ABSTRACT_TYPE (FooPhysical, foo_physical, NCM_TYPE_MODEL);

static void
foo_physical_init (FooPhysical *object)
{
  ... // Some basic initialization for an instance.
}

static void
_foo_physical_finalize (GObject *object)
{

  ... // Instance finalization, must deallocate all memory and release all references.

  // Chain up : end
  G_OBJECT_CLASS (foo_physical_parent_class)->finalize (object);
}

static gboolean _foo_physical_valid (NcmModel *model); // Define if the model is valid
NCM_MSET_MODEL_REGISTER_ID (foo_physical, FOO_TYPE_PHYSICAL); // Second part of the model type registry.

static void
foo_physical_class_init (FooPhysicalClass *klass)
{
  GObjectClass* object_class = G_OBJECT_CLASS (klass);
  NcmModelClass *model_class = NCM_MODEL_CLASS (klass);
  
  object_class->finalize = &_foo_physical_finalize;

  // It is a base model type definition so no parameters.
  ncm_model_class_add_params (model_class, 0, 0, 1);
  
  // Define its id short and long description.
  ncm_mset_model_register_id (model_class, 
                              "FooPhysical",
                              "Some brief description.",
                              "Some long description.");

  // Checks if everything is consistent.
  ncm_model_class_check_params_info (model_class);
  
  // Sets the "valid" function. 
  model_class->valid = &_foo_physical_valid;
}

static gboolean 
_foo_physical_valid (NcmModel *model)
{
  if (!NCM_MODEL_CLASS (foo_physical_parent_class)->valid (model))
    return FALSE;
  // Chain up : start
  
  ... // returns TRUE if value and FALSE if not.

}

...

// Virtual function accessor.
G_INLINE_FUNC gdouble foo_physical_value (FooPhysical *phys) \
{
  return FOO_PHYSICAL_GET_CLASS (m)->value (NCM_MODEL (phys)); \
}

...

Now it is possible to give different implementations of each model, e.g., FooPhysicalSimple could be a simple implementation of the physical model taking into account only the main effects and containing only a few parameters. Then, FooPhysicalComplex a more complex implementation including several effects and usually containing several parameters. Suppose that the same applies to FooToolSimple and FooToolComplex.

Here an example of a FooPhysical implementation:

Example 3. Implementing a FooPhysical (header: foo_physical_simple.h).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <glib.h>
#include <numcosmo/numcosmo.h> // Including NumCosmo headers
#include "foo_physical.h"

#define NCM_TYPE_PHYSICAL_SIMPLE             (foo_physical_simple_get_type ())
#define FOO_PHYSICAL_SIMPLE(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), NCM_TYPE_PHYSICAL_SIMPLE, FooPhysicalSimple))
#define FOO_PHYSICAL_SIMPLE_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), NCM_TYPE_PHYSICAL_SIMPLE, FooPhysicalSimpleClass))
#define FOO_IS_PHYSICAL_SIMPLE(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NCM_TYPE_PHYSICAL_SIMPLE))
#define FOO_IS_PHYSICAL_SIMPLE_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), NCM_TYPE_PHYSICAL_SIMPLE))
#define FOO_PHYSICAL_SIMPLE_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), NCM_TYPE_PHYSICAL_SIMPLE, FooPhysicalSimpleClass))

// The lines above are just the basic GObject definition macros

typedef struct _FooPhysicalSimpleClass FooPhysicalSimpleClass;
typedef struct _FooPhysicalSimple FooPhysicalSimple;

// To avoid a gtkdoc bug always declare the instance struct before the class
// struct
struct _FooPhysicalSimple 
{
  FooPhysical parent_instance; // Note that it is now a child of FooPhysical
  ...
};

struct _FooPhysicalSimpleClass
{
  FooPhysicalClass parent_class; // Note that it is now a child of FooPhysical
  ...
};

...

GType foo_physical_simple_get_type (void) G_GNUC_CONST;
// Note that we do not registry FooPhysicalSimple as it is of FooPhysical type.

Example 4. Implementing a FooPhysical (source: foo_physical_simple.c).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include "foo_physical_simple.h"
G_DEFINE_ABSTRACT_TYPE (FooPhysicalSimple, foo_physical_simple, NCM_TYPE_PHYSICAL);

static void
foo_physical_simple_init (FooPhysicalSimple *object)
{
  ... // Some basic initialization for an instance.
}

static void
_foo_physical_simple_finalize (GObject *object)
{

  ... // Instance finalization, must deallocate all memory and release all references.

  // Chain up : end
  G_OBJECT_CLASS (foo_physical_simple_parent_class)->finalize (object);
}

// Again, we do not need to register this model.

// Here we need to define what FooPhysicalSimple actually calculates.
gdouble _foo_physical_simple_value (NcmModel *model);

static void
foo_physical_simple_class_init (FooPhysicalSimpleClass *klass)
{
  GObjectClass* object_class = G_OBJECT_CLASS (klass);
  NcmModelClass *model_class = NCM_MODEL_CLASS (klass);
  FooPhysicalClass *physical_class = FOO_PHYSICAL_CLASS (klass);
  
  object_class->finalize = &_foo_physical_finalize;
  
  physical_class->value = &_foo_physical_simple_value;
  
  // It is simple model so lets say is has one (01) scalar parameter and
  // zero vector parameters.
  ncm_model_class_add_params (model_class, 1, 0, 1);
  
  // Now we set the name and nick for our model. 
  ncm_model_class_set_name_nick (model_class, "Physical simple model", "PSimple");

  // Our parameter number 0 is p0 with its symbol being p_0, it can varies 
  // from -10.0 to 10.0 and its natural varying scale is 0.1
  // its absolute tolerance is 0 (no absolute tolerance) and its default
  // value is 2.0 and by default it should be set free in statistical
  // analysis.
  ncm_model_class_set_sparam (model_class, 0, "p_0", "p0",
                              -10.0, 10.0, 0.1,
                              0.0, 1.0,
                              NCM_PARAM_TYPE_FREE);


  // Checks if everything is consistent.
  ncm_model_class_check_params_info (model_class);
  
}

...

// The virtual function implementation.
gdouble 
_foo_physical_simple_value (NcmModel *model)
{
  const gdouble p0 = ncm_vector_get (model->params, 0); // Get the value of the parameter p0 to perform calculations. 
  
  ...

  return ...; // Return the "value".
}

...

Note that, we can now build a NcmData to compare data with these models (FooPhysical and FooTool), in this way NcmData will only depend on these two classes and not on their implementations, i.e., inside NcmData we only call foo_physical_value and foo_tool_value which are independent of their implementations. We can then build a NcmMSet using any combination of FooPhysicalSimple or FooPhysicalComplex and FooToolSimple or FooToolComplex, to find their bestfit or make other statistical analysis (see NcmFit and related objects).

Functions

NcmModelFunc0 ()

gdouble
(*NcmModelFunc0) (NcmModel *model);

NcmModelFunc1 ()

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

NcmModelFunc2 ()

gdouble
(*NcmModelFunc2) (NcmModel *model,
                  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);

FIXME

Parameters

model_class

a NcmModelClass.

 

sparam_len

FIXME

 

vparam_len

FIXME

 

nonparam_prop_len

FIXME

 

ncm_model_class_set_name_nick ()

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

FIXME

Parameters

model_class

a NcmModelClass.

 

name

FIXME

 

nick

FIXME

 

ncm_model_class_set_sparam ()

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

FIXME

Parameters

model_class

a NcmModelClass.

 

sparam_id

FIXME

 

symbol

FIXME

 

name

FIXME

 

lower_bound

FIXME

 

upper_bound

FIXME

 

scale

FIXME

 

abstol

FIXME

 

default_value

FIXME

 

ppt

FIXME

 

ncm_model_class_set_vparam ()

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

FIXME

Parameters

model_class

a NcmModelClass

 

vparam_id

FIXME

 

default_length

FIXME

 

symbol

FIXME

 

name

FIXME

 

lower_bound

FIXME

 

upper_bound

FIXME

 

scale

FIXME

 

abstol

FIXME

 

default_value

FIXME

 

ppt

FIXME

 

ncm_model_class_check_params_info ()

void
ncm_model_class_check_params_info (NcmModelClass *model_class);

FIXME

Parameters

model_class

a NcmModelClass.

 

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_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);

FIXME

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

NcmModel *
ncm_model_ref (NcmModel *model);

FIXME

Parameters

model

a NcmModel

 

Returns

FIXME.

[transfer full]


ncm_model_id ()

NcmModelID
ncm_model_id (NcmModel *model);

FIXME

Parameters

model

a NcmModel

 

Returns

FIXME


ncm_model_id_by_type ()

NcmModelID
ncm_model_id_by_type (GType model_type);

ncm_model_impl ()

guint64
ncm_model_impl (NcmModel *model);

FIXME

Parameters

model

a NcmModel

 

Returns

FIXME


ncm_model_len ()

guint
ncm_model_len (NcmModel *model);

FIXME

Parameters

model

a NcmModel

 

Returns

FIXME


ncm_model_state_is_update ()

gboolean
ncm_model_state_is_update (NcmModel *model);

FIXME

Parameters

model

a NcmModel

 

Returns

FIXME


ncm_model_state_set_update ()

void
ncm_model_state_set_update (NcmModel *model);

FIXME

Parameters

model

a NcmModel

 

ncm_model_sparam_len ()

guint
ncm_model_sparam_len (NcmModel *model);

FIXME

Parameters

model

a NcmModel

 

Returns

FIXME


ncm_model_vparam_array_len ()

guint
ncm_model_vparam_array_len (NcmModel *model);

FIXME

Parameters

model

a NcmModel

 

Returns

FIXME


ncm_model_vparam_index ()

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

FIXME

Parameters

model

a NcmModel

 

n

vector 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);

FIXME

Parameters

model

a NcmModel

 

n

vector index

 

Returns

length of the n-th vector


ncm_model_name ()

const gchar *
ncm_model_name (NcmModel *model);

FIXME

Parameters

model

a NcmModel

 

Returns

FIXME.

[transfer none]


ncm_model_nick ()

const gchar *
ncm_model_nick (NcmModel *model);

FIXME

Parameters

model

a NcmModel

 

Returns

FIXME.

[transfer none]


ncm_model_peek_reparam ()

NcmReparam *
ncm_model_peek_reparam (NcmModel *model);

FIXME

Parameters

model

a NcmModel

 

Returns

FIXME.

[transfer none]


ncm_model_params_finite ()

gboolean
ncm_model_params_finite (NcmModel *model);

FIXME

Parameters

model

a NcmModel

 

Returns

FIXME


ncm_model_param_finite ()

gboolean
ncm_model_param_finite (NcmModel *model,
                        guint i);

FIXME

Parameters

model

a NcmModel

 

i

FIXME

 

Returns

FIXME


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

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

FIXME

Parameters

model

a NcmModel

 

n

FIXME

 

val

FIXME

 

ncm_model_param_set_default ()

void
ncm_model_param_set_default (NcmModel *model,
                             guint n);

FIXME

Parameters

model

a NcmModel

 

n

FIXME

 

ncm_model_orig_param_set ()

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

FIXME

Parameters

model

a NcmModel

 

n

FIXME

 

val

FIXME

 

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);

FIXME

Parameters

model

a NcmModel

 

n

FIXME

 

val

FIXME

 

ncm_model_param_peek_desc ()

NcmSParam *
ncm_model_param_peek_desc (NcmModel *model,
                           guint n);

Peeks the n -th parameter description.

Parameters

model

a NcmModel.

 

n

parameter index.

 

Returns

The n -th NcmSParam.

[transfer none]


ncm_model_param_get ()

gdouble
ncm_model_param_get (NcmModel *model,
                     guint n);

FIXME

Parameters

model

a NcmModel

 

n

FIXME

 

Returns

FIXME


ncm_model_orig_param_get ()

gdouble
ncm_model_orig_param_get (NcmModel *model,
                          guint n);

FIXME

Parameters

model

a NcmModel

 

n

FIXME

 

Returns

FIXME


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);

FIXME

Parameters

model

a NcmModel

 

n

FIXME

 

Returns

FIXME.

[transfer full]


ncm_model_params_copyto ()

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

FIXME

Parameters

model

a NcmModel.

 

model_dest

a NcmModel.

 

ncm_model_params_set_default ()

void
ncm_model_params_set_default (NcmModel *model);

FIXME

Parameters

model

a NcmModel.

 

ncm_model_params_save_as_default ()

void
ncm_model_params_save_as_default (NcmModel *model);

FIXME

Parameters

model

a NcmModel.

 

ncm_model_params_set_all ()

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

FIXME

Parameters

model

a NcmModel.

 

...

FIXME

 

ncm_model_params_set_all_data ()

void
ncm_model_params_set_all_data (NcmModel *model,
                               gdouble *data);

FIXME

Parameters

model

a NcmModel.

 

data

FIXME

 

ncm_model_params_set_vector ()

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

FIXME

Parameters

model

a NcmModel.

 

v

a NcmVector.

 

ncm_model_params_set_model ()

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

FIXME

Parameters

model

a NcmModel.

 

model_src

a NcmModel.

 

ncm_model_params_print_all ()

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

FIXME

Parameters

model

a NcmModel

 

out

FIXME

 

ncm_model_params_log_all ()

void
ncm_model_params_log_all (NcmModel *model);

FIXME

Parameters

model

a NcmModel

 

ncm_model_params_get_all ()

NcmVector *
ncm_model_params_get_all (NcmModel *model);

FIXME

Parameters

model

a NcmModel

 

Returns

FIXME.

[transfer full]


ncm_model_params_valid ()

gboolean
ncm_model_params_valid (NcmModel *model);

FIXME

Parameters

model

a NcmModel

 

Returns

FIXME


ncm_model_orig_param_index_from_name ()

gboolean
ncm_model_orig_param_index_from_name (NcmModel *model,
                                      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,
                                 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_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);

FIXME

Parameters

model

a NcmModel

 

n

FIXME

 

scale

FIXME

 

ncm_model_param_set_lower_bound ()

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

FIXME

Parameters

model

a NcmModel

 

n

FIXME

 

lb

FIXME

 

ncm_model_param_set_upper_bound ()

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

FIXME

Parameters

model

a NcmModel

 

n

FIXME

 

ub

FIXME

 

ncm_model_param_set_abstol ()

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

FIXME

Parameters

model

a NcmModel

 

n

FIXME

 

abstol

FIXME

 

ncm_model_param_set_ftype ()

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

FIXME

Parameters

model

a NcmModel

 

n

FIXME

 

ptype

FIXME

 

ncm_model_reparam_df ()

void
ncm_model_reparam_df (NcmModel *model,
                      NcmVector *fv,
                      NcmVector *v);

FIXME

Parameters

model

a NcmModel.

 

fv

a NcmVector.

 

v

a NcmVector.

 

ncm_model_reparam_J ()

void
ncm_model_reparam_J (NcmModel *model,
                     NcmMatrix *fJ,
                     NcmMatrix *J);

FIXME

Parameters

model

a NcmModel.

 

fJ

a NcmMatrix.

 

J

a NcmMatrix.

 

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)

NCM_MODEL_FUNC2_IMPL()

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

ncm_model_orig_param_peek_desc ()

NcmSParam *
ncm_model_orig_param_peek_desc (NcmModel *model,
                                guint n);

Peeks the n -th original parameter description.

Parameters

model

a NcmModel.

 

n

parameter index.

 

Returns

The n -th NcmSParam of the original parametrization.

[transfer none]

Types and Values

NcmModelID

typedef gint NcmModelID;

struct NcmModel

struct NcmModel;

Base class for models.

Property Details

The “implementation” property

  “implementation”           guint64

Bitwise specification of functions implementation.

Flags: Read

Default value: 0


The “name” property

  “name”                     gchar *

Model's name.

Flags: Read

Default value: NULL


The “nick” property

  “nick”                     gchar *

Model's nick.

Flags: Read

Default value: NULL


The “params-types” property

  “params-types”             GArray *

Parameters' types.

Flags: Read


The “reparam” property

  “reparam”                  NcmReparam *

Model reparametrization.

Flags: Read / Write


The “scalar-params-len” property

  “scalar-params-len”        guint

Number of scalar parameters.

Flags: Read

Default value: 0


The “vector-params-len” property

  “vector-params-len”        guint

Number of vector parameters.

Flags: Read

Default value: 0