Skip to content
Snippets Groups Projects
Commit 728713a1 authored by Jan Trávníček's avatar Jan Trávníček
Browse files

tidy: 1 vs true, 0 vs false

parent db2510c7
No related branches found
No related tags found
1 merge request!200clang tidy fixes
...@@ -24,31 +24,31 @@ ext::set<unsigned int> LevenshteinBitParalelism::search(const string::LinearStri ...@@ -24,31 +24,31 @@ ext::set<unsigned int> LevenshteinBitParalelism::search(const string::LinearStri
   
ext::map<SymbolType, ext::vector<bool> > D_vectors = BitParalelism::constructDVectors(common_alphabet, pattern); ext::map<SymbolType, ext::vector<bool> > D_vectors = BitParalelism::constructDVectors(common_alphabet, pattern);
   
auto V_vector = ext::vector<bool>(pattern.getContent().size(), 0); ext::vector<bool> V_vector (pattern.getContent().size(), false);
V_vector[pattern.getContent().size() - 1] = 1; V_vector[pattern.getContent().size() - 1] = true;
   
// computation part // computation part
ext::set<unsigned int> result; ext::set<unsigned int> result;
   
ext::vector<ext::vector<bool> > B_vectors; ext::vector<ext::vector<bool> > B_vectors;
for(unsigned int i=0; i<=errors; i++) { for(unsigned int i=0; i<=errors; i++) {
B_vectors.push_back(ext::vector<bool>(pattern.getContent().size(), 0)); B_vectors.push_back(ext::vector<bool>(pattern.getContent().size(), false));
} }
   
for(unsigned int l = 0; l <= errors; l++) { for(unsigned int l = 0; l <= errors; l++) {
for(unsigned int j = l; j <= pattern.getContent().size(); j++) { for(unsigned int j = l; j <= pattern.getContent().size(); j++) {
B_vectors[l][j] = 1; B_vectors[l][j] = true;
} }
} }
   
// 0-th column // 0-th column
ext::vector<bool> b0 = ext::vector < bool > ( pattern.getContent().size(), true ); ext::vector<bool> b0 = ext::vector < bool > ( pattern.getContent().size(), true );
for(unsigned int j=1; j<=errors; j++) { for(unsigned int j=1; j<=errors; j++) {
b0 <<= 1; b0 <<= 1;
if(b0[pattern.getContent().size()-1] == false) { if ( ! b0 [ pattern.getContent ( ).size ( ) - 1 ] ) {
result.insert(0); result.insert(0);
break; break;
} }
} }
   
   
...@@ -64,7 +64,7 @@ ext::set<unsigned int> LevenshteinBitParalelism::search(const string::LinearStri ...@@ -64,7 +64,7 @@ ext::set<unsigned int> LevenshteinBitParalelism::search(const string::LinearStri
} }
   
for (const auto & data : B_vectors) { for (const auto & data : B_vectors) {
if(data[pattern.getContent().size()-1] == false) { if ( ! data [ pattern.getContent ( ).size ( ) - 1 ] ) {
result.insert(i+1); result.insert(i+1);
break; break;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment