-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaux.h
67 lines (57 loc) · 2.25 KB
/
aux.h
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
62
63
64
65
66
67
/*
* Copyright 2019, José-Manuel Herruzo <jmherruzo@uma.es>,
* Jesús Alastruey-Benedé <jalastru@unizar.es>,
* Pablo Ibáñez-Marín <imarin@unizar.es>
*
* This file is part of the bvSFM sequence alignment package.
*
* bvSFM 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.
*
* bvSFM 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 bvSFM. If not, see <http://www.gnu.org/licenses/>.
*
* If you publish any work that uses this software, please cite the following paper:
*
* J.M. Herruzo, S. González-Navarro, P. Ibáñez, V. Viñals, J. Alastruey-Benedé, and Óscar Plata.
* Accelerating Sequence Alignments Based on FM-Index Using the Intel KNL Processor.
* IEEE/ACM Transactions on Computational Biology and Bioinformatics (TCBB 2019).
* DOI: 10.1109/TCBB.2018.2884701
*
* @article{herruzo2019TCBB,
* author = {José Manuel Herruzo, Sonia González-Navarro, Pablo Ibáñez, Víctor Viñals, Jesús Alastruey-Benedé, and Óscar Plata},
* journal = {IEEE/ACM Transactions on Computational Biology and Bioinformatics (TCBB 2019)},
* title = {Accelerating Sequence Alignments Based on FM-Index Using the Intel KNL Processor},
* year = {2019},
* doi = {10.1109/TCBB.2018.2884701}
* }
*
*/
#ifndef _AUX_H_
#define _AUX_H_
#include <stdint.h>
// Gi = Gibi = 2^30
#define KiB (1024UL)
#define MiB (KiB*1024UL)
#define GiB (MiB*1024UL)
#define KILO (1000.0)
#define MEGA (1000000.0)
#define GIGA (1000000000.0)
#define HLINE "-------------------------------------------------------------\n"
/**
* Fast ceiling of an unsigned integer division
@result ceil(x/y)
*/
uint64_t
ceil_uint_div(uint64_t x, uint64_t y);
int elements_64b_equal(uint64_t *v, int vlen);
int elements_equal(uint32_t *v, int vlen);
uint64_t sum(uint64_t *v, int vlen);
#endif