本文整理汇总了C++中IndexRange::isAscending方法的典型用法代码示例。如果您正苦于以下问题:C++ IndexRange::isAscending方法的具体用法?C++ IndexRange::isAscending怎么用?C++ IndexRange::isAscending使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IndexRange
的用法示例。
在下文中一共展示了IndexRange::isAscending方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runtime_error
void
PredictorMfe2dHeuristic::
predict( const IndexRange & r1
, const IndexRange & r2
, const OutputConstraint & outConstraint
)
{
#if INTARNA_MULITHREADING
#pragma omp critical(intarna_omp_logOutput)
#endif
{ VLOG(2) <<"predicting mfe interactions heuristically in O(n^2) space and time..."; }
// measure timing
TIMED_FUNC_IF(timerObj,VLOG_IS_ON(9));
#if INTARNA_IN_DEBUG_MODE
// check indices
if (!(r1.isAscending() && r2.isAscending()) )
throw std::runtime_error("PredictorMfe2dHeuristic::predict("+toString(r1)+","+toString(r2)+") is not sane");
#endif
// set index offset
energy.setOffset1(r1.from);
energy.setOffset2(r2.from);
// resize matrix
hybridE.resize( std::min( energy.size1()
, (r1.to==RnaSequence::lastPos?energy.size1()-1:r1.to)-r1.from+1 )
, std::min( energy.size2()
, (r2.to==RnaSequence::lastPos?energy.size2()-1:r2.to)-r2.from+1 ) );
// temp vars
size_t i1,i2,w1,w2;
// init matrix
bool isValidCell = true;
for (i1=0; i1<hybridE.size1(); i1++) {
for (i2=0; i2<hybridE.size2(); i2++) {
// check if positions can form interaction
if ( energy.isAccessible1(i1)
&& energy.isAccessible2(i2)
&& energy.areComplementary(i1,i2) )
{
// set to interaction initiation with according boundary
hybridE(i1,i2) = BestInteraction(energy.getE_init(), i1, i2);
} else {
// set to infinity, ie not used
hybridE(i1,i2) = BestInteraction(E_INF, RnaSequence::lastPos, RnaSequence::lastPos);
}
} // i2
} // i1
// init mfe for later updates
initOptima( outConstraint );
// compute table and update mfeInteraction
fillHybridE();
// trace back and output handler update
reportOptima( outConstraint );
}