예제 #1
0
inline bool CRegExp::parseRE(int pos)
{
  if (error) return false;

  int toParse = pos;

  if (!positionMoves && (firstChar != BAD_WCHAR || firstMetaChar != ReBadMeta) && !quickCheck(toParse))
    return false;

  int i;
  for (i = 0; i < cMatch; i++)
    matches->s[i] = matches->e[i] = -1;
  matches->cMatch = cMatch;
#ifndef NAMED_MATCHES_IN_HASH
  for (i = 0; i < cnMatch; i++)
    matches->ns[i] = matches->ne[i] = -1;
  matches->cnMatch = cnMatch;
#endif
  do{
    if (lowParse(tree_root, 0, toParse)) return true;
    if (!positionMoves) return false;
    toParse = ++pos;
  }while(toParse <= end);
  return false;
};
예제 #2
0
파일: util.c 프로젝트: crcollins/mandelbrot
int insideMandelbrot(double cr, double ci, int maxIter)
{
    int i;
    double zr = 0.0;
    double zi = 0.0;
    if (quickCheck(cr, ci)) {
        return maxIter;
    }
    for (i=0; i < maxIter; i++) {
        iterateMandelbrot(&zr, &zi, cr, ci);
        if ((zr*zr + zi*zi) > 4.0) {
            return i;
        }
    }
    return maxIter;
}
예제 #3
0
파일: util.c 프로젝트: crcollins/mandelbrot
int getMandelbrotPath(double *zrArray, double *ziArray, double cr, double ci, int maxIter)
{
    int i;
    double zr = 0.0;
    double zi = 0.0;
    if (quickCheck(cr, ci)) {
        return -1;
    }
    for (i=0; i < maxIter; i++) {
        iterateMandelbrot(&zr, &zi, cr, ci);
        zrArray[i] = zr;
        ziArray[i] = zi;
        if ((zr*zr + zi*zi) > 4.0) {
            return i+1;
        }
    }
    return maxIter;


}