GOBNILP  f164d83
parent_set_data.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  * GOBNILP Copyright (C) 2012-2017 James Cussens, Mark Bartlett *
3  * *
4  * This program is free software; you can redistribute it and/or *
5  * modify it under the terms of the GNU General Public License as *
6  * published by the Free Software Foundation; either version 3 of the *
7  * License, or (at your option) any later version. *
8  * *
9  * This program is distributed in the hope that it will be useful, *
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
12  * General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU General Public License *
15  * along with this program; if not, see *
16  * <http://www.gnu.org/licenses>. *
17  * *
18  * Additional permission under GNU GPL version 3 section 7 *
19  * *
20  * If you modify this Program, or any covered work, by linking or *
21  * combining it with SCIP (or a modified version of that library), *
22  * containing parts covered by the terms of the ZIB Academic License, *
23  * the licensors of this Program grant you additional permission to *
24  * convey the resulting work. *
25  * *
26  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
27 
32 #ifndef __PARENT_SET_DATA_H__
33 #define __PARENT_SET_DATA_H__
34 
35 #include <scip/scip.h>
36 
38 typedef struct
39 {
40  int* js;
41  SCIP_VAR** vars;
42  int next;
43  int length;
44 } BUCKET;
45 
46 
48 typedef struct
49 {
50  int n;
51  int* nParentSets;
52  int** nParents;
53  int*** ParentSets;
54  SCIP_VAR*** PaVars;
55  char** nodeNames;
59 
60 extern SCIP_RETCODE PS_deallocateParentSetData(SCIP* scip, ParentSetData** psd, SCIP_Bool releasevars);
61 extern SCIP_RETCODE PS_copyParentSetData(SCIP* scip, ParentSetData* original, ParentSetData** duplicate);
62 
63 extern SCIP_RETCODE PS_splitToComponents(SCIP* scip, ParentSetData* original, int* num_components, ParentSetData*** components);
64 extern SCIP_RETCODE PS_specialiseFor(SCIP* scip, ParentSetData* original, int* nodes, int num_nodes, ParentSetData** specialisation);
65 
66 extern SCIP_RETCODE PS_writeToFile(SCIP* scip, FILE* file, ParentSetData* psd);
67 extern SCIP_RETCODE PS_parse(SCIP* scip, char* str, ParentSetData** psd);
68 
69 #endif
int *** ParentSets
ParentSets[i][k][l] is the lth parent in the kth parent set of the ith element.
Definition: parent_set_data.h:53
int n
Number of elements in the collection.
Definition: parent_set_data.h:50
SCIP_VAR *** PaVars
PaVars[i][k] is the variable linked to the kth parent set of element i.
Definition: parent_set_data.h:54
The basic data needed to record a collection of parent sets associated with a problem.
Definition: parent_set_data.h:48
SCIP_RETCODE PS_parse(SCIP *scip, char *str, ParentSetData **psd)
Parses a ParentSetData structure from a sting.
Definition: parent_set_data.c:606
bucket in a hash table
Definition: parent_set_data.h:38
int * nParentSets
nParentSets[i] is the number of parent sets for element i.
Definition: parent_set_data.h:51
BUCKET ** edge
edge[i][j] is an indicator variable for an edge (in either direction) between i and j...
Definition: parent_set_data.h:57
SCIP_VAR ** vars
vars[i] is ith variable
Definition: parent_set_data.h:41
char ** nodeNames
nodeNames[i] is the name of the ith node
Definition: parent_set_data.h:55
SCIP_RETCODE PS_splitToComponents(SCIP *scip, ParentSetData *original, int *num_components, ParentSetData ***components)
Splits a single set of parent set data in to its strongly connected components.
Definition: parent_set_data.c:427
int * js
js[i] is ith j value
Definition: parent_set_data.h:40
int length
current space allocated for bucket
Definition: parent_set_data.h:43
int ** nParents
nParents[i][k] is the number of parents in the kth parent set for element i.
Definition: parent_set_data.h:52
SCIP_RETCODE PS_specialiseFor(SCIP *scip, ParentSetData *original, int *nodes, int num_nodes, ParentSetData **specialisation)
Creates a subset of parent set data mentioning only the given nodes.
Definition: parent_set_data.c:206
SCIP_RETCODE PS_copyParentSetData(SCIP *scip, ParentSetData *original, ParentSetData **duplicate)
Makes a deep copy of a ParentSetData structure.
Definition: parent_set_data.c:129
int next
all items in bucket has index < next
Definition: parent_set_data.h:42
SCIP_RETCODE PS_deallocateParentSetData(SCIP *scip, ParentSetData **psd, SCIP_Bool releasevars)
Deallocates the memory associated with a ParentSetData structure.
Definition: parent_set_data.c:49
BUCKET ** arrow
arrow[i][j] is an indicator variable for an arrow from j to i
Definition: parent_set_data.h:56
SCIP_RETCODE PS_writeToFile(SCIP *scip, FILE *file, ParentSetData *psd)
Writes a ParentSetData structure to file.
Definition: parent_set_data.c:494