-
Notifications
You must be signed in to change notification settings - Fork 0
/
bit_mng.h
64 lines (57 loc) · 2.34 KB
/
bit_mng.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
/*
* 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 _BIT_MNG_H_
#define _BIT_MNG_H_
#include <stdint.h>
#include "types.h"
/**
@param buffer Buffer to write the data
@param n_bits Number of bits to write
@param position Position to write inside the buffer (measured in bits)
@param value Value to write
@return 0 if no error occurred
*/
void write_char_to_buffer(uint8_t* buffer, uint n_bits, uint64_t position,
uint8_t value);
/**
@param buffer Buffer to read the data
@param n_bits Number of bits to read
@param position Position in the buffer to start reading (in bits)
@param return read char
*/
uint8_t read_char_from_buffer(uint8_t* buffer, uint n_bits, uint64_t position);
#endif