本文整理匯總了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));
}
示例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;
}
示例3: return
bool Interval::operator<(const Interval & b) const {
if(getStart() == b.getStart()){
return (getStop() < b.getStop());
}
return (getStart() < b.getStart());
}
示例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;
}
示例5: intersects
bool Interval::intersects(Interval & interval) {
return !(_end - 1 < interval.getStart() ||
interval.getEnd() - 1 < _start);
}