CODeME
cmaes_interface.h
1 /* --------------------------------------------------------- */
2 /* --- File: cmaes_interface.h - Author: Nikolaus Hansen --- */
3 /* ---------------------- last modified: IV 2007 --- */
4 /* --------------------------------- by: Nikolaus Hansen --- */
5 /* --------------------------------------------------------- */
6 /*
7  CMA-ES for non-linear function minimization.
8 
9  Copyright (C) 1996, 2003, 2007 Nikolaus Hansen.
10  e-mail: hansen AT lri.fr
11 
12  Documentation: see file docfunctions.txt
13 
14  License: see file cmaes.c
15 */
16 #include "cmaes.h"
17 
18 /* --------------------------------------------------------- */
19 /* ------------------ Interface ---------------------------- */
20 /* --------------------------------------------------------- */
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 /* --- initialization, constructors, destructors --- */
27 double * cmaes_init(cmaes_t *, int dimension , double *xstart,
28  double *stddev, long seed, int lambda,
29  const char *input_parameter_filename);
30 void cmaes_init_para(cmaes_t *, int dimension , double *xstart,
31  double *stddev, long seed, int lambda,
32  const char *input_parameter_filename);
33 double * cmaes_init_final(cmaes_t *);
34 void cmaes_resume_distribution(cmaes_t *evo_ptr, char *filename);
35 void cmaes_exit(cmaes_t *);
36 
37 /* --- core functions --- */
38 double * const * cmaes_SamplePopulation(cmaes_t *);
39 double * cmaes_UpdateDistribution(cmaes_t *,
40  const double *rgFitnessValues);
41 const char * cmaes_TestForTermination(cmaes_t *);
42 
43 /* --- additional functions --- */
44 double * const * cmaes_ReSampleSingle( cmaes_t *t, int index);
45 double const * cmaes_ReSampleSingle_old(cmaes_t *, double *rgx);
46 double * cmaes_SampleSingleInto( cmaes_t *t, double *rgx);
47 void cmaes_UpdateEigensystem(cmaes_t *, int flgforce);
48 
49 /* --- getter functions --- */
50 double cmaes_Get(cmaes_t *, char const *keyword);
51 const double * cmaes_GetPtr(cmaes_t *, char const *keyword); /* e.g. "xbestever" */
52 double * cmaes_GetNew( cmaes_t *t, char const *keyword); /* user is responsible to free */
53 double * cmaes_GetInto( cmaes_t *t, char const *keyword, double *mem); /* allocs if mem==NULL, user is responsible to free */
54 
55 /* --- online control and output --- */
56 void cmaes_ReadSignals(cmaes_t *, char const *filename);
57 void cmaes_WriteToFile(cmaes_t *, const char *szKeyWord,
58  const char *output_filename);
59 char * cmaes_SayHello(cmaes_t *);
60 /* --- misc --- */
61 double * cmaes_NewDouble(int n); /* user is responsible to free */
62 void cmaes_FATAL(char const *s1, char const *s2, char const *s3,
63  char const *s4);
64 
65 #ifdef __cplusplus
66 } // end extern "C"
67 #endif
68 
Definition: cmaes.h:112