ppALIGN API documentation
src/localbound.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 _LOCAL_BOUND_HPP_ 00022 #define _LOCAL_BOUND_HPP_ 00023 #include "partitionworkspace.hpp" 00024 00027 class DriverLocalBound : public PartitionDriverBase 00028 { 00029 public: 00032 DriverLocalBound(); 00033 00039 void SetStart(Pair pstart, 00040 Pair pend, 00041 long offset); 00042 00043 virtual bool NeedForward() { return true; } 00044 virtual bool NeedBackward() { return true; } 00045 00046 void BeforeComputation(); 00047 void AfterComputation(); 00048 00049 void OnForward(long i, 00050 const PartitionWorkspace::RowInfo & last_row, 00051 const PartitionWorkspace::RowInfo & curr_row, 00052 const PartitionWorkspace::const_iterator last, 00053 const PartitionWorkspace::const_iterator curr); 00054 void OnBackward(long i, 00055 const PartitionWorkspace::RowInfo & last_row, 00056 const PartitionWorkspace::RowInfo & curr_row, 00057 const PartitionWorkspace::const_iterator last, 00058 const PartitionWorkspace::const_iterator curr) ; 00059 void StreamOut(std::ostream & ost, 00060 Sequence & seq1, 00061 Sequence & seq2, 00062 Pair seq_offset, 00063 bool shortcut=false); 00064 private: 00065 inline void WriteRow(std::ostream & ost, 00066 std::vector<std::vector<xdouble> > & ws, 00067 long i, 00068 Pair & p1, 00069 Pair & p2, 00070 bool shortcut); 00071 00072 Pair pstart1,pstart2; 00073 Pair pend1,pend2; 00074 Sequence::const_iterator begin_seq1; 00075 Sequence::const_iterator begin_seq2; 00076 long length1,length2; 00077 std::vector<std::vector<xdouble> > start_ws; 00078 std::vector<std::vector<xdouble> > end_ws; 00079 ; 00080 }; 00081 00082 00083 #endif