NcmFitState

NcmFitState — State of a NcmFit object.

Functions

NcmFitState * ncm_fit_state_new ()
NcmFitState * ncm_fit_state_ref ()
void ncm_fit_state_free ()
void ncm_fit_state_clear ()
void ncm_fit_state_set_all ()
void ncm_fit_state_reset ()
void ncm_fit_state_set_ls ()
void ncm_fit_state_set_fparam_len ()
guint ncm_fit_state_get_fparam_len ()
void ncm_fit_state_set_data_len ()
guint ncm_fit_state_get_data_len ()
void ncm_fit_state_set_dof ()
gint ncm_fit_state_get_dof ()
void ncm_fit_state_add_iter ()
void ncm_fit_state_set_niter ()
guint ncm_fit_state_get_niter ()
void ncm_fit_state_add_func_eval ()
void ncm_fit_state_set_func_eval ()
guint ncm_fit_state_get_func_eval ()
void ncm_fit_state_add_grad_eval ()
void ncm_fit_state_set_grad_eval ()
guint ncm_fit_state_get_grad_eval ()
void ncm_fit_state_set_m2lnL_prec ()
gdouble ncm_fit_state_get_m2lnL_prec ()
void ncm_fit_state_set_m2lnL_curval ()
gdouble ncm_fit_state_get_m2lnL_curval ()
void ncm_fit_state_set_params_prec ()
gdouble ncm_fit_state_get_params_prec ()
void ncm_fit_state_set_elapsed_time ()
gdouble ncm_fit_state_get_elapsed_time ()
void ncm_fit_state_set_has_covar ()
gboolean ncm_fit_state_has_covar ()
void ncm_fit_state_set_is_best_fit ()
gboolean ncm_fit_state_is_best_fit ()
void ncm_fit_state_set_is_least_squares ()
gboolean ncm_fit_state_is_least_squares ()
NcmVector * ncm_fit_state_peek_fparams ()
NcmMatrix * ncm_fit_state_peek_hessian ()
NcmMatrix * ncm_fit_state_peek_covar ()
NcmVector * ncm_fit_state_peek_f ()
NcmMatrix * ncm_fit_state_peek_J ()

Properties

guint data-len Read / Write / Construct
int dof Read / Write / Construct
guint fparam-len Read / Write / Construct
guint func-eval Read / Write
guint grad-eval Read / Write
gboolean is-best-fit Read / Write
gboolean is-least-squares Read / Write / Construct
guint niters Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── NcmFitState

Description

Object that stores the state of a NcmFit object.

Functions

ncm_fit_state_new ()

NcmFitState *
ncm_fit_state_new (guint data_len,
                   guint fparam_len,
                   gint dof,
                   gboolean is_least_squares);

Instantiates a new NcmFitState.

Parameters

data_len

data length

 

fparam_len

free parameters length

 

dof

degrees of freedom

 

is_least_squares

whether it is a least squares fit

 

Returns

a newly allocated NcmFitState.

[transfer full]


ncm_fit_state_ref ()

NcmFitState *
ncm_fit_state_ref (NcmFitState *fstate);

Increases the reference count of fstate by one.

Parameters

fstate

a NcmFitState

 

Returns

fstate .

[transfer full]


ncm_fit_state_free ()

void
ncm_fit_state_free (NcmFitState *fstate);

Decreases the reference count of fstate by one.

Parameters

fstate

a NcmFitState

 

ncm_fit_state_clear ()

void
ncm_fit_state_clear (NcmFitState **fstate);

Decreases the reference count of *fstate by one, and sets the pointer *fstate to NULL.

Parameters

fstate

a NcmFitState

 

ncm_fit_state_set_all ()

void
ncm_fit_state_set_all (NcmFitState *fstate,
                       guint data_len,
                       guint fparam_len,
                       gint dof,
                       gboolean is_least_squares);

Sets all the properties of fstate .

Parameters

fstate

a NcmFitState

 

data_len

Number of data points

 

fparam_len

Number of free parameters

 

dof

Degrees of freedom

 

is_least_squares

whether it is a least squares fit

 

