aboutsummaryrefslogtreecommitdiff
path: root/include/gensvm_queue.h
blob: 441b4a92c4dc41a99d005b5b212d2592ad4dc0e5 (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
/**
 * @file gensvm_queue.h
 * @author G.J.J. van den Burg
 * @date 2013-08-01
 * @brief Header file for gensvm_queue.c
 *
 * @details
 * The grid search for the optimal parameters is done through a queue.
 * This file contains struct definitions for this queue. Function declarations 
 * for initializing and freeing the queue are also included.
 *
 * @copyright
 Copyright 2016, G.J.J. van den Burg.

 This file is part of GenSVM.

 GenSVM 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.

 GenSVM 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 GenSVM. If not, see <http://www.gnu.org/licenses/>.

 */

#ifndef GENSVM_QUEUE_H
#define GENSVM_QUEUE_H

#include "gensvm_task.h"

/**
 * @brief Simple task queue.
 *
 * This struct is basically just an array of pointers to Task instances,
 * with a length and an index of the current task.
 *
 * @param tasks 	array of pointers to Task structs
 * @param N 		size of task array
 * @param i 		index used for keeping track of the queue
 */
struct GenQueue {
	struct GenTask **tasks;
	///< array of pointers to Task structs
	long N;
	///< size of task array
	long i;
	///< index used for keeping track of the queue
};

// function declarations
struct GenQueue *gensvm_init_queue(void);
void gensvm_free_queue(struct GenQueue *q);
struct GenTask *get_next_task(struct GenQueue *q);

#endif