SDSL: Succinct Data Structure Library
A C++ template library for succinct data structures
|
00001 /* sdsl - succinct data structures library 00002 Copyright (C) 2008 Simon Gog 00003 00004 This program is free software: you can redistribute it and/or modify 00005 it under the terms of the GNU General Public License as published by 00006 the Free Software Foundation, either version 3 of the License, or 00007 (at your option) any later version. 00008 00009 This program is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 GNU General Public License for more details. 00013 00014 You should have received a copy of the GNU General Public License 00015 along with this program. If not, see http://www.gnu.org/licenses/ . 00016 */ 00021 #ifndef INCLUDED_SDSL_SELECT_SUPPORT 00022 #define INCLUDED_SDSL_SELECT_SUPPORT 00023 00028 #include "int_vector.hpp" 00029 #include "rank_support.hpp" 00030 00032 namespace sdsl 00033 { 00035 00037 class select_support 00038 { 00039 protected: 00040 const int_vector<1>* m_v; 00041 public: 00042 typedef int_vector<1>::size_type size_type; 00043 const bit_vector* v; 00044 00046 00048 select_support(const int_vector<1>* f_v=NULL):v(f_v) { 00049 m_v = f_v; 00050 } 00052 00055 select_support(const select_support& f_v); 00057 virtual ~select_support() {}; 00059 00065 virtual void init(const int_vector<1>* v=NULL) = 0; 00067 00072 virtual const size_type select(size_type i) const = 0; 00073 00075 virtual const size_type operator()(size_type i) const = 0; 00077 virtual size_type serialize(std::ostream& out, structure_tree_node* v, std::string name)const = 0; 00079 00086 virtual void load(std::istream& in, const int_vector<1>* v=NULL) = 0; 00087 00089 00092 virtual void set_vector(const int_vector<1>* v=NULL) = 0; 00093 }; 00094 00095 00096 } // end namespace sdsl 00097 00098 #include "select_support_bs.hpp" 00099 #include "select_support_mcl.hpp" 00100 #include "select_support_dummy.hpp" 00101 00102 #endif