parQHV
Compute HyperVolumes using threads
 All Data Structures Files Functions Variables Macros
tdata.h
1 /*
2  *
3  * Copyright (c) Year(s), 2013, Luis M. S. Russo and Alexandre
4  * P. Francisco / KDBIO / INESC-ID, <qhv@kdbio.inesc-id.pt>
5  *
6  * Any published media that is related with to use of the distributed
7  * software, or derived software, must contain a reference to "Extending
8  * quick hypervolume. Luís M. S. Russo, Alexandre P. Francisco:
9  * J. Heuristics 22(3): 245-271 (2016)".
10  *
11  * Permission to use, copy, modify, and/or distribute this software for
12  * any purpose with or without fee is hereby granted, provided that the
13  * above copyright notice and this permission notice appear in all
14  * copies.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
17  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
19  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
20  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
21  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
22  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
23  * PERFORMANCE OF THIS SOFTWARE.
24  *
25  */
26 
27 #ifndef TDATA_H
28 #define TDATA_H
29 
30 #include "point.h"
31 #include "constants.h"
32 #include "arrayList.h"
33 #include "counterHash.h"
34 
35 /* Some handy macros */
36 #define offsetof(st, m) __builtin_offsetof(st, m)
37 #define container_of(ptr, type, member) &(((char*)(ptr))[-offsetof(type, member)])
38 
39 /* One of this exists in position of the task queue */
40 typedef struct taskData taskData;
41 
42 /* One of this exists in position of the job queue */
43 typedef struct jobData jobData;
44 
45 /* A box where each worker stores its tools. */
46 typedef struct toolBox toolBox;
47 
48 struct toolBox
49 {
50  struct iex{ /* Data for the inclusion exclusion algorithm */
51  point PTS[1<<N] __attribute__ ((aligned (CLS)));
52  int C2P[1<<N] __attribute__ ((aligned (CLS)));
53  } iex;
54 
55  struct spData{ /* Data for the splitter tool */
60  struct unionData{ /* Data for the union tool */
61  int size;
64  } uD;
65  struct dominantData{
66  point PTS[NPOINTS];
67  int localidx[NPOINTS];
68  } doD;
69  } spt;
70 };
71 
72 struct jobData
73 {
74  int n; /* The number of points in the job */
75  point PS[NPOINTS]; /* The real points in the job */
76  double r;
77 };
78 
79 /* Not necessarially the best configuration, but fairly good. */
80 struct taskData
81 { /* Data necessary to the task */
82  point z;
83  point o;
84  int n;
85  int idx[NPOINTS];
86  double r; /* Result */
87 };
88 
89 #endif /* TDATA_H */
A hash for containing counter values.
#define D
D is the number of dimensions.
Definition: pointStruct.h:43
This header implements an arrayList for integers.
Simple point interface. Contains simple point manipulation functions.
arrayList hoList[D+1]
Definition: tdata.h:56
Definition: tdata.h:48
counterHash presences
Definition: tdata.h:63
point PTS[1<< N] __attribute__((aligned(CLS)))
Definition: tdata.h:80
double r
Definition: tdata.h:76
arrayList piList[D+1]
Definition: tdata.h:57
Point is an array of coordinates, in a struct for simple and fast copy.
Definition: pointStruct.h:47
Less than 1K use array of counters.
Definition: counterHash.c:39
Definition: tdata.h:72
counterHash counters
Definition: tdata.h:58