transform_vars_blockrotation_helpers.c File Reference

implements functions needed by transform_vars_blockrotation.c More...

#include <stdio.h>
#include <assert.h>
#include "coco.h"
#include "coco_random.c"
#include "suite_bbob_legacy_code.c"
#include <time.h>

Functions

static size_t coco_rotation_matrix_block_size (size_t const dimension)
 Returns block size for block rotation matrices. More...
 
static double ** coco_allocate_blockmatrix (const size_t n, const size_t *block_sizes, const size_t nb_blocks)
 Allocate a ${n} by ${m} block matrix of nb_blocks block sizes block_sizes structured as an array of pointers to double arrays. each row contains only the block_sizes[i] possibly non-zero elements. More...
 
static void coco_free_block_matrix (double **matrix, const size_t n)
 frees a block diagonal matrix (same as a matrix but in case of change, easier to update separately from free_matrix) More...
 
static void coco_compute_blockrotation (double **B, long seed, size_t n, size_t *block_sizes, size_t nb_blocks)
 Compute a ${DIM}x${DIM} block-diagonal matrix based on ${seed} and block_sizes and stores it in ${B}. B is a 2D vector with DIM lines and each line has blocksize(line) elements (the zeros are not stored) More...
 
static double ** coco_copy_block_matrix (const double *const *B, const size_t dimension, const size_t *block_sizes, const size_t nb_blocks)
 makes a copy of a block_matrix More...
 
static size_t * coco_get_block_sizes (size_t *nb_blocks, size_t dimension, const char *suite_name)
 returns the list of block_sizes and sets nb_blocks to its correct value More...
 

Detailed Description

implements functions needed by transform_vars_blockrotation.c

Function Documentation

static double** coco_allocate_blockmatrix ( const size_t  n,
const size_t *  block_sizes,
const size_t  nb_blocks 
)
static

Allocate a ${n} by ${m} block matrix of nb_blocks block sizes block_sizes structured as an array of pointers to double arrays. each row contains only the block_sizes[i] possibly non-zero elements.

static void coco_compute_blockrotation ( double **  B,
long  seed,
size_t  n,
size_t *  block_sizes,
size_t  nb_blocks 
)
static

Compute a ${DIM}x${DIM} block-diagonal matrix based on ${seed} and block_sizes and stores it in ${B}. B is a 2D vector with DIM lines and each line has blocksize(line) elements (the zeros are not stored)

static double** coco_copy_block_matrix ( const double *const *  B,
const size_t  dimension,
const size_t *  block_sizes,
const size_t  nb_blocks 
)
static

makes a copy of a block_matrix

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

frees a block diagonal matrix (same as a matrix but in case of change, easier to update separately from free_matrix)

static size_t* coco_get_block_sizes ( size_t *  nb_blocks,
size_t  dimension,
const char *  suite_name 
)
static

returns the list of block_sizes and sets nb_blocks to its correct value

static size_t coco_rotation_matrix_block_size ( size_t const  dimension)
static

Returns block size for block rotation matrices.