Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
NonlinearFullAndLinearIndex.h
Go to the documentation of this file.
1
6/*
7 * This file is part of Algorithms library toolkit.
8 * Copyright (C) 2017 Jan Travnicek (jan.travnicek@fit.cvut.cz)
9
10 * Algorithms library toolkit is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14
15 * Algorithms library toolkit is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19
20 * You should have received a copy of the GNU General Public License
21 * along with Algorithms library toolkit. If not, see <http://www.gnu.org/licenses/>.
22 */
23
24#pragma once
25
27
29#include <core/xmlApi.hpp>
30
33
35
37
38namespace core {
39
40template < class SymbolType, template < typename > class StringIndex >
41struct xmlApi < indexes::arbology::NonlinearFullAndLinearIndex < SymbolType, StringIndex > > {
43 static bool first ( const ext::deque < sax::Token >::const_iterator & input );
44 static std::string xmlTagName ( );
46};
47
48template < class SymbolType, template < typename > class StringIndex >
51 StringIndex < common::ranked_symbol < SymbolType > > stringIndex = core::xmlApi < StringIndex < common::ranked_symbol < SymbolType > > >::parse ( input );
54
55 indexes::arbology::NonlinearFullAndLinearIndex < SymbolType, StringIndex > res ( std::move ( stringIndex ), std::move ( jumps ), std::move ( repeats ) );
56
58 return res;
59}
60
61template < class SymbolType, template < typename > class StringIndex >
64}
65
66template < class SymbolType, template < typename > class StringIndex >
68 return "NonlinearFullAndLinearIndex";
69}
70
71template < class SymbolType, template < typename > class StringIndex >
73 output.emplace_back ( xmlTagName ( ), sax::Token::TokenType::START_ELEMENT );
75 core::xmlApi < ext::vector < int > >::compose ( output, index.getJumps ( ) );
76 core::xmlApi < ext::vector < unsigned > >::compose ( output, index.getRepeats ( ) );
77 output.emplace_back ( xmlTagName ( ), sax::Token::TokenType::END_ELEMENT );
78}
79
80} /* namespace core */
81
Class extending the deque class from the standard library. Original reason is to allow printing of th...
Definition: deque.hpp:44
Class extending the vector class from the standard library. Original reason is to allow printing of t...
Definition: vector.hpp:45
Full and linear tree index. The index serves as a adaptor of string index so that searching for tree ...
Definition: NonlinearFullAndLinearIndex.h:50
const ext::vector< unsigned > & getRepeats() const &
Definition: NonlinearFullAndLinearIndex.h:220
const StringIndex< common::ranked_symbol< SymbolType > > & getStringIndex() const &
Definition: NonlinearFullAndLinearIndex.h:200
const ext::vector< int > & getJumps() const &
Definition: NonlinearFullAndLinearIndex.h:210
static void popToken(ext::deque< Token >::iterator &input, Token::TokenType type, const std::string &data)
Definition: FromXMLParserHelper.cpp:39
static bool isToken(ext::deque< Token >::const_iterator input, Token::TokenType type, const std::string &data)
Definition: FromXMLParserHelper.cpp:29
return res
Definition: MinimizeByPartitioning.h:145
Definition: normalize.hpp:10
Definition: CompressedBitParallelTreeIndex.h:40
Definition: xmlApi.hpp:27