ppALIGN API documentation
src/sampling.hpp
00001 /****************************************************************************** 00002 Copyright 2009 Stefan Wolfsheimer & Gregory Nuel. 00003 00004 This file is part of ppALIGN 00005 00006 ppALIGN is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or 00009 (at your option) any later version. 00010 00011 ppALIGN is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with ppALIGN; if not, write to the Free Software 00018 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00019 *******************************************************************************/ 00020 00021 #ifndef _SAMPLING_HPP_ 00022 #define _SAMPLING_HPP_ 00023 #include "partitionworkspace.hpp" 00024 00025 00051 class DriverSampling : public PartitionDriverBase 00052 { 00053 public: 00057 DriverSampling(DRand48 & _rng); 00058 00061 void SetNumber(size_t n); 00062 00065 size_t GetNumber(); 00066 00067 00068 virtual void OnMarkovChain(PartitionWorkspace::ForwardBackwardInfo & fb_info, 00069 Workspace<PartitionWorkspace::Transition> 00070 ::const_iterator curr_markov, 00071 const xdouble & row_z); 00072 virtual bool NeedMarkovChain() { return true; } 00073 00074 virtual void BeforeComputation(); 00075 virtual void AfterComputation(); 00076 00077 00078 private: 00081 DRand48 & rng; 00082 00083 00085 struct AlignPath 00086 { 00087 AlignState last_state; /*<- the last state in the alignment */ 00088 Pair pos; /*<- the last positions in the sequences 00089 if(pos.i == -2) the alignment is finished 00090 */ 00091 std::vector<Align>::iterator aitr; /*<- iterator to the alignment */ 00092 xdouble start_z; 00093 }; 00094 00097 size_t n_alignments; 00098 00104 std::vector<AlignPath> align_paths; 00105 00106 Sequence::const_iterator begin_seq1; 00107 Sequence::const_iterator begin_seq2; 00108 00109 00110 00111 }; 00112 00113 00114 00115 #endif