#include <vppinfra/random.h>
#include <math.h>
-typedef struct {
+typedef struct
+{
/* Initial temperature */
f64 initial_temperature;
u32 flags;
#define CLIB_ANNEAL_VERBOSE (1<<0)
-#define CLIB_ANNEAL_MINIMIZE (1<<1) /* mutually exclusive */
-#define CLIB_ANNEAL_MAXIMIZE (1<<2) /* mutually exclusive */
+#define CLIB_ANNEAL_MINIMIZE (1<<1) /* mutually exclusive */
+#define CLIB_ANNEAL_MAXIMIZE (1<<2) /* mutually exclusive */
/* Random number seed, set to ensure repeatable results */
u32 random_seed;
/* Opaque data passed to callbacks */
- void * opaque;
+ void *opaque;
/* Final temperature (output) */
f64 final_temperature;
/*--- Callbacks ---*/
-
+
/* objective function to minimize */
- f64 (*anneal_metric)(void * opaque);
+ f64 (*anneal_metric) (void *opaque);
/* Generate a new configuration */
- void (*anneal_new_configuration)(void * opaque);
+ void (*anneal_new_configuration) (void *opaque);
/* Restore the previous configuration */
- void (*anneal_restore_previous_configuration)(void * opaque);
+ void (*anneal_restore_previous_configuration) (void *opaque);
/* Save best configuration found e.g at a certain temperature */
- void (*anneal_save_best_configuration) (void * opaque);
+ void (*anneal_save_best_configuration) (void *opaque);
/* restore best configuration found e.g at a certain temperature */
- void (*anneal_restore_best_configuration) (void * opaque);
-
+ void (*anneal_restore_best_configuration) (void *opaque);
+
} clib_anneal_param_t;
void clib_anneal (clib_anneal_param_t * p);
#endif /* __included_anneal_h__ */
+
+/*
+ * fd.io coding-style-patch-verification: ON
+ *
+ * Local Variables:
+ * eval: (c-set-style "gnu")
+ * End:
+ */