transform_vars_discretize.c File Reference

Implementation of transforming a continuous problem to a mixed-integer problem by making some of its variables discrete. The integer variables are considered as bounded (any variable outside the decision space is mapped to the closest boundary point), while the continuous ones are treated as unbounded. More...

#include <assert.h>
#include "coco.h"
#include "coco_problem.c"

Data Structures

struct  transform_vars_discretize_data_t
 Data type for transform_vars_discretize. More...
 

Functions

static void transform_vars_discretize_evaluate_function (coco_problem_t *problem, const double *x, double *y)
 Evaluates the transformed objective function. More...
 
static void transform_vars_discretize_free (void *thing)
 Frees the data object. More...
 
static coco_problem_ttransform_vars_discretize (coco_problem_t *inner_problem, const double *smallest_values_of_interest, const double *largest_values_of_interest, const size_t number_of_integer_variables)
 Creates the transformation. More...
 

Detailed Description

Implementation of transforming a continuous problem to a mixed-integer problem by making some of its variables discrete. The integer variables are considered as bounded (any variable outside the decision space is mapped to the closest boundary point), while the continuous ones are treated as unbounded.

Note
The first problem->number_of_integer_variables are integer, while the rest are continuous.

The discretization works as follows. Consider the case where the interval [l, u] of the inner problem needs to be discretized to n integer values of the outer problem. First, [l, u] is discretized to n integers by placing the integers so that there is a (u-l)/(n+1) distance between them (and the border points). Then, the transformation is shifted so that the optimum aligns with the closest integer. In this way, we make sure that if the optimum is within [l, u], so are all the shifted points.

When evaluating such a problem, the x values of the integer variables are first discretized. Any value x < 0 is mapped to 0 and any value x > (n-1) is mapped to (n-1).

Function Documentation

static coco_problem_t* transform_vars_discretize ( coco_problem_t inner_problem,
const double *  smallest_values_of_interest,
const double *  largest_values_of_interest,
const size_t  number_of_integer_variables 
)
static

Creates the transformation.

static void transform_vars_discretize_evaluate_function ( coco_problem_t problem,
const double *  x,
double *  y 
)
static

Evaluates the transformed objective function.

static void transform_vars_discretize_free ( void *  thing)
static

Frees the data object.