Periodogram { public double[] getP() { calcp(); return m_p; } Periodogram(IReadDataBlock data);  Periodogram(IReadDataBlock data, boolean mean); static double[] getSeasonalFrequencies(int freq); static double[] getTradingDaysFrequencies(int freq); boolean isMeanCorrection(); double getSsq(); double[] getData(); double getIntervalInRadians(); double[] getP(); double[] getS(); int getWindowLength(); int[] searchPeaks(double dMin, boolean smoothed); void setWindowLength(int value);  }
@Test public void testSum() { for (int K = 12; K < 120; ++K) { DataBlock z = new DataBlock(K); z.randomize(0); Periodogram p = new Periodogram(z, false); DataBlock q = new DataBlock(p.getP()); assertTrue(Math.abs(q.sum() - K) < 1e-6); p = new Periodogram(z, true); q = new DataBlock(p.getP()); assertTrue(Math.abs(q.sum() - K) < 1e-6); } }