summaryrefslogtreecommitdiff
path: root/src/wfg.h
blob: 890dbdbec149c630c4a4b5278643165039275ce5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/*****************************************************************************
 *                                                                           *
 *                  Small (Matlab/Octave) Toolbox for Kriging                *
 *                                                                           *
 * Copyright Notice                                                          *
 *                                                                           *
 *    Copyright (C) 2015, 2016 CentraleSupelec                               *
 *                                                                           *
 *    Author:  Julien Bect  <julien.bect@centralesupelec.fr>                 *
 *                                                                           *
 *    Based on the file wfg.h from WFG 1.10 by Lyndon While, Lucas           *
 *    Bradstreet, Luigi Barone, released under the GPLv2+ licence. The       *
 *    original copyright notice is:                                          *
 *                                                                           *
 *       Copyright (C) 2010 Lyndon While, Lucas Bradstreet                   *
 *                                                                           *
 * Copying Permission Statement                                              *
 *                                                                           *
 *    This file is part of                                                   *
 *                                                                           *
 *            STK: a Small (Matlab/Octave) Toolbox for Kriging               *
 *               (https://github.com/stk-kriging/stk/)                   *
 *                                                                           *
 *    STK is free software: you can redistribute it and/or modify it under   *
 *    the terms of the GNU General Public License as published by the Free   *
 *    Software Foundation,  either version 3  of the License, or  (at your   *
 *    option) any later version.                                             *
 *                                                                           *
 *    STK is distributed  in the hope that it will  be useful, but WITHOUT   *
 *    ANY WARRANTY;  without even the implied  warranty of MERCHANTABILITY   *
 *    or FITNESS  FOR A  PARTICULAR PURPOSE.  See  the GNU  General Public   *
 *    License for more details.                                              *
 *                                                                           *
 *    You should  have received a copy  of the GNU  General Public License   *
 *    along with STK.  If not, see <http://www.gnu.org/licenses/>.           *
 *                                                                           *
 ****************************************************************************/

#ifndef ___WFG_H___
#define ___WFG_H___

typedef double OBJECTIVE;

typedef struct
{
    int n;
    OBJECTIVE *objectives;
}
POINT;

typedef struct
{
    int nPoints;
    int nPoints_alloc;  /* must *not* be changed */
    int n;
    int n_alloc;        /* must *not* be changed */
    POINT *points;
}
FRONT;

double wfg_compute_hv (FRONT* ps);

void wfg_alloc (int maxm, int maxn);
void wfg_free (int maxm, int maxn);

void wfg_front_init (FRONT* front, int nb_points, int nb_objectives);
void wfg_front_destroy (FRONT* front);
void wfg_front_resize (FRONT* f, int nb_points, int nb_objectives);


/*****************************************/
/* RLIST structure & associated funtions */
/*****************************************/

typedef struct
{
    int allocated_size;  /* maximal number of rectangles     */
    int size;            /* current number of rectangles     */
    int n;               /* dimension (number of objectives) */
    double **xmin;       /* lower bounds                     */
    double *xmin_data;   /* lower bounds (one block)         */
    double **xmax;       /* upper bounds                     */
    double *xmax_data;   /* upper bounds (one block)         */  
    int *sign;           /* inclusion/exclusion              */
}
RLIST;

/* wfg_compute_decomposition: similar to wfg_compute_hv, but */
/*   returns a decomposition of the dominated region into    */
/*   hyper-rectangles (instead of its hyper-volume)          */
void wfg_compute_decomposition (FRONT* ps, RLIST* Rlist);

/* Memory management */
RLIST* Rlist_alloc (int alloc_size, int n);
void Rlist_extend (RLIST* Rlist, int k, int* p_Ridx);
void Rlist_free (RLIST* Rlist);


#endif