libMems/LCB.h

Go to the documentation of this file.
00001 #ifdef HAVE_CONFIG_H
00002 #include "config.h"
00003 #endif
00004 
00005 #ifndef __LCB_h__
00006 #define __LCB_h__
00007 
00008 #include <vector>
00009 #include <libGenome/gnDefs.h>
00010 
00011 namespace mems {
00012 
00016 class LCB{
00017 public:
00018         LCB() : lcb_id(0), weight(0), to_be_deleted(false) {};
00019         std::vector< int64 > left_end;  
00020         std::vector< int64 > right_end;  
00021         std::vector< uint > left_adjacency;     
00022         std::vector< uint > right_adjacency;    
00023         int lcb_id;                     
00024         double weight;          
00025         bool to_be_deleted;     
00026 };
00027 
00032 class LCBLeftComparator {
00033 public:
00034         LCBLeftComparator( uint seq ) : m_seq(seq){};
00035         bool operator()(const LCB& a, const LCB& b) const{
00036                 
00037                 int64 a_start = a.left_end[ m_seq ], b_start = b.left_end[ m_seq ];
00038                 if( a_start == NO_MATCH || b_start == NO_MATCH ){
00039                         if( b_start != NO_MATCH )
00040                                 return true;
00041                         return false;
00042                 }
00043                 if(a_start < 0)
00044                         a_start = -a_start;
00045                 if(b_start < 0)
00046                         b_start = -b_start;
00047 
00048                 int64 diff = a_start - b_start;
00049                 return diff < 0;
00050         }
00051 protected:
00052         uint m_seq;
00053 private:
00054         LCBLeftComparator();
00055 };
00056 
00057 class LCBIDComparator {
00058 public:
00059         bool operator()(const LCB& a, const LCB& b) const
00060         {
00061                 return a.lcb_id < b.lcb_id;
00062         }
00063 };
00064 
00065 
00066 } // namespace mems
00067 
00068 
00069 #endif  // __LCB_h__
00070 

Generated on Fri Mar 14 06:01:03 2008 for libMems by doxygen 1.3.6