Top |
void | (*NcmMSetFuncN) () |
NcmMSetFunc * | ncm_mset_func_ref () |
void | ncm_mset_func_free () |
void | ncm_mset_func_clear () |
GPtrArray * | ncm_mset_func_array_new () |
void | ncm_mset_func_eval () |
gdouble | ncm_mset_func_eval_nvar () |
gdouble | ncm_mset_func_eval0 () |
gdouble | ncm_mset_func_eval1 () |
void | ncm_mset_func_eval_vector () |
void | ncm_mset_func_set_eval_x () |
gboolean | ncm_mset_func_is_scalar () |
gboolean | ncm_mset_func_is_vector () |
gboolean | ncm_mset_func_is_const () |
gboolean | ncm_mset_func_has_nvar () |
guint | ncm_mset_func_get_nvar () |
guint | ncm_mset_func_get_dim () |
void | ncm_mset_func_set_meta () |
const gchar * | ncm_mset_func_peek_name () |
const gchar * | ncm_mset_func_peek_symbol () |
const gchar * | ncm_mset_func_peek_ns () |
const gchar * | ncm_mset_func_peek_desc () |
const gchar * | ncm_mset_func_peek_uname () |
const gchar * | ncm_mset_func_peek_usymbol () |
void | ncm_mset_func_numdiff_fparams () |
guint | dimension | Read / Write / Construct Only |
NcmVector * | eval-x | Read / Write |
guint | nvariables | Read / Write / Construct Only |
This abstract class provides a framework for functions that operate on any model in a NcmMSet and additional extra variables. It establishes methods to inquire about the function's expectations and characteristics.
The functions implemented by subclasses may depend on any model specified by
NcmMSet and may incorporate extra variables. The method
retrieves the count of extra variables expected
by the function, and ncm_mset_func_get_nvar()
returns the number of values
returned by the function.ncm_mset_func_get_dim()
Functions can be categorized as scalar or vectorial. A scalar function returns
a single value, while a vectorial function returns an array of values. The
method
returns ncm_mset_func_is_scalar()
TRUE
if the function is scalar.
void (*NcmMSetFuncN) (NcmMSetFunc *func
,NcmMSet *mset
,const gdouble *x
,gdouble *res
);
NcmMSetFunc *
ncm_mset_func_ref (NcmMSetFunc *func
);
Increases the reference count of func
by one.
void
ncm_mset_func_free (NcmMSetFunc *func
);
Decreases the reference count of func
by one. If the reference count
reaches zero, func
is freed.
void
ncm_mset_func_clear (NcmMSetFunc **func
);
If *func
is not NULL
, decreases the reference count of func
by one
and sets *func
to NULL
.
GPtrArray *
ncm_mset_func_array_new (void
);
Creates a new GPtrArray to hold NcmMSetFunc pointers.
void ncm_mset_func_eval (NcmMSetFunc *func
,NcmMSet *mset
,gdouble *x
,gdouble *res
);
Evaluate the function func
at x
and store the result in res
.
[virtual eval]
func |
||
mset |
a NcmMSet |
|
x |
function arguments. |
[array][element-type double] |
res |
function values. |
[array][element-type double] |
gdouble ncm_mset_func_eval_nvar (NcmMSetFunc *func
,NcmMSet *mset
,const gdouble *x
);
Evaluate the function func
at x
and return the result. This
function is only valid if func
is a scalar function.
gdouble ncm_mset_func_eval0 (NcmMSetFunc *func
,NcmMSet *mset
);
Evaluate the function func
and return the result. This
function is only valid if func
is a scalar function.
The function's arguments are either none, if the function is constant,
or the arguments passed to ncm_mset_func_set_eval_x()
.
gdouble ncm_mset_func_eval1 (NcmMSetFunc *func
,NcmMSet *mset
,const gdouble x
);
Evaluate the function func
at x
and return the result. This
function is only valid if func
is a scalar function.
void ncm_mset_func_eval_vector (NcmMSetFunc *func
,NcmMSet *mset
,NcmVector *x_v
,NcmVector *res_v
);
Compute the function func
at x_v
and store the result in res_v
. This function is
only valid if func
is a vectorial function.
void ncm_mset_func_set_eval_x (NcmMSetFunc *func
,gdouble *x
,guint len
);
Sets the function's arguments to x
. Once this function is called, the
function's arguments are fixed and func
becomes a constant function.
gboolean
ncm_mset_func_is_scalar (NcmMSetFunc *func
);
Checks if func
is a scalar function.
gboolean ncm_mset_func_is_vector (NcmMSetFunc *func
,guint dim
);
Checks if func
is a vectorial function with dimension dim
.
gboolean
ncm_mset_func_is_const (NcmMSetFunc *func
);
Checks if func
is a constant function.
gboolean ncm_mset_func_has_nvar (NcmMSetFunc *func
,guint nvar
);
Checks if func
expects nvar
extra variables.
guint
ncm_mset_func_get_nvar (NcmMSetFunc *func
);
Gets the number of variables of func
.
guint
ncm_mset_func_get_dim (NcmMSetFunc *func
);
Gets the dimension of func
.
void ncm_mset_func_set_meta (NcmMSetFunc *func
,const gchar *name
,const gchar *symbol
,const gchar *ns
,const gchar *desc
,const guint nvar
,const guint dim
);
Sets the function's metadata. This function is called by subclasses' to set the function's metadata. It should not be called by users.
const gchar *
ncm_mset_func_peek_uname (NcmMSetFunc *func
);
Peeks unique name.
const gchar *
ncm_mset_func_peek_usymbol (NcmMSetFunc *func
);
Peeks unique symbol.
void ncm_mset_func_numdiff_fparams (NcmMSetFunc *func
,NcmMSet *mset
,const gdouble *x
,NcmVector **out
);
Computes the gradient of func
at x
and stores the result in out
.
This function is only valid if func
is a scalar function.
func |
||
mset |
a NcmMSet |
|
x |
function arguments. |
[array] |
out |
function gradient. |
[out][transfer full] |
“dimension”
property “dimension” guint
Function dimension.
Owner: NcmMSetFunc
Flags: Read / Write / Construct Only
Default value: 0
“eval-x”
property“eval-x” NcmVector *
Evaluation point x.
Owner: NcmMSetFunc
Flags: Read / Write