From 08ebf0517b829019fa35d25bf2d6e030f1ea75a2 Mon Sep 17 00:00:00 2001 From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz> Date: Wed, 20 Sep 2017 07:58:55 +0200 Subject: [PATCH] add moves in some algos --- .../indexing/CompressedBitParallelIndexConstruction.h | 2 +- .../NonlinearCompressedBitParallelIndexConstruction.h | 2 +- .../indexing/NonlinearFullAndLinearIndexConstruction.h | 2 +- .../src/stringology/indexing/BitParallelIndexConstruction.h | 2 +- .../indexing/CompressedBitParallelIndexConstruction.h | 2 +- alib2algo/src/stringology/indexing/PositionHeapNaive.h | 2 +- alib2algo/src/stringology/indexing/SuffixArrayNaive.h | 2 +- alib2algo/src/stringology/indexing/SuffixTrieNaive.h | 2 +- alib2algo/src/tree/properties/ExactSubtreeRepeats.h | 2 +- alib2algo/src/tree/properties/ExactSubtreeRepeatsNaive.h | 6 +++--- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/alib2algo/src/arbology/indexing/CompressedBitParallelIndexConstruction.h b/alib2algo/src/arbology/indexing/CompressedBitParallelIndexConstruction.h index 5608225183..cb96d29772 100644 --- a/alib2algo/src/arbology/indexing/CompressedBitParallelIndexConstruction.h +++ b/alib2algo/src/arbology/indexing/CompressedBitParallelIndexConstruction.h @@ -60,7 +60,7 @@ indexes::arbology::CompressedBitParallelTreeIndex < SymbolType, RankType > Compr for ( unsigned i = 0; i < w.getContent ( ).size ( ); ++i ) res [ w.getContent ( ) [ i ] ] [ i ] = true; - return indexes::arbology::CompressedBitParallelTreeIndex < SymbolType, RankType > ( w.getAlphabet ( ), res, tree::properties::SubtreeJumpTable::compute ( w ) ); + return indexes::arbology::CompressedBitParallelTreeIndex < SymbolType, RankType > ( w.getAlphabet ( ), std::move ( res ), tree::properties::SubtreeJumpTable::compute ( w ) ); } } /* namespace indexing */ diff --git a/alib2algo/src/arbology/indexing/NonlinearCompressedBitParallelIndexConstruction.h b/alib2algo/src/arbology/indexing/NonlinearCompressedBitParallelIndexConstruction.h index 0ac504d5b8..1ccf335c47 100644 --- a/alib2algo/src/arbology/indexing/NonlinearCompressedBitParallelIndexConstruction.h +++ b/alib2algo/src/arbology/indexing/NonlinearCompressedBitParallelIndexConstruction.h @@ -50,7 +50,7 @@ indexes::arbology::NonlinearCompressedBitParallelTreeIndex < SymbolType, RankTyp for ( const common::ranked_symbol < unsigned, RankType > & symbol : content ) repeats.push_back ( symbol.getSymbol ( ) ); - return indexes::arbology::NonlinearCompressedBitParallelTreeIndex < SymbolType, RankType > ( w.getAlphabet ( ), res, tree::properties::SubtreeJumpTable::compute ( w ), repeats ); + return indexes::arbology::NonlinearCompressedBitParallelTreeIndex < SymbolType, RankType > ( w.getAlphabet ( ), std::move ( res ), tree::properties::SubtreeJumpTable::compute ( w ), std::move ( repeats ) ); } } /* namespace indexing */ diff --git a/alib2algo/src/arbology/indexing/NonlinearFullAndLinearIndexConstruction.h b/alib2algo/src/arbology/indexing/NonlinearFullAndLinearIndexConstruction.h index bae064d733..f5e68d9e11 100644 --- a/alib2algo/src/arbology/indexing/NonlinearFullAndLinearIndexConstruction.h +++ b/alib2algo/src/arbology/indexing/NonlinearFullAndLinearIndexConstruction.h @@ -56,7 +56,7 @@ indexes::arbology::NonlinearFullAndLinearIndex < SymbolType, RankType > Nonlinea for ( const common::ranked_symbol < unsigned, RankType > & symbol : content ) repeats.push_back ( symbol.getSymbol ( ) ); - return indexes::arbology::NonlinearFullAndLinearIndex < SymbolType, RankType > ( stringology::indexing::PositionHeapNaive::construct ( string::LinearString < common::ranked_symbol < SymbolType, RankType > > ( w ) ), tree::properties::SubtreeJumpTable::compute ( w ), repeats ); + return indexes::arbology::NonlinearFullAndLinearIndex < SymbolType, RankType > ( stringology::indexing::PositionHeapNaive::construct ( string::LinearString < common::ranked_symbol < SymbolType, RankType > > ( w ) ), tree::properties::SubtreeJumpTable::compute ( w ), std::move ( repeats ) ); } } /* namespace indexing */ diff --git a/alib2algo/src/stringology/indexing/BitParallelIndexConstruction.h b/alib2algo/src/stringology/indexing/BitParallelIndexConstruction.h index 99c69bcacd..f5a583f4a7 100644 --- a/alib2algo/src/stringology/indexing/BitParallelIndexConstruction.h +++ b/alib2algo/src/stringology/indexing/BitParallelIndexConstruction.h @@ -42,7 +42,7 @@ indexes::stringology::BitParallelIndex < SymbolType > BitParallelIndexConstructi for ( unsigned i = 0; i < w.getContent ( ).size ( ); ++i ) res [ w.getContent ( ) [ i ] ] [ i ] = true; - return indexes::stringology::BitParallelIndex < SymbolType > ( w.getAlphabet ( ), res ); + return indexes::stringology::BitParallelIndex < SymbolType > ( w.getAlphabet ( ), std::move ( res ) ); } } /* namespace indexing */ diff --git a/alib2algo/src/stringology/indexing/CompressedBitParallelIndexConstruction.h b/alib2algo/src/stringology/indexing/CompressedBitParallelIndexConstruction.h index 3ee436e590..32b35757d7 100644 --- a/alib2algo/src/stringology/indexing/CompressedBitParallelIndexConstruction.h +++ b/alib2algo/src/stringology/indexing/CompressedBitParallelIndexConstruction.h @@ -42,7 +42,7 @@ indexes::stringology::CompressedBitParallelIndex < SymbolType > CompressedBitPar for ( unsigned i = 0; i < w.getContent ( ).size ( ); ++i ) res [ w.getContent ( ) [ i ] ] [ i ] = true; - return indexes::stringology::CompressedBitParallelIndex < SymbolType > ( w.getAlphabet ( ), res ); + return indexes::stringology::CompressedBitParallelIndex < SymbolType > ( w.getAlphabet ( ), std::move ( res ) ); } } /* namespace indexing */ diff --git a/alib2algo/src/stringology/indexing/PositionHeapNaive.h b/alib2algo/src/stringology/indexing/PositionHeapNaive.h index 520d723e06..2b98cd6cc4 100644 --- a/alib2algo/src/stringology/indexing/PositionHeapNaive.h +++ b/alib2algo/src/stringology/indexing/PositionHeapNaive.h @@ -53,7 +53,7 @@ indexes::stringology::PositionHeap < SymbolType > PositionHeapNaive::construct ( n = & n->getChildren ( ).insert ( std::make_pair ( w.getContent ( )[k], ext::trie < SymbolType, unsigned > ( node ) ) ).first->second; } - return indexes::stringology::PositionHeap < SymbolType > ( w.getAlphabet ( ), trie, w.getContent ( ) ); + return indexes::stringology::PositionHeap < SymbolType > ( w.getAlphabet ( ), std::move ( trie ), w.getContent ( ) ); } } /* namespace indexing */ diff --git a/alib2algo/src/stringology/indexing/SuffixArrayNaive.h b/alib2algo/src/stringology/indexing/SuffixArrayNaive.h index 8ab969e79b..977d008183 100644 --- a/alib2algo/src/stringology/indexing/SuffixArrayNaive.h +++ b/alib2algo/src/stringology/indexing/SuffixArrayNaive.h @@ -53,7 +53,7 @@ indexes::stringology::SuffixArray < SymbolType > SuffixArrayNaive::construct ( c return first > second; } ); - return indexes::stringology::SuffixArray < SymbolType > ( w.getAlphabet ( ), data, w.getContent ( ) ); + return indexes::stringology::SuffixArray < SymbolType > ( w.getAlphabet ( ), std::move ( data ), w.getContent ( ) ); } } /* namespace indexing */ diff --git a/alib2algo/src/stringology/indexing/SuffixTrieNaive.h b/alib2algo/src/stringology/indexing/SuffixTrieNaive.h index 36adf70ea7..463293a9d0 100644 --- a/alib2algo/src/stringology/indexing/SuffixTrieNaive.h +++ b/alib2algo/src/stringology/indexing/SuffixTrieNaive.h @@ -51,7 +51,7 @@ indexes::stringology::SuffixTrie < SymbolType > SuffixTrieNaive::construct ( con } } - return indexes::stringology::SuffixTrie < SymbolType > ( w.getAlphabet ( ), trie ); + return indexes::stringology::SuffixTrie < SymbolType > ( w.getAlphabet ( ), std::move ( trie ) ); } } /* namespace indexing */ diff --git a/alib2algo/src/tree/properties/ExactSubtreeRepeats.h b/alib2algo/src/tree/properties/ExactSubtreeRepeats.h index 0fcd939580..138f95d8f7 100644 --- a/alib2algo/src/tree/properties/ExactSubtreeRepeats.h +++ b/alib2algo/src/tree/properties/ExactSubtreeRepeats.h @@ -507,7 +507,7 @@ tree::PostfixRankedTree < unsigned, RankType > ExactSubtreeRepeats::repeats ( co repeatsPostfixRanked ( tree.getContent ( ), res ); - return tree::PostfixRankedTree < unsigned, RankType > ( res ); + return tree::PostfixRankedTree < unsigned, RankType > ( std::move ( res ) ); } } /* namespace properties */ diff --git a/alib2algo/src/tree/properties/ExactSubtreeRepeatsNaive.h b/alib2algo/src/tree/properties/ExactSubtreeRepeatsNaive.h index f6e43f88a9..6a1d2e17ff 100644 --- a/alib2algo/src/tree/properties/ExactSubtreeRepeatsNaive.h +++ b/alib2algo/src/tree/properties/ExactSubtreeRepeatsNaive.h @@ -110,7 +110,7 @@ tree::PrefixRankedTree < unsigned, RankType > ExactSubtreeRepeatsNaive::repeats ext::map < std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < common::ranked_symbol < unsigned, RankType > > >, unsigned > data; repeatsPrefixRanked ( tree.getContent ( ), res, data, minId, index ); - return tree::PrefixRankedTree < unsigned, RankType > ( res ); + return tree::PrefixRankedTree < unsigned, RankType > ( std::move ( res ) ); } template < class SymbolType, class RankType > @@ -143,7 +143,7 @@ tree::PostfixRankedTree < unsigned, RankType > ExactSubtreeRepeatsNaive::repeats ext::map < std::pair < common::ranked_symbol < SymbolType, RankType >, ext::vector < common::ranked_symbol < unsigned, RankType > > >, unsigned > data; repeatsPostfixRanked ( tree.getContent ( ), res, data, minId, index ); - return tree::PostfixRankedTree < unsigned, RankType > ( res ); + return tree::PostfixRankedTree < unsigned, RankType > ( std::move ( res ) ); } @@ -184,7 +184,7 @@ tree::PrefixRankedBarTree < unsigned, RankType > ExactSubtreeRepeatsNaive::repea for ( const common::ranked_symbol < SymbolType, RankType > & bar : tree.getBars ( ) ) bars.insert ( common::ranked_symbol < unsigned, RankType > ( barId, bar.getRank ( ) ) ); - return tree::PrefixRankedBarTree < unsigned, RankType > ( bars, res ); + return tree::PrefixRankedBarTree < unsigned, RankType > ( std::move ( bars ), std::move ( res ) ); } } /* namespace properties */ -- GitLab