Method

NumCosmoMathModelparam_index_from_name_full

Declaration [src]

gboolean
ncm_model_param_index_from_name_full (
  NcmModel* model,
  const gchar* param_name,
  NcmModel** target,
  guint* i,
  GError** error
)

Description [src]

Like ncm_model_param_index_from_name(), but also reaches into model‘s attached submodels when the parameter is not found on model itself.

param_name may be qualified as “slot:param”, where “slot” is the submodel slot’s construction-property name (e.g. “reion”, “prim”, see ncm_model_class_set_submodel()), to address a specific submodel’s parameter directly. An unqualified name matching more than one attached submodel is an error (NCM_MODEL_ERROR_PARAM_NAME_AMBIGUOUS) — use the qualified form to disambiguate. A name present on model itself always takes precedence over any submodel match.

If param_name is not found anywhere (on model or any attached submodel), error is left untouched (FALSE is returned), matching ncm_model_param_index_from_name()’s own convention for the plain not-found case — callers are expected to report that with their own, function-specific message. Any other failure (e.g. the name was changed by an active NcmReparam, or a qualified slot name does not exist) does set error.

Parameters

param_name

Type: const gchar*

Parameter name, optionally qualified as “slot:param”.

The data is owned by the caller of the method.
The value is a NUL terminated UTF-8 string.
target

Type: NcmModel

The model that actually owns the parameter.

The argument will be set by the function.
The returned data is owned by the instance.
i

Type: guint*

The parameter index within target.

The argument will be set by the function.
error

Type: GError **

The return location for a recoverable error.

The argument can be NULL.
If the return location is not NULL, then you must initialize it to a NULL GError*.
The argument will be left initialized to NULL by the method if there are no errors.
In case of error, the argument will be set to a newly allocated GError; the caller will take ownership of the data, and be responsible for freeing it.

Return value

Type: gboolean

TRUE if the parameter was found, in which case target and i are set.