Returns the scorer index for document <code>n</code>.
Implementation copied from lucene MultiReader class.

@param n document number.
@return the scorer index.
773733
private int scorerIndex(int n)
   {
      int lo = 0; // search starts array
      int hi = scorers.length - 1; // for first element less

      while (hi >= lo)
      {
         int mid = (lo + hi) >> 1;
         int midValue = starts[mid];
         if (n < midValue)
         {
            hi = mid - 1;
         }
         else if (n > midValue)
         {
            lo = mid + 1;
         }
         else
         { // found a match
            while (mid + 1 < scorers.length && starts[mid + 1] == midValue)
            {
               mid++; // scan to last match
            }
            return mid;
         }
      }
      return hi;
   }
779479
public static Document getOwnerDocument(Node n) {
    return n == null || !isElement(n) ? null : n.getNodeType() == Node.DOCUMENT_NODE
        ? n.<Document> cast() : n.getOwnerDocument();
  }
174008
public double getNumberFromNode(int n)
  {
    XMLString xstr = m_dtmMgr.getDTM(n).getStringValue(n);
    return xstr.toDouble();
  }
113598
public Node newParameterFromNode(Node n) {
    Node newParam = newParameter(n.getJSType());
    newParam.setVarArgs(n.isVarArgs());
    newParam.setOptionalArg(n.isOptionalArg());
    return newParam;
  }
964070
public final int getIndex(String name, Object... args) {
    Integer defaultIndex = methodIndexs.get(name);
    if (null != defaultIndex) return defaultIndex.intValue();
    else {
      final List<MethodInfo> exists = methods.get(name);
      if (null != exists) {
        for (MethodInfo info : exists)
          if (info.matches(args)) return info.index;
      }
      return -1;
    }
  }
523515
@Override
   protected Scorer createScorer(IndexReader reader, boolean scoreDocsInOrder, boolean topScorer) throws IOException {
        return new MatchAllScorer(reader, field);
    }
1162747
public function _nonConjunctionScore($docId, Zend_Search_Lucene_Interface $reader)
    {
        if ($this->_coord === null) {
            $this->_coord = array();

            $maxCoord = 0;
            foreach ($this->_signs as $sign) {
                if ($sign !== false /* not prohibited */) {
                    $maxCoord++;
                }
            }

            for ($count = 0; $count <= $maxCoord; $count++) {
                $this->_coord[$count] = $reader->getSimilarity()->coord($count, $maxCoord);
            }
        }

        $score = 0;
        $matchedSubqueries = 0;
        foreach ($this->_subqueries as $subqueryId => $subquery) {
            $subscore = $subquery->score($docId, $reader);

            // Prohibited
            if ($this->_signs[$subqueryId] === false && $subscore != 0) {
                return 0;
            }

            // is required, but doen't match
            if ($this->_signs[$subqueryId] === true &&  $subscore == 0) {
                return 0;
            }

            if ($subscore != 0) {
                $matchedSubqueries++;
                $score += $subscore;
            }
        }

        return $score * $this->_coord[$matchedSubqueries] * $this->getBoost();
    }
1162517
@Nullable
  public Document getDocument (final int nDocID) throws IOException
  {
    _checkClosing ();

    if (LOGGER.isDebugEnabled ())
      LOGGER.debug ("getDocument(" + nDocID + ")");

    final IndexReader aReader = getReader ();
    if (aReader == null)
      return null;
    return aReader.document (nDocID);
  }
192347
function(n){
    var val = this.lookahead(n).val;
    return val && ~pseudoSelectors.indexOf(val.name);
  }
1335360
public List<int[]> getNPaths(int n)
    {
        List<int[]> result = new ArrayList<int[]>();

        n = Math.min(Predefine.MAX_SEGMENT_NUM, n);
        for (int i = 0; i < N && result.size() < n; ++i)
        {
            List<int[]> pathList = getPaths(i);
            for (int[] path : pathList)
            {
                if (result.size() == n) break;
                result.add(path);
            }
        }

        return result;
    }
1020023
public short getLevel(Node n)
  {

    short level = 1;

    while (null != (n = getParentOfNode(n)))
    {
      level++;
    }

    return level;
  }
481745
public void rTrim(int n) {
        super.rTrim(n);
        this.setQuality(this.quality.substring(0, this.quality.length() - n));
    }
107431
public int getIndexMin() {
        int indexMin = 0;
        double min = getEigenvalue(0).getMagnitude2();

        final int N = getNumberOfEigenvalues();
        for( int i = 1; i < N; i++ ) {
            double m = getEigenvalue(i).getMagnitude2();
            if( m < min ) {
                min = m;
                indexMin = i;
            }
        }

        return indexMin;
    }
494122
public static PermutationMatrix getInstance(int n)
    {
        PermutationMatrix pm = map.get(n);
        if (pm == null)
        {
            pm = new PermutationMatrix(n);
            map.put(n, pm);
        }
        return pm;
    }
1232273
public int rank(double t) {
    int rank = n;
    for(int j = 0; j < n; j++) {
      if(Math.abs(Rdiag[j]) <= t) {
        --rank;
      }
    }
    return rank;
  }
435700
public static int count(int[] histogram, int N) {
		int counts = 0;
		for(int i=0;i<N;i++) {
			counts += histogram[i];
		}
		return counts;
	}
530506
public final int getIndexOfChild(Node child) {
    Node n = first;
    int i = 0;
    while (n != null) {
      if (child == n) {
        return i;
      }

      n = n.next;
      i++;
    }
    return -1;
  }