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

optimize some arbology algos

parent c4fe7254
No related branches found
No related tags found
No related merge requests found
...@@ -72,7 +72,7 @@ ext::set < unsigned > BoyerMooreHorspool::match ( const tree::PrefixRankedBarTre ...@@ -72,7 +72,7 @@ ext::set < unsigned > BoyerMooreHorspool::match ( const tree::PrefixRankedBarTre
// match of symbol // match of symbol
offset = offset - 1; offset = offset - 1;
j = j - 1; j = j - 1;
} else if ( ( pattern.getContent ( )[j] == pattern.getVariablesBar ( ) ) && ( pattern.getBars ( ).count ( subject.getContent ( )[offset] ) ) ) { } else if ( ( pattern.getContent ( )[j] == pattern.getVariablesBar ( ) ) /* && ( pattern.getBars ( ).count ( subject.getContent ( )[offset] ) ) */ ) {
// match of variable with subtree // match of variable with subtree
offset = subjectSubtreeJumpTable[offset]; offset = subjectSubtreeJumpTable[offset];
j = j - 2; j = j - 2;
...@@ -119,7 +119,7 @@ ext::set < unsigned > BoyerMooreHorspool::match ( const tree::PrefixRankedBarTre ...@@ -119,7 +119,7 @@ ext::set < unsigned > BoyerMooreHorspool::match ( const tree::PrefixRankedBarTre
// match of symbol // match of symbol
offset = offset - 1; offset = offset - 1;
j = j - 1; j = j - 1;
} else if ( ( pattern.getContent ( )[j] == pattern.getVariablesBar ( ) ) && ( pattern.getBars ( ).count ( subject.getContent ( )[offset] )) ) { } else if ( ( pattern.getContent ( )[j] == pattern.getVariablesBar ( ) ) /* && ( pattern.getBars ( ).count ( subject.getContent ( )[offset] ) ) */ ) {
// else match of variable with subtree // else match of variable with subtree
offset = subjectSubtreeJumpTable[offset]; offset = subjectSubtreeJumpTable[offset];
j = j - 2; j = j - 2;
......
...@@ -85,7 +85,7 @@ void DeadZoneUsingBadCharacterShiftAndBorderArray::match_rec ( ext::set < unsign ...@@ -85,7 +85,7 @@ void DeadZoneUsingBadCharacterShiftAndBorderArray::match_rec ( ext::set < unsign
// match of symbol // match of symbol
offset++; offset++;
j++; j++;
} else if ( ( pattern.getContent ( )[j] == pattern.getSubtreeWildcard ( ) ) && ( ! pattern.getBars ( ).count ( subject.getContent ( )[offset] ) ) ) { } else if ( ( pattern.getContent ( )[j] == pattern.getSubtreeWildcard ( ) ) /* && ( ! pattern.getBars ( ).count ( subject.getContent ( )[offset] ) ) */ ) {
// match of variable with subtree // match of variable with subtree
offset = subjectSubtreeJumpTable[offset]; offset = subjectSubtreeJumpTable[offset];
j += 2; j += 2;
......
...@@ -73,7 +73,7 @@ ext::set < unsigned > KnuthMorrisPratt::match ( const tree::PrefixRankedBarTree ...@@ -73,7 +73,7 @@ ext::set < unsigned > KnuthMorrisPratt::match ( const tree::PrefixRankedBarTree
// match of symbol // match of symbol
offset++; offset++;
j++; j++;
} else if ( ( pattern.getContent ( )[j] == pattern.getSubtreeWildcard ( ) ) && ( ! pattern.getBars ( ).count ( subject.getContent ( )[offset] ) ) ) { } else if ( ( pattern.getContent ( )[j] == pattern.getSubtreeWildcard ( ) ) /* && ( ! pattern.getBars ( ).count ( subject.getContent ( )[offset] ) ) */ ) {
// match of variable with subtree // match of variable with subtree
offset = subjectSubtreeJumpTable[offset]; offset = subjectSubtreeJumpTable[offset];
j += 2; j += 2;
......
...@@ -80,7 +80,7 @@ ext::set < unsigned > ReversedBoyerMooreHorspool::match ( const tree::PrefixRank ...@@ -80,7 +80,7 @@ ext::set < unsigned > ReversedBoyerMooreHorspool::match ( const tree::PrefixRank
// match of symbol // match of symbol
offset = offset + 1; offset = offset + 1;
j = j + 1; j = j + 1;
} else if ( ( pattern.getContent ( )[j] == pattern.getSubtreeWildcard ( ) ) && ( ! pattern.getBars ( ).count ( subject.getContent ( )[offset] ) ) ) { } else if ( ( pattern.getContent ( )[j] == pattern.getSubtreeWildcard ( ) ) /* && ( ! pattern.getBars ( ).count ( subject.getContent ( )[offset] ) ) */ ) {
// match of variable with subtree // match of variable with subtree
offset = subjectSubtreeJumpTable[offset]; offset = subjectSubtreeJumpTable[offset];
j = j + 2; j = j + 2;
...@@ -127,7 +127,7 @@ ext::set < unsigned > ReversedBoyerMooreHorspool::match ( const tree::PrefixRank ...@@ -127,7 +127,7 @@ ext::set < unsigned > ReversedBoyerMooreHorspool::match ( const tree::PrefixRank
// match of symbol // match of symbol
offset = offset + 1; offset = offset + 1;
j = j + 1; j = j + 1;
} else if ( ( pattern.getContent ( )[j] == pattern.getSubtreeWildcard ( ) || pattern.getNonlinearVariables ( ).count ( pattern.getContent ( )[j] ) ) && ( ! pattern.getBars ( ).count ( subject.getContent ( )[offset] ) ) ) { } else if ( ( pattern.getContent ( )[j] == pattern.getSubtreeWildcard ( ) || pattern.getNonlinearVariables ( ).count ( pattern.getContent ( )[j] ) ) /* && ( ! pattern.getBars ( ).count ( subject.getContent ( )[offset] ) ) */ ) {
// check nonlinear variable // check nonlinear variable
if ( pattern.getNonlinearVariables ( ).count ( pattern.getContent ( )[ j ] ) ) { if ( pattern.getNonlinearVariables ( ).count ( pattern.getContent ( )[ j ] ) ) {
auto setting = variablesSetting.find ( pattern.getContent ( )[ j ] ); auto setting = variablesSetting.find ( pattern.getContent ( )[ j ] );
......
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