ncm_fit_state_reset ()

void
ncm_fit_state_reset (NcmFitState *fstate);

Resets the NcmFitState to its initial state.

Parameters

fstate

a NcmFitState

 

ncm_fit_state_set_ls ()

void
ncm_fit_state_set_ls (NcmFitState *fstate,
                      NcmVector *f,
                      NcmMatrix *J);

Sets the least squares data of fstate .

This method is used by NcmFit implementations to set the precision of the parameters. It should not be used by the user.

Parameters

fstate

a NcmFitState

 

f

a NcmVector

 

J

a NcmMatrix

 

ncm_fit_state_set_fparam_len ()

void
ncm_fit_state_set_fparam_len (NcmFitState *fstate,
                              guint fparam_len);

Sets the number of free parameters of fstate .

This method is used by NcmFit implementations to set fstate state. It should not be used by the user.

Parameters

fstate

a NcmFitState

 

fparam_len

Number of free parameters

 

ncm_fit_state_get_fparam_len ()

guint
ncm_fit_state_get_fparam_len (NcmFitState *fstate);

Gets the number of free parameters of fstate .

Parameters

fstate

a NcmFitState

 

Returns

Number of free parameters


ncm_fit_state_set_data_len ()

void
ncm_fit_state_set_data_len (NcmFitState *fstate,
                            guint data_len);

Sets the number of data points used to compute fstate .

Parameters

fstate

a NcmFitState

 

data_len

Number of data points

 

ncm_fit_state_get_data_len ()

guint
ncm_fit_state_get_data_len (NcmFitState *fstate);

Gets the number of data points used to compute fstate .

Parameters

fstate

a NcmFitState

 

Returns

Number of data points


ncm_fit_state_set_dof ()

void
ncm_fit_state_set_dof (NcmFitState *fstate,
                       gint dof);

Sets the degrees of freedom of fstate .

This method is used by NcmFit implementations to set fstate state. It should not be used by the user.

Parameters

fstate

a NcmFitState

 

dof

Degrees of freedom

 

ncm_fit_state_get_dof ()

gint
ncm_fit_state_get_dof (NcmFitState *fstate);

Gets the degrees of freedom of fstate .

Parameters

fstate

a NcmFitState

 

Returns

Degrees of freedom


ncm_fit_state_add_iter ()

void
ncm_fit_state_add_iter (NcmFitState *fstate,
                        guint niter);

Adds niter to the number of iterations of fstate .

Parameters

fstate

a NcmFitState

 

niter

Number of iterations

 

ncm_fit_state_set_niter ()

void
ncm_fit_state_set_niter (NcmFitState *fstate,
                         guint niter);

Sets the number of iterations of fstate .

This method is used by NcmFit implementations to set fstate state. It should not be used by the user.

Parameters

fstate

a NcmFitState

 

niter

Number of iterations

 

ncm_fit_state_get_niter ()

guint
ncm_fit_state_get_niter (NcmFitState *fstate);

Gets the number of iterations of fstate .

Parameters

fstate

a NcmFitState

 

Returns

Number of iterations


ncm_fit_state_add_func_eval ()

void
ncm_fit_state_add_func_eval (NcmFitState *fstate,
                             guint func_eval);

Adds func_eval to the number of function evaluations of fstate .

This method is used by NcmFit implementations to set fstate state. It should not be used by the user.

Parameters

fstate

a NcmFitState

 

func_eval

Number of function evaluations

 

ncm_fit_state_set_func_eval ()

void
ncm_fit_state_set_func_eval (NcmFitState *fstate,
                             guint func_eval);

Sets the number of function evaluations of fstate .

This method is used by NcmFit implementations to set fstate state. It should not be used by the user.

Parameters

fstate

a NcmFitState

 

func_eval

Number of function evaluations

 

ncm_fit_state_get_func_eval ()

guint
ncm_fit_state_get_func_eval (NcmFitState *fstate);

Gets the number of function evaluations of fstate .

Parameters

fstate

a NcmFitState

 

Returns

Number of function evaluations


ncm_fit_state_add_grad_eval ()

