Skip to content

Commit

Permalink
Fixed namespace.
Browse files Browse the repository at this point in the history
  • Loading branch information
bbuchfink committed Jun 7, 2020
1 parent e7bb7e9 commit b357cd9
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 85 deletions.
68 changes: 2 additions & 66 deletions src/basic/basic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "sequence.h"
#include "masking.h"

const char* Const::version_string = "0.9.33";
const char* Const::version_string = "0.9.34";
const char* Const::program_name = "diamond";
const char* Const::id_delimiters = " \a\b\f\n\r\t\v\1";

Expand Down Expand Up @@ -254,71 +254,7 @@ vector<vector<string>> shape_codes = {
"1110000001000001011",
"1100100000100001011",
"1100100000001000111" // 13 64x7
},
{ "1111111",
"11110111",
"11101111",
"11110111",
"110111011",
"111011011",
"110110111",
"111001111",
"1110100111",
"1110101011",
"1101010111",
"11100011011",
"11100100111",
"11101001011",
"11010011011",
"11100101011",
"11011000111",
"110010100111",
"110110001101",
"110100010111",
"111000101011",
"111001001011",
"110011001011",
"110101000111",
"1101010000111",
"1101010010011",
"1100101000111",
"1101001010011",
"1110000101011",
"11100000101011",
"11010100010011",
"11100100001011",
"11001010001011",
"11010010010011",
"11010001001011",
"11001001000111",
"110100001010011",
"110010010010101",
"101010000100111",
"101010001010011",
"110100010001011",
"110001001001011",
"110010000101011",
"110100100010011",
"110010001000111",
"111000100001011",
"1101000010001011",
"1100100010010101",
"1100010100001011",
"1101000100010011",
"1010100100100011",
"11100010000100011",
"11000100010001011",
"11001010000000111",
"11100001000010101",
"11010010000010101",
"11010000010000111",
"11001000001001011",
"11010000001010011",
"10101001000001011",
"11001000010010011",
"11010001000001011",
"11100001000100011",
"11010000100001011" } // 14 64x7
}

};

Expand Down
14 changes: 7 additions & 7 deletions src/basic/const.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
/****
DIAMOND protein aligner
Copyright (C) 2013-2017 Benjamin Buchfink <[email protected]>
Copyright (C) 2013-2020 Max Planck Society for the Advancement of Science e.V.
Benjamin Buchfink
Eberhard Karls Universitaet Tuebingen
Code developed by Benjamin Buchfink <[email protected]>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -16,14 +20,12 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
****/

#ifndef CONST_H_
#define CONST_H_

#pragma once
struct Const
{

enum {
build_version = 134,
build_version = 135,
seedp_bits = 10,
seedp = 1<<seedp_bits,
max_seed_weight = 32,
Expand All @@ -41,5 +43,3 @@ static constexpr int MAX_CONTEXT = 6;
// #define FREQUENCY_MASKING
// #define ST_JOIN
// #define NO_COLLISION_FILTER

#endif /* CONST_H_ */
2 changes: 1 addition & 1 deletion src/dp/swipe/banded_swipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ struct CBSBuffer<_sv, const int8_t*> {
_sv operator()(int i) const {
return data[i];
}
vector<_sv, AlignmentAllocator<_sv, 32>> data;
vector<_sv, Util::Memory::AlignmentAllocator<_sv, 32>> data;
};

template<typename _sv, typename _traceback, typename _cbs>
Expand Down
2 changes: 0 additions & 2 deletions src/run/workflow.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,3 @@ void run(const Options &options);

}
}

#endif
2 changes: 1 addition & 1 deletion src/search/stage1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace DISPATCH_ARCH {
const unsigned tile_size[] = { 1024, 128 };

constexpr ptrdiff_t INNER_LOOP_QUERIES = 6;
typedef vector<Finger_print, AlignmentAllocator<Finger_print, 16>> Container;
typedef vector<Finger_print, Util::Memory::AlignmentAllocator<Finger_print, 16>> Container;
typedef Container::const_iterator Ptr;

struct Range_ref
Expand Down
2 changes: 1 addition & 1 deletion src/test/test_cases.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const uint64_t ref_hashes[] = {
0xa2ea51fd070b9485,
0x7c90bb1c62c71cfb,
0xc40f9bffc00c4f97,
0x494651aafd055246,
0xda437ed1f7ddb589,
0xdf32d46bc18e400a,
};

Expand Down
8 changes: 4 additions & 4 deletions src/util/data_structures/mem_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,20 @@ struct MemBuffer {
{}

MemBuffer(size_t n):
data_((_t*)aligned_malloc(n * sizeof(_t), ALIGN)),
data_((_t*)Util::Memory::aligned_malloc(n * sizeof(_t), ALIGN)),
size_(n),
alloc_size_(n)
{
}

~MemBuffer() {
aligned_free(data_);
Util::Memory::aligned_free(data_);
}

void resize(size_t n) {
if (alloc_size_ < n) {
aligned_free(data_);
data_ = (_t*)aligned_malloc(n * sizeof(_t), ALIGN);
Util::Memory::aligned_free(data_);
data_ = (_t*)Util::Memory::aligned_malloc(n * sizeof(_t), ALIGN);
alloc_size_ = n;
}
size_ = n;
Expand Down
26 changes: 23 additions & 3 deletions src/util/memory/alignment.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
#ifndef ALIGNMENT_H_
#define ALIGNMENT_H_
/****
DIAMOND protein aligner
Copyright (C) 2020 Max Planck Society for the Advancement of Science e.V.
Code developed by Benjamin Buchfink <[email protected]>
This program 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.
This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
****/

#pragma once
#include <stdlib.h>
#include <cstddef>
#include <exception>

namespace Util { namespace Memory {

static inline void* aligned_malloc(size_t n, size_t align) {
#ifdef WIN32
void* p = _aligned_malloc(n, align);
Expand Down Expand Up @@ -93,4 +113,4 @@ class AlignmentAllocator {
}
};

#endif
}}

0 comments on commit b357cd9

Please sign in to comment.