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

+ normalize methods in Base and Wrapper classes

parent cf7418da
No related branches found
No related tags found
No related merge requests found
Showing with 21 additions and 9 deletions
...@@ -67,6 +67,8 @@ public: ...@@ -67,6 +67,8 @@ public:
   
template< typename T > template< typename T >
class CommonBase : public CommonBaseMiddle < T > { class CommonBase : public CommonBaseMiddle < T > {
public:
virtual T * normalize ( ) && = 0;
}; };
   
} /* namespace alib */ } /* namespace alib */
......
...@@ -125,6 +125,10 @@ class WrapperBase : public WrapperBaseMiddle < T > { ...@@ -125,6 +125,10 @@ class WrapperBase : public WrapperBaseMiddle < T > {
public: public:
using WrapperBaseMiddle < T >::WrapperBaseMiddle; using WrapperBaseMiddle < T >::WrapperBaseMiddle;
   
void normalize ( ) {
this->setData ( std::move ( this->getData ( ) ).normalize ( ) );
}
}; };
   
} /* namespace alib */ } /* namespace alib */
......
...@@ -26,6 +26,8 @@ public: ...@@ -26,6 +26,8 @@ public:
virtual ObjectBase * plunder() && = 0; virtual ObjectBase * plunder() && = 0;
   
virtual ObjectBase * inc() && = 0; virtual ObjectBase * inc() && = 0;
virtual ObjectBase * normalize() && = 0;
}; };
   
} /* namespace alib */ } /* namespace alib */
......
...@@ -115,7 +115,7 @@ public: ...@@ -115,7 +115,7 @@ public:
virtual alib::ObjectBase * inc ( ) &&; virtual alib::ObjectBase * inc ( ) &&;
   
virtual ObjectBase * normalize ( ) && { virtual ObjectBase * normalize ( ) && {
indexes::stringology::PositionHeap < DefaultSymbolType > stringIndex = manage_move ( std::move ( m_StringIndex ).normalize ( ) ); indexes::stringology::PositionHeap < DefaultSymbolType > stringIndex = std::move ( m_StringIndex ).normalizeRaw ( );
   
return new FullAndLinearIndex < > ( std::move ( stringIndex ), std::move ( m_JumpTable ) ); return new FullAndLinearIndex < > ( std::move ( stringIndex ), std::move ( m_JumpTable ) );
} }
......
...@@ -122,12 +122,16 @@ public: ...@@ -122,12 +122,16 @@ public:
   
virtual alib::ObjectBase * inc ( ) &&; virtual alib::ObjectBase * inc ( ) &&;
   
virtual PositionHeap < > * normalize ( ) && { PositionHeap < > normalizeRaw ( ) && {
std::set < DefaultSymbolType > alphabet = alphabet::SymbolNormalize::normalizeAlphabet ( std::move ( this->template accessComponent < GeneralAlphabet > ( ).get ( ) ) ); std::set < DefaultSymbolType > alphabet = alphabet::SymbolNormalize::normalizeAlphabet ( std::move ( this->template accessComponent < GeneralAlphabet > ( ).get ( ) ) );
std::trie < DefaultSymbolType, unsigned > trie = IndexesNormalize::normalizeTrie ( std::move ( m_trie ) ); std::trie < DefaultSymbolType, unsigned > trie = IndexesNormalize::normalizeTrie ( std::move ( m_trie ) );
std::vector < DefaultSymbolType > string = alphabet::SymbolNormalize::normalizeSymbols ( std::move ( m_string ) ); std::vector < DefaultSymbolType > string = alphabet::SymbolNormalize::normalizeSymbols ( std::move ( m_string ) );
   
return new PositionHeap < > ( std::move ( alphabet ), std::move ( trie ), std::move ( string ) ); return PositionHeap < > ( std::move ( alphabet ), std::move ( trie ), std::move ( string ) );
}
virtual alib::ObjectBase * normalize ( ) && {
return std::move ( * this ).normalizeRaw ( ).plunder ( );
} }
}; };
   
......
...@@ -122,7 +122,7 @@ public: ...@@ -122,7 +122,7 @@ public:
   
virtual alib::ObjectBase * inc ( ) &&; virtual alib::ObjectBase * inc ( ) &&;
   
virtual SuffixTrie < > * normalize ( ) && { virtual alib::ObjectBase * normalize ( ) && {
std::set < DefaultSymbolType > alphabet = alphabet::SymbolNormalize::normalizeAlphabet ( std::move ( this->template accessComponent < GeneralAlphabet > ( ).get ( ) ) ); std::set < DefaultSymbolType > alphabet = alphabet::SymbolNormalize::normalizeAlphabet ( std::move ( this->template accessComponent < GeneralAlphabet > ( ).get ( ) ) );
std::trie < DefaultSymbolType, std::variant < void, unsigned > > trie = IndexesNormalize::normalizeTrie ( std::move ( m_trie ) ); std::trie < DefaultSymbolType, std::variant < void, unsigned > > trie = IndexesNormalize::normalizeTrie ( std::move ( m_trie ) );
   
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
namespace rte { namespace rte {
   
template < class SymbolType, class RankType > template < class SymbolType, class RankType >
class FormalRTEElement : public alib::CommonBase < FormalRTEElement < SymbolType, RankType > >, public std::BaseNode < FormalRTEElement < SymbolType, RankType > > { class FormalRTEElement : public alib::CommonBaseMiddle < FormalRTEElement < SymbolType, RankType > >, public std::BaseNode < FormalRTEElement < SymbolType, RankType > > {
public: public:
class Visitor { class Visitor {
public: public:
......
...@@ -91,7 +91,7 @@ public: ...@@ -91,7 +91,7 @@ public:
   
alib::ObjectBase * inc ( ) && override; alib::ObjectBase * inc ( ) && override;
   
virtual AdjacencyListDirectedGraph * normalize ( ) && { virtual AdjacencyListDirectedGraph * normalize ( ) && override {
return this; return this;
} }
}; };
......
...@@ -94,7 +94,7 @@ public: ...@@ -94,7 +94,7 @@ public:
   
alib::ObjectBase * inc ( ) && override; alib::ObjectBase * inc ( ) && override;
   
virtual AdjacencyMatrixDirectedGraph * normalize ( ) && { virtual AdjacencyMatrixDirectedGraph * normalize ( ) && override {
return this; return this;
} }
}; };
......
...@@ -88,7 +88,7 @@ public: ...@@ -88,7 +88,7 @@ public:
   
alib::ObjectBase * inc ( ) && override; alib::ObjectBase * inc ( ) && override;
   
virtual AdjacencyListUndirectedGraph * normalize ( ) && { virtual AdjacencyListUndirectedGraph * normalize ( ) && override {
return this; return this;
} }
}; };
......
...@@ -91,7 +91,7 @@ public: ...@@ -91,7 +91,7 @@ public:
   
alib::ObjectBase * inc ( ) && override; alib::ObjectBase * inc ( ) && override;
   
virtual AdjacencyMatrixUndirectedGraph * normalize ( ) && { virtual AdjacencyMatrixUndirectedGraph * normalize ( ) && override {
return this; return this;
} }
}; };
......
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