void
ncm_fit_state_add_grad_eval (NcmFitState *fstate,
                             guint grad_eval);

Adds grad_eval to the number of gradient evaluations of fstate .

This method is used by NcmFit implementations to set fstate state. It should not be used by the user.

Parameters

fstate

a NcmFitState

 

grad_eval

Number of gradient evaluations

 

ncm_fit_state_set_grad_eval ()

void
ncm_fit_state_set_grad_eval (NcmFitState *fstate,
                             guint grad_eval);

Sets the number of gradient evaluations of fstate .

This method is used by NcmFit implementations to set fstate state. It should not be used by the user.

Parameters

fstate

a NcmFitState

 

grad_eval

Number of gradient evaluations

 

ncm_fit_state_get_grad_eval ()

guint
ncm_fit_state_get_grad_eval (NcmFitState *fstate);

Gets the number of gradient evaluations of fstate .

Parameters

fstate

a NcmFitState

 

Returns

Number of gradient evaluations


ncm_fit_state_set_m2lnL_prec ()

void
ncm_fit_state_set_m2lnL_prec (NcmFitState *fstate,
                              gdouble prec);

Sets the precision of the m2lnL of fstate .

This method is used by NcmFit implementations to set fstate state. It should not be used by the user.

Parameters

fstate

a NcmFitState

 

prec

Precision of the m2lnL

 

ncm_fit_state_get_m2lnL_prec ()

gdouble
ncm_fit_state_get_m2lnL_prec (NcmFitState *fstate);

Gets the precision of the m2lnL of fstate .

Parameters

fstate

a NcmFitState

 

Returns

Precision of the m2lnL


ncm_fit_state_set_m2lnL_curval ()

void
ncm_fit_state_set_m2lnL_curval (NcmFitState *fstate,
                                gdouble m2lnL_curval);

Sets the current value of the m2lnL of fstate .

This method is used by NcmFit implementations to set fstate state. It should not be used by the user.

Parameters

fstate

a NcmFitState

 

m2lnL_curval

Current value of the m2lnL

 

ncm_fit_state_get_m2lnL_curval ()

gdouble
ncm_fit_state_get_m2lnL_curval (NcmFitState *fstate);

Gets the current value of the m2lnL of fstate .

Parameters

fstate

a NcmFitState

 

Returns

Current value of the m2lnL


ncm_fit_state_set_params_prec ()

void
ncm_fit_state_set_params_prec (NcmFitState *fstate,
                               gdouble prec);

Sets the precision of the parameters of fstate .

This method is used by NcmFit implementations to set the precision of the parameters. It should not be used by the user.

Parameters

fstate

a NcmFitState

 

prec

Precision of the parameters

 

ncm_fit_state_get_params_prec ()

gdouble
ncm_fit_state_get_params_prec (NcmFitState *fstate);

Gets the precision of the parameters of fstate .

Parameters

fstate

a NcmFitState

 

Returns

Precision of the parameters


ncm_fit_state_set_elapsed_time ()

void
ncm_fit_state_set_elapsed_time (NcmFitState *fstate,
                                gdouble elapsed_time);

Sets the elapsed time of fstate .

This method is used by NcmFit implementations to set fstate state. It should not be used by the user.

Parameters

fstate

a NcmFitState

 

elapsed_time

Elapsed time

 

ncm_fit_state_get_elapsed_time ()

gdouble
ncm_fit_state_get_elapsed_time (NcmFitState *fstate);

Gets the elapsed time of fstate .

Parameters

fstate

a NcmFitState

 

Returns

Elapsed time


ncm_fit_state_set_has_covar ()

void
ncm_fit_state_set_has_covar (NcmFitState *fstate,
                             gboolean has_covar);

Sets whether fstate has a computed covariance matrix.

Parameters

fstate

a NcmFitState

 

has_covar

whether fstate has a covariance matrix

 

ncm_fit_state_has_covar ()

gboolean
ncm_fit_state_has_covar (NcmFitState *fstate);

Checks if fstate has a computed covariance matrix.

Parameters

fstate

a NcmFitState

 

Returns

TRUE if fstate has a computed covariance matrix, FALSE otherwise


