mo_utilities.c File Reference

Definitions of miscellaneous functions used for multi-objective problems. More...

#include <stdlib.h>
#include <stdio.h>
#include "coco.h"

Functions

static double mo_get_norm (const double *first, const double *second, const size_t dim)
 Computes and returns the Euclidean norm of two dim-dimensional points first and second. More...
 
static double * mo_normalize (const double *y, const double *ideal, const double *nadir, const size_t num_obj)
 Creates a rounded normalized version of the given solution w.r.t. the given ROI. More...
 
static int mo_get_dominance (const double *normalized_y1, const double *normalized_y2, const size_t num_obj)
 Checks the dominance relation in the unconstrained minimization case between two normalized solutions in the objective space. More...
 
static int mo_is_within_ROI (const double *normalized_y, const size_t num_obj)
 Checks whether the normalized solution is within [0, 1]^num_obj. More...
 
static double mo_get_distance_to_ROI (const double *normalized_y, const size_t num_obj)
 Computes and returns the minimal normalized distance of the point normalized_y from the ROI (equals 0 if within the ROI). More...
 

Variables

static const double mo_precision = 1e-13
 Precision used when comparing multi-objective solutions. More...
 
static const double mo_discretization = 5 * 1e-13
 Discretization interval used for rounding normalized multi-objective solutions. More...
 

Detailed Description

Definitions of miscellaneous functions used for multi-objective problems.

Function Documentation

static double mo_get_distance_to_ROI ( const double *  normalized_y,
const size_t  num_obj 
)
static

Computes and returns the minimal normalized distance of the point normalized_y from the ROI (equals 0 if within the ROI).

Note
Assumes num_obj = 2 and normalized_y >= 0
static int mo_get_dominance ( const double *  normalized_y1,
const double *  normalized_y2,
const size_t  num_obj 
)
static

Checks the dominance relation in the unconstrained minimization case between two normalized solutions in the objective space.

If two values are closer together than mo_precision, they are treated as equal.

Returns
1 if normalized_y1 dominates normalized_y2
0 if normalized_y1 and normalized_y2 are non-dominated
-1 if normalized_y2 dominates normalized_y1
-2 if normalized_y1 is identical to normalized_y2
static double mo_get_norm ( const double *  first,
const double *  second,
const size_t  dim 
)
static

Computes and returns the Euclidean norm of two dim-dimensional points first and second.

static int mo_is_within_ROI ( const double *  normalized_y,
const size_t  num_obj 
)
static

Checks whether the normalized solution is within [0, 1]^num_obj.

static double* mo_normalize ( const double *  y,
const double *  ideal,
const double *  nadir,
const size_t  num_obj 
)
static

Creates a rounded normalized version of the given solution w.r.t. the given ROI.

If the solution seems to be better than the extremes it is corrected (2 objectives are assumed). The caller is responsible for freeing the allocated memory using coco_free_memory().

Variable Documentation

const double mo_discretization = 5 * 1e-13
static

Discretization interval used for rounding normalized multi-objective solutions.

Note
mo_discretization needs to be larger than mo_precision
const double mo_precision = 1e-13
static

Precision used when comparing multi-objective solutions.

Two solutions are considered equal in objective space when their normalized difference is smaller than mo_precision.

Note
mo_precision needs to be smaller than mo_discretization