becopyilp: Inline struct size_red_t into struct ilp_env_t.
[libfirm] / ir / kaps / vector.h
1 /*
2  * This file is part of libFirm.
3  * Copyright (C) 2012 University of Karlsruhe.
4  */
5
6 /**
7  * @file
8  * @brief   PBQP vector.
9  * @date    02.10.2008
10  * @author  Sebastian Buchwald
11  */
12 #ifndef KAPS_VECTOR_H
13 #define KAPS_VECTOR_H
14
15 #include "vector_t.h"
16
17 num pbqp_add(num x, num y);
18
19 vector_t *vector_alloc(pbqp_t *pbqp, unsigned length);
20
21 /* Copy the given vector. */
22 vector_t *vector_copy(pbqp_t *pbqp, vector_t *v);
23
24 /* sum += summand */
25 void vector_add(vector_t *sum, vector_t *summand);
26
27 void vector_set(vector_t *vec, unsigned index, num value);
28
29 #if KAPS_ENABLE_VECTOR_NAMES
30 void vector_set_description(vector_t *vec, unsigned index, const char *name);
31 #endif
32
33 void vector_add_value(vector_t *vec, num value);
34
35 void vector_add_matrix_col(vector_t *vec, pbqp_matrix_t *mat, unsigned col_index);
36 void vector_add_matrix_row(vector_t *vec, pbqp_matrix_t *mat, unsigned row_index);
37
38 num vector_get_min(vector_t *vec);
39 unsigned vector_get_min_index(vector_t *vec);
40
41 #endif /* KAPS_VECTOR_H */