gsl_siman.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /* siman/gsl_siman.h
  2. *
  3. * Copyright (C) 1996, 1997, 1998, 1999, 2000 Mark Galassi
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 3 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  18. */
  19. #ifndef __GSL_SIMAN_H__
  20. #define __GSL_SIMAN_H__
  21. #include <stdlib.h>
  22. #include "gsl_rng.h"
  23. #undef __BEGIN_DECLS
  24. #undef __END_DECLS
  25. #ifdef __cplusplus
  26. # define __BEGIN_DECLS extern "C" {
  27. # define __END_DECLS }
  28. #else
  29. # define __BEGIN_DECLS /* empty */
  30. # define __END_DECLS /* empty */
  31. #endif
  32. __BEGIN_DECLS
  33. /* types for the function pointers passed to gsl_siman_solve */
  34. typedef double (*gsl_siman_Efunc_t) (void *xp);
  35. typedef void (*gsl_siman_step_t) (const gsl_rng *r, void *xp, double step_size);
  36. typedef double (*gsl_siman_metric_t) (void *xp, void *yp);
  37. typedef void (*gsl_siman_print_t) (void *xp);
  38. typedef void (*gsl_siman_copy_t) (void *source, void *dest);
  39. typedef void * (*gsl_siman_copy_construct_t) (void *xp);
  40. typedef void (*gsl_siman_destroy_t) (void *xp);
  41. /* this structure contains all the information needed to structure the
  42. search, beyond the energy function, the step function and the
  43. initial guess. */
  44. typedef struct {
  45. int n_tries; /* how many points to try for each step */
  46. int iters_fixed_T; /* how many iterations at each temperature? */
  47. double step_size; /* max step size in the random walk */
  48. /* the following parameters are for the Boltzmann distribution */
  49. double k, t_initial, mu_t, t_min;
  50. } gsl_siman_params_t;
  51. /* prototype for the workhorse function */
  52. void gsl_siman_solve(const gsl_rng * r,
  53. void *x0_p, gsl_siman_Efunc_t Ef,
  54. gsl_siman_step_t take_step,
  55. gsl_siman_metric_t distance,
  56. gsl_siman_print_t print_position,
  57. gsl_siman_copy_t copyfunc,
  58. gsl_siman_copy_construct_t copy_constructor,
  59. gsl_siman_destroy_t destructor,
  60. size_t element_size,
  61. gsl_siman_params_t params);
  62. void
  63. gsl_siman_solve_many (const gsl_rng * r, void *x0_p, gsl_siman_Efunc_t Ef,
  64. gsl_siman_step_t take_step,
  65. gsl_siman_metric_t distance,
  66. gsl_siman_print_t print_position,
  67. size_t element_size,
  68. gsl_siman_params_t params);
  69. __END_DECLS
  70. #endif /* __GSL_SIMAN_H__ */