yanera_siman.h File Reference


Detailed Description

This file contains the general code for performing simulated annealing, using the GNU scientific library.

Definition in file yanera_siman.h.

Go to the source code of this file.

Functions

int yanera_siman_main (yanera_container *yanera)
 The main function for the simulated annealing fitting routine.
double siman_energy (void *yanera_pointer)
 Calculates the energy cost of $\chi^2$.
void siman_step (const gsl_rng *rng, void *yanera_pointer, double step_size)
 Steps the parameters.
double siman_metric (void *yanera_pointer1, void *yanera_pointer2)
 Calculates the inner product of the parameter array.
void siman_print (void *data)
 Prints to stdout the current state of the parameters.
void siman_copy (void *source_yanera_pointer, void *dest_yanera_pointer)
 Copyies the fitting paramters from one yanera_container to another.
void * siman_copy_construct (void *yanera_pointer)
 Creates a new yanera_container from another.
void siman_destroy (void *yanera_pointer)


Function Documentation

int yanera_siman_main ( yanera_container yanera  ) 

The main function for the simulated annealing. Since this fitting methods does not require any gradiant evaluation, we can simply use mdmin_chisq function for evaluation of the $\chi^2$, and avoid code duplication.

This method is constrained, simply by not stepping the paramters that are fixed. See the page on Fitting methods.

Definition at line 24 of file yanera_siman.c.

double siman_energy ( void *  yanera_pointer  ) 

This function is expected to receive a void pointer, whereas mdmin_chisq expects a yanera_container. So this function casts the void and calls mdmin_chisq.

Definition at line 57 of file yanera_siman.c.

void siman_step ( const gsl_rng *  rng,
void *  yanera_pointer,
double  step_size 
)

This function uses the random number generator and moves the paramters a maximum amount step_size. If the parameters are fixed, or constrained, then appropriate actions are taken.

Definition at line 65 of file yanera_siman.c.

double siman_metric ( void *  yanera_pointer1,
void *  yanera_pointer2 
)

There is some confusion whether this function is ever called. The GSL documentation calls for it, so it is included.

Definition at line 99 of file yanera_siman.c.

void siman_print ( void *  data  ) 

The output during the simulated annealing is as follows:

  • Column: What
  • 1: Iteration
  • 2: Number of evaluations
  • 3: Current temperature
  • 4-n: Current state of the parameters
  • 5: Current $\chi^2$

Definition at line 116 of file yanera_siman.c.

void siman_copy ( void *  source_yanera_pointer,
void *  dest_yanera_pointer 
)

This function copies the paramters from one yanera_container to another.

Definition at line 133 of file yanera_siman.c.

void* siman_copy_construct ( void *  yanera_pointer  ) 

Creates a new yanera_container from another. It only copies only whatever is important to calculate $\chi^2$.

Definition at line 151 of file yanera_siman.c.

void siman_destroy ( void *  yanera_pointer  ) 

Destroys the working copies of yanera_container.

Definition at line 245 of file yanera_siman.c.


Generated on Thu May 29 10:56:33 2008 by  doxygen 1.5.5