Пример #1
0
static int findmatch_exec (TPosix *ud, TArgExec *argE) {
#ifdef REX_POSIX_EXT
    CheckStartEnd (argE, ud);
#else
    argE->text += argE->startoffset;
#endif
    return regexec (&ud->r, argE->text, ALG_NSUB(ud) + 1, ud->match, argE->eflags);
}
Пример #2
0
  void CumulativeDtwRunner::DTW(bool scoreOnly) {
    //FrameDtwRunner::DTW();
    // =========================================================
    qstart_ = qbound_ ? qbound_->first : 0;
    qend_ = qbound_ ? qbound_->second : -1;
    CheckStartEnd(*qparm_, &qstart_, &qend_, &qL_);

    dstart_ = dbound_ ? dbound_->first : 0;
    dend_ = dbound_ ? dbound_->second : -1;
    CheckStartEnd(*dparm_, &dstart_, &dend_, &dL_);

    pdist.Reset(&qparm_->Feat(), &dparm_->Feat(), qstart_, dstart_, qL_, dL_);
    MaxDelFrame();
    // =========================================================

    this->calcAlpha();
#ifndef NO_HHTT
    this->_cScore = score_(qL_ - 1, dL_ - 1);
#else
    this->_cScore = SMIN::eval(score_[qL_ - 1], dL_);
#endif

    /*if (qL_ + dL_ == 0)
      printf("qL_ + dL_ = %d\n", qL_ + dL_);
    else
      this->_cScore /= (qL_ + dL_);*/

    if (scoreOnly)
      return;

#ifdef DTW_SLOPE_CONSTRAINT
    if (this->_cScore == float_inf)
      return;
#endif
    this->calcBeta();

  }