ncm_fit_state_set_is_best_fit ()

void
ncm_fit_state_set_is_best_fit (NcmFitState *fstate,
                               gboolean is_best_fit);

Sets whether fstate is a best fit.

Parameters

fstate

a NcmFitState

 

is_best_fit

whether fstate is a best fit

 

ncm_fit_state_is_best_fit ()

gboolean
ncm_fit_state_is_best_fit (NcmFitState *fstate);

Checks if fstate is a best fit.

Parameters

fstate

a NcmFitState

 

Returns

TRUE if fstate is a best fit, FALSE otherwise


ncm_fit_state_set_is_least_squares ()

void
ncm_fit_state_set_is_least_squares (NcmFitState *fstate,
                                    gboolean is_least_squares);

Sets whether fstate is a least squares fit.

Parameters

fstate

a NcmFitState

 

is_least_squares

whether fstate is a least squares fit

 

ncm_fit_state_is_least_squares ()

gboolean
ncm_fit_state_is_least_squares (NcmFitState *fstate);

Checks if fstate is a least squares fit.

Parameters

fstate

a NcmFitState

 

Returns

TRUE if fstate is a least squares fit, FALSE otherwise


ncm_fit_state_peek_fparams ()

NcmVector *
ncm_fit_state_peek_fparams (NcmFitState *fstate);

Gets the free parameters NcmVector of fstate .

Parameters

fstate

a NcmFitState

 

Returns

Free parameters NcmVector.

[transfer none]


ncm_fit_state_peek_hessian ()

NcmMatrix *
ncm_fit_state_peek_hessian (NcmFitState *fstate);

Gets the Hessian NcmMatrix of fstate .

Parameters

fstate

a NcmFitState

 

Returns

Hessian NcmMatrix.

[transfer none]


ncm_fit_state_peek_covar ()

NcmMatrix *
ncm_fit_state_peek_covar (NcmFitState *fstate);

Gets the covariance NcmMatrix of fstate .

Parameters

fstate

a NcmFitState

 

Returns

Covariance NcmMatrix.

[transfer none]


ncm_fit_state_peek_f ()

NcmVector *
ncm_fit_state_peek_f (NcmFitState *fstate);

Gets the function NcmVector of fstate .

Parameters

fstate

a NcmFitState

 

Returns

Function NcmVector.

[transfer none]


ncm_fit_state_peek_J ()

NcmMatrix *
ncm_fit_state_peek_J (NcmFitState *fstate);

Gets the Jacobian NcmMatrix of fstate .

Parameters

fstate

a NcmFitState

 

Returns

Jacobian NcmMatrix.

[transfer none]

Types and Values

NCM_TYPE_FIT_STATE

#define NCM_TYPE_FIT_STATE (ncm_fit_state_get_type ())

NcmFitState

typedef struct _NcmFitState NcmFitState;

Property Details

The “data-len” property

  “data-len”                 guint

Data length.

Owner: NcmFitState

Flags: Read / Write / Construct

Default value: 0


The “dof” property

  “dof”                      int

Degrees of freedom.

Owner: NcmFitState

Flags: Read / Write / Construct

Default value: 0


The “fparam-len” property

  “fparam-len”               guint

Free parameters length.

Owner: NcmFitState

Flags: Read / Write / Construct

Default value: 0


The “func-eval” property

  “func-eval”                guint

Number of function evaluations.

Owner: NcmFitState

Flags: Read / Write

Default value: 0


The “grad-eval” property

  “grad-eval”                guint

Number of gradient evaluations.

Owner: NcmFitState

Flags: Read / Write

Default value: 0


The “is-best-fit” property

  “is-best-fit”              gboolean

Is a best fit state.

Owner: NcmFitState

Flags: Read / Write

Default value: FALSE


The “is-least-squares” property

  “is-least-squares”         gboolean

Is a least squares fit state.

Owner: NcmFitState

Flags: Read / Write / Construct

Default value: FALSE


The “niters” property

  “niters”                   guint

Number of interations.

Owner: NcmFitState

Flags: Read / Write

Default value: 0