suite_bbob_legacy_code.c File Reference

Legacy code from BBOB2009 required to replicate the 2009 functions. More...

#include <math.h>
#include <stdio.h>
#include <assert.h>
#include "coco.h"

Macros

#define SUITE_BBOB2009_MAX_DIM   40
 Maximal dimension used in BBOB2009. More...
 

Functions

static double bbob2009_fmin (double a, double b)
 Computes the minimum of the two values. More...
 
static double bbob2009_fmax (double a, double b)
 Computes the maximum of the two values. More...
 
static double bbob2009_round (double x)
 Rounds the given value. More...
 
static double ** bbob2009_allocate_matrix (const size_t n, const size_t m)
 Allocates a n by m matrix structured as an array of pointers to double arrays. More...
 
static void bbob2009_free_matrix (double **matrix, const size_t n)
 Frees the matrix structured as an array of pointers to double arrays. More...
 
static void bbob2009_unif (double *r, size_t N, long inseed)
 Generates N uniform random numbers using inseed as the seed and stores them in r. More...
 
static double ** bbob2009_reshape (double **B, double *vector, const size_t m, const size_t n)
 Converts from packed matrix storage to an array of array of double representation. More...
 
static void bbob2009_gauss (double *g, const size_t N, const long seed)
 Generates N Gaussian random numbers using the given seed and stores them in g. More...
 
static void bbob2009_compute_rotation (double **B, const long seed, const size_t DIM)
 Computes a DIM by DIM rotation matrix based on seed and stores it in B. More...
 
static void bbob2009_copy_rotation_matrix (double **rot, double *M, double *b, const size_t DIM)
 
static void bbob2009_compute_xopt (double *xopt, const long seed, const size_t DIM)
 Randomly computes the location of the global optimum. More...
 
static double bbob2009_compute_fopt (const size_t function, const size_t instance)
 Randomly chooses the objective offset for the given function and instance. More...
 

Detailed Description

Legacy code from BBOB2009 required to replicate the 2009 functions.

All of this code should only be used by the suite_bbob2009 functions to provide compatibility to the legacy code. New test beds should strive to use the new COCO facilities for random number generation etc.

Macro Definition Documentation

#define SUITE_BBOB2009_MAX_DIM   40

Maximal dimension used in BBOB2009.

Function Documentation

static double** bbob2009_allocate_matrix ( const size_t  n,
const size_t  m 
)
static

Allocates a n by m matrix structured as an array of pointers to double arrays.

static double bbob2009_compute_fopt ( const size_t  function,
const size_t  instance 
)
static

Randomly chooses the objective offset for the given function and instance.

static void bbob2009_compute_rotation ( double **  B,
const long  seed,
const size_t  DIM 
)
static

Computes a DIM by DIM rotation matrix based on seed and stores it in B.

static void bbob2009_compute_xopt ( double *  xopt,
const long  seed,
const size_t  DIM 
)
static

Randomly computes the location of the global optimum.

static void bbob2009_copy_rotation_matrix ( double **  rot,
double *  M,
double *  b,
const size_t  DIM 
)
static
static double bbob2009_fmax ( double  a,
double  b 
)
static

Computes the maximum of the two values.

static double bbob2009_fmin ( double  a,
double  b 
)
static

Computes the minimum of the two values.

static void bbob2009_free_matrix ( double **  matrix,
const size_t  n 
)
static

Frees the matrix structured as an array of pointers to double arrays.

static void bbob2009_gauss ( double *  g,
const size_t  N,
const long  seed 
)
static

Generates N Gaussian random numbers using the given seed and stores them in g.

static double** bbob2009_reshape ( double **  B,
double *  vector,
const size_t  m,
const size_t  n 
)
static

Converts from packed matrix storage to an array of array of double representation.

static double bbob2009_round ( double  x)
static

Rounds the given value.

static void bbob2009_unif ( double *  r,
size_t  N,
long  inseed 
)
static

Generates N uniform random numbers using inseed as the seed and stores them in r.