NcmModelBuilder

NcmModelBuilder — A NcmModel builder

Functions

Properties

char * description Read / Write / Construct Only
char * name Read / Write / Construct Only
char * parent-type-string Read / Write / Construct Only
NcmObjArray * sparams Read / Write / Construct Only
gboolean stackable Read / Write / Construct Only
NcmObjArray * vparams Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── NcmModelBuilder

Description

This model can be used to create runtime NcmModels. It is particularly useful to create models in binded languages, e.g., python.

Functions

ncm_model_builder_new ()

NcmModelBuilder *
ncm_model_builder_new (GType ptype,
                       const gchar *name,
                       const gchar *desc);

Creates a new NcmModelBuilder object. This does not create the new class after defining all parameters one should call ncm_model_builder_create() to effectively define a new class.

Parameters

ptype

Parent's type

 

name

model's name

 

desc

model's description

 

Returns

a new NcmModelBuilder.

[transfer full]


ncm_model_builder_ref ()

NcmModelBuilder *
ncm_model_builder_ref (NcmModelBuilder *mb);

Increase reference count of mb by one.

Parameters

mb

a NcmModelBuilder

 

Returns

mb .

[transfer full]


ncm_model_builder_add_sparam_obj ()

void
ncm_model_builder_add_sparam_obj (NcmModelBuilder *mb,
                                  NcmSParam *sparam);

Adds the parameters described by sparam to mb .

Parameters

mb

a NcmModelBuilder

 

sparam

a NcmSParam

 

ncm_model_builder_add_vparam_obj ()

void
ncm_model_builder_add_vparam_obj (NcmModelBuilder *mb,
                                  NcmVParam *vparam);

Adds the parameters described by sparam to mb .

Parameters

mb

a NcmModelBuilder

 

vparam

a NcmVParam

 

ncm_model_builder_add_sparam ()

void
ncm_model_builder_add_sparam (NcmModelBuilder *mb,
                              const gchar *symbol,
                              const gchar *name,
                              gdouble lower_bound,
                              gdouble upper_bound,
                              gdouble scale,
                              gdouble abstol,
                              gdouble default_value,
                              NcmParamType ppt);

Creates a new NcmSParam from arguments and add it to mb .

Parameters

mb

a NcmModelBuilder

 

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

absolute tolerance

 

default_value

default value

 

ppt

a NcmParamType

 

ncm_model_builder_add_vparam ()

void
ncm_model_builder_add_vparam (NcmModelBuilder *mb,
                              guint default_length,
                              const gchar *symbol,
                              const gchar *name,
                              gdouble lower_bound,
                              gdouble upper_bound,
                              gdouble scale,
                              gdouble abstol,
                              gdouble default_value,
                              NcmParamType ppt);

Creates a new NcmVParam from arguments and add it to mb .

Parameters

mb

a NcmModelBuilder

 

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

absolute tolerance

 

default_value

default value

 

ppt

a NcmParamType

 

ncm_model_builder_create ()

GType
ncm_model_builder_create (NcmModelBuilder *mb);

Creates a new object type using the scalar and vector parameters defined in mb . If the object type was already created, this function just returns the type.

Parameters

mb

a NcmModelBuilder

 

Returns

the new object type.


ncm_model_builder_add_sparams ()

void
ncm_model_builder_add_sparams (NcmModelBuilder *mb,
                               NcmObjArray *sparams);

Adds all NcmSParam objects in sparams to mb .

Parameters

mb

a NcmModelBuilder

 

sparams

an array of NcmSParam objects

 

ncm_model_builder_get_sparams ()

NcmObjArray *
ncm_model_builder_get_sparams (NcmModelBuilder *mb);

Parameters

mb

a NcmModelBuilder

 

Returns

a NcmObjArray containing all NcmSParam objects in mb .

[transfer full]

Types and Values

NCM_TYPE_MODEL_BUILDER

#define NCM_TYPE_MODEL_BUILDER (ncm_model_builder_get_type ())

NcmModelBuilder

typedef struct _NcmModelBuilder NcmModelBuilder;

Property Details

The “description” property

  “description”              char *

Model's description.

Owner: NcmModelBuilder

Flags: Read / Write / Construct Only

Default value: "no-description"


The “name” property

  “name”                     char *

Model's name.

Owner: NcmModelBuilder

Flags: Read / Write / Construct Only

Default value: "no-name"


The “parent-type-string” property

  “parent-type-string”       char *

Parent type name.

Owner: NcmModelBuilder

Flags: Read / Write / Construct Only

Default value: "NcmModel"


The “sparams” property

  “sparams”                  NcmObjArray *

Scalar parameters.

Owner: NcmModelBuilder

Flags: Read / Write / Construct Only


The “stackable” property

  “stackable”                gboolean

Stackable.

Owner: NcmModelBuilder

Flags: Read / Write / Construct Only

Default value: FALSE


The “vparams” property

  “vparams”                  NcmObjArray *

Vector parameters.

Owner: NcmModelBuilder

Flags: Read / Write / Construct Only