public void addLibrary(String label, double[] results, int plotLineType) {
    SourceResults s = new SourceResults();
    s.plotLineType = plotLineType;
    s.label = label;
    s.results = results;

    this.libraries.add(s);
  }
  /** Returns how many different matrix sizes have results. */
  public int getNumMatrices() {
    int max = 0;

    for (SourceResults s : libraries) {
      for (int i = max; i < matrixSize.length; i++) {
        if (Double.isNaN(s.getResult(i))) break;
        max = i;
      }
    }

    return max;
  }
  /**
   * Returns the best score across all libraries for this matrix size
   *
   * @param matrixIndex which matrix.
   * @return the best score
   */
  public double findBest(int matrixIndex) {
    double best = -1;

    for (SourceResults s : libraries) {
      double v = s.getResult(matrixIndex);

      if (!Double.isNaN(v) && best < v) {
        best = v;
      }
    }

    return best;
  }