QuantileSummary extends AbstractObservable implements MCMCResultsListener, Summary { public int indexOf(double p) { for (int i = 0; i < d_probabilities.length; i++ ) { if (d_probabilities[i] == p) { return i; } } return -1; } QuantileSummary(MCMCResults results, Parameter parameter, double[] probabilities);  QuantileSummary(double[] probabilities, double[] quantiles);  QuantileSummary(MCMCResults results, Parameter parameter); void resultsEvent(MCMCResultsEvent event); int indexOf(double p); double getProbability(int idx); double getQuantile(int idx); int getSize(); boolean getDefined();  }
@Test public void testIndexOf() { QuantileSummary x = new QuantileSummary(d_results, d_results.getParameters()[0]); assertEquals(0, x.indexOf(0.025)); assertEquals(1, x.indexOf(0.5)); assertEquals(2, x.indexOf(0.975)); assertEquals(-1, x.indexOf(0.12)); }