Back to index

plt-scheme  4.2.1
Functions
fit.h File Reference
#include <scheme.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

MZ_DLLEXPORT double * do_fit (void *function, int n_values, double *x_values, double *y_values, double *z_values, double *errors, int n_parameters, double *parameters)
MZ_DLLEXPORT double get_rms ()
MZ_DLLEXPORT double get_varience ()
MZ_DLLEXPORT double * get_asym_error ()
MZ_DLLEXPORT double * get_asym_error_percent ()

Function Documentation

MZ_DLLEXPORT double* do_fit ( void function,
int  n_values,
double *  x_values,
double *  y_values,
double *  z_values,
double *  errors,
int  n_parameters,
double *  parameters 
)

Definition at line 710 of file fit.c.

                                   {

  /* reset lambda and other parameters if desired */
  int i;
  current_fun = function;

  num_data = n_values;
  fit_x = x_values;
  fit_y = y_values;
  fit_z = z_values; /* value is stored in z */
  err_data = errors;

  a = parameters;
  num_params = n_parameters;

  /* redim_vec(&a, num_params); */
  /* par_name = (fixstr *) gp_realloc(par_name, (num_params + 1) * sizeof(fixstr), "fit param"); */

  /* avoid parameters being equal to zero */
  for (i = 0; i < num_params; i++) {
    if (a[i] == 0) {
      a[i] = NEARLY_ZERO; 
    }
  }
  
  if(regress(a)) {
    gc_cleanup();
    return a;
  }
  else { /* something went wrong */
    gc_cleanup(); 
    return NULL;
  }
}

Here is the call graph for this function:

Definition at line 156 of file fit.c.

{return asym_error;}

Definition at line 160 of file fit.c.

MZ_DLLEXPORT double get_rms ( )

Definition at line 148 of file fit.c.

{return rms;}

Definition at line 152 of file fit.c.

{return varience;}