BiGaussian { public double getValue(int x) { double sigma = x >= mu ? sigmaRight : sigmaLeft; double exponentialTerm = Math.exp(-1 * Math.pow(x - mu, 2) / (2 * Math.pow(sigma, 2))); return maxHeight * exponentialTerm; } BiGaussian(List<Triplet> horizontalSlice, int roundedmz, int leftBound, int rightBound); double getValue(int x); final double maxHeight; final int mu; final double sigmaLeft; final double sigmaRight; }
@Test public void testgetBiGaussianValue() throws MSDKException { List<Triplet> horizontalSlice = objSliceSparseMatrix.getHorizontalSlice(1810596, 50, 77); BiGaussian objBiGaussian = new BiGaussian(horizontalSlice, 1810596, 50, 77); double biGaussianValue = objBiGaussian.getValue(55); Assert.assertEquals(916711, biGaussianValue, 1); }