Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-21 10:03:53

0001 /* siman/gsl_siman.h
0002  * 
0003  * Copyright (C) 1996, 1997, 1998, 1999, 2000 Mark Galassi
0004  * 
0005  * This program is free software; you can redistribute it and/or modify
0006  * it under the terms of the GNU General Public License as published by
0007  * the Free Software Foundation; either version 3 of the License, or (at
0008  * your option) any later version.
0009  * 
0010  * This program is distributed in the hope that it will be useful, but
0011  * WITHOUT ANY WARRANTY; without even the implied warranty of
0012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0013  * General Public License for more details.
0014  * 
0015  * You should have received a copy of the GNU General Public License
0016  * along with this program; if not, write to the Free Software
0017  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
0018  */
0019 
0020 #ifndef __GSL_SIMAN_H__
0021 #define __GSL_SIMAN_H__
0022 #include <stdlib.h>
0023 #include <gsl/gsl_rng.h>
0024 
0025 #undef __BEGIN_DECLS
0026 #undef __END_DECLS
0027 #ifdef __cplusplus
0028 # define __BEGIN_DECLS extern "C" {
0029 # define __END_DECLS }
0030 #else
0031 # define __BEGIN_DECLS /* empty */
0032 # define __END_DECLS /* empty */
0033 #endif
0034 
0035 __BEGIN_DECLS
0036 
0037 /* types for the function pointers passed to gsl_siman_solve */
0038 
0039 typedef double (*gsl_siman_Efunc_t) (void *xp);
0040 typedef void (*gsl_siman_step_t) (const gsl_rng *r, void *xp, double step_size);
0041 typedef double (*gsl_siman_metric_t) (void *xp, void *yp);
0042 typedef void (*gsl_siman_print_t) (void *xp);
0043 typedef void (*gsl_siman_copy_t) (void *source, void *dest);
0044 typedef void * (*gsl_siman_copy_construct_t) (void *xp);
0045 typedef void (*gsl_siman_destroy_t) (void *xp);
0046 
0047 /* this structure contains all the information needed to structure the
0048    search, beyond the energy function, the step function and the
0049    initial guess. */
0050 
0051 typedef struct {
0052   int n_tries;          /* how many points to try for each step */
0053   int iters_fixed_T;    /* how many iterations at each temperature? */
0054   double step_size;     /* max step size in the random walk */
0055   /* the following parameters are for the Boltzmann distribution */
0056   double k, t_initial, mu_t, t_min;
0057 } gsl_siman_params_t;
0058 
0059 /* prototype for the workhorse function */
0060 
0061 void gsl_siman_solve(const gsl_rng * r, 
0062                      void *x0_p, gsl_siman_Efunc_t Ef,
0063                      gsl_siman_step_t take_step,
0064                      gsl_siman_metric_t distance,
0065                      gsl_siman_print_t print_position,
0066                      gsl_siman_copy_t copyfunc,
0067                      gsl_siman_copy_construct_t copy_constructor,
0068                      gsl_siman_destroy_t destructor,
0069                      size_t element_size,
0070                      gsl_siman_params_t params);
0071 
0072 void 
0073 gsl_siman_solve_many (const gsl_rng * r, void *x0_p, gsl_siman_Efunc_t Ef,
0074                       gsl_siman_step_t take_step,
0075                       gsl_siman_metric_t distance,
0076                       gsl_siman_print_t print_position,
0077                       size_t element_size,
0078                       gsl_siman_params_t params);
0079 
0080 __END_DECLS
0081 
0082 #endif /* __GSL_SIMAN_H__ */