當前位置: 首頁>>代碼示例>>C++>>正文


C++ Interval::getStart方法代碼示例

本文整理匯總了C++中Interval::getStart方法的典型用法代碼示例。如果您正苦於以下問題:C++ Interval::getStart方法的具體用法?C++ Interval::getStart怎麽用?C++ Interval::getStart使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Interval的用法示例。


在下文中一共展示了Interval::getStart方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: testIntersect

    void testIntersect()
    {
        SequenceInterval int1("foo", 1, 100);
        SequenceInterval int2("foo", 80, 1000);

        SequenceInterval int3(int1);
        SequenceInterval int4(int2);

        SequenceInterval int5(int1);
        SequenceInterval int6("foo", 101, 1000);

        SequenceInterval int7("foo", 200, 1000);

        CPPUNIT_ASSERT(int1.intersects(int2));

        Interval int12 = int1.intersect(int2);
        CPPUNIT_ASSERT_EQUAL(80, int12.getStart());
        CPPUNIT_ASSERT_EQUAL(100, int12.getEnd());

        int3 += int4;
        CPPUNIT_ASSERT_EQUAL(1, int3.getStart());
        CPPUNIT_ASSERT_EQUAL(1000, int3.getEnd());

        Interval tint = int3 + int4;
        CPPUNIT_ASSERT_EQUAL(1, tint.getStart());
        CPPUNIT_ASSERT_EQUAL(1000, tint.getEnd());

        int5 += int6;
        CPPUNIT_ASSERT_EQUAL(1, int5.getStart());
        CPPUNIT_ASSERT_EQUAL(1000, int5.getEnd());

        CPPUNIT_ASSERT(int1.intersects(int7, 100));
    }
開發者ID:Brainiarc7,項目名稱:TS,代碼行數:33,代碼來源:IntervalTest.hpp

示例2: next

  bool Range::next(string & chrom, Interval & intv){
    if(!on_chromosome) return false;
    chrom = chr;
    
    while(!recurse.empty()){
      Cargo c = recurse.top();
      Interval i = cvector.at(c.root);
      if(d.getStart() >= i.getSubMax()){
	recurse.pop();
      }else{
	if(!c.goLeft){
	  //check this one, pop, then put right on top if it exists and start is less than i stop
	  recurse.pop();
	  if(d.getStop() > i.getStart()){
	    Capacity root;
	    if(getMidpoint(c.root+1, c.high, root)){
	      recurse.push(Cargo(c.root+1, c.high, root));
	    }
	  
	    if(i.overlaps(d)){
	      intv = i;
	      return true;
	    }
	  }//else this node and right children do not overlap d
	}else{
	  recurse.top().goLeft = false;
	  //go left
	  Capacity root;
	  if(getMidpoint(c.low, c.root, root)){
	    recurse.push(Cargo(c.low, c.root, root));
	  }
	}
      }
    }
    return false;
  }
開發者ID:jtb,項目名稱:RIVALS,代碼行數:36,代碼來源:range.cpp

示例3: return

 bool Interval::operator<(const Interval & b) const {
   if(getStart() == b.getStart()){
     return (getStop() < b.getStop());
   }
   return (getStart() < b.getStart());
 }
開發者ID:jtb,項目名稱:RIVALS,代碼行數:6,代碼來源:interval.cpp

示例4: overlaps

 bool Interval::overlaps(const Interval & b, bool strand_specific){
   if(getStrand() == b.getStrand() || getStrand() == BOTH || b.getStrand() == BOTH || !strand_specific){
     return (getStart() < b.getStop() && b.getStart() < getStop());
   }
   return false;
 }
開發者ID:jtb,項目名稱:RIVALS,代碼行數:6,代碼來源:interval.cpp

示例5: intersects

bool Interval::intersects(Interval & interval) {
    return !(_end - 1 < interval.getStart() ||
             interval.getEnd() - 1  < _start);
}
開發者ID:rjawor,項目名稱:concordia,代碼行數:4,代碼來源:interval.cpp


注:本文中的Interval::getStart方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。