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; };
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; }
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; }