GOBNILP  f164d83
vector.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 __SCIP_VECTOR_H__
33 #define __SCIP_VECTOR_H__
34 
35 #include "scip/scip.h"
36 
38 typedef struct
39 {
41  int capacity;
43  int size;
45  int* items;
46 } Vector;
47 
48 extern Vector* VectorCreate(int capacity);
49 extern void VectorAppend(Vector* vec, int item);
50 extern SCIP_Bool VectorContains(Vector* vec, int item);
51 extern void VectorClear(Vector* vec);
52 extern void VectorDelete(Vector** vec);
53 
54 #endif
55 
56 
int capacity
The maximum capacity of the vector.
Definition: vector.h:41
void VectorClear(Vector *vec)
Clears all the values from a vector.
Definition: vector.c:82
SCIP_Bool VectorContains(Vector *vec, int item)
Determine whether a vector contains a value.
Definition: vector.c:67
A list of integer values.
Definition: vector.h:38
void VectorAppend(Vector *vec, int item)
Appends an item to the end of a vector.
Definition: vector.c:53
void VectorDelete(Vector **vec)
Deallocates the memory associated with a vector.
Definition: vector.c:92
int * items
The items currently in the vector.
Definition: vector.h:45
int size
The number of items currently in the vector.
Definition: vector.h:43
Vector * VectorCreate(int capacity)
Creates a vector with a given capacity.
Definition: vector.c:38