diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | kmer_frequency_per_sequence.c | 3 | ||||
-rw-r--r-- | kmer_total_count.c | 2 |
3 files changed, 3 insertions, 4 deletions
@@ -1,6 +1,6 @@ VERSION=\"v0.0.1\" CC = gcc -CFLAGS = -O3 -s -mtune=native -Wall -lm -DVERSION=$(VERSION) -Wextra +CFLAGS = -O3 -s -mtune=native -Wall -DVERSION=$(VERSION) -Wextra all: libkmer.so kmer_total_count kmer_frequency_per_sequence diff --git a/kmer_frequency_per_sequence.c b/kmer_frequency_per_sequence.c index 02a221b..62b98cb 100644 --- a/kmer_frequency_per_sequence.c +++ b/kmer_frequency_per_sequence.c @@ -27,7 +27,6 @@ int main(int argc, char **argv) { long kmer = 6; size_t len = 0; ssize_t read; - unsigned long width = 0; if(argc != 3) { printf("Please supply a filename and a kmer\n"); @@ -40,7 +39,7 @@ int main(int argc, char **argv) { exit(EXIT_FAILURE); } - width = (int)pow(4, kmer); + const unsigned long width = (unsigned long)1 << (kmer * 2); while ((read = getline(&line, &len, fh)) != -1) { if(line[0] != '>' && (read > kmer)) { diff --git a/kmer_total_count.c b/kmer_total_count.c index 113c979..345bceb 100644 --- a/kmer_total_count.c +++ b/kmer_total_count.c @@ -43,7 +43,7 @@ int main(int argc, char **argv) { const unsigned int kmer = atoi(argv[2]); // width is 4^kmer - const unsigned long width = pow(4, kmer); + const unsigned long width = (unsigned long)1 << (kmer * 2); // malloc our counts matrix unsigned long long * const counts = malloc((width+ 1) * sizeof(unsigned long long)); |