List of usage examples for java.math BigInteger doubleValue
public double doubleValue()
From source file:com.github.jessemull.microflex.stat.statbiginteger.GeometricMeanBigIntegerTest.java
/** * Tests well calculation./* w ww . j a va 2 s . c om*/ */ @Test public void testWell() { for (PlateBigInteger plate : array) { for (WellBigInteger well : plate) { double[] input = new double[well.size()]; int index = 0; for (BigInteger bi : well) { input[index++] = bi.doubleValue(); } DescriptiveStatistics stat = new DescriptiveStatistics(input); double resultDouble = stat.getGeometricMean(); BigDecimal returned = mean.well(well, mc); BigDecimal result = new BigDecimal(resultDouble); BigDecimal[] corrected = correctRoundingErrors(returned, result); assertEquals(corrected[0], corrected[1]); } } }
From source file:com.github.jessemull.microflex.stat.statbiginteger.StandardDeviationBigIntegerTest.java
/** * Tests well calculation.// w w w. ja v a 2 s. c o m */ @Test public void testWell() { for (PlateBigInteger plate : array) { for (WellBigInteger well : plate) { double[] input = new double[well.size()]; int index = 0; for (BigInteger bi : well) { input[index++] = bi.doubleValue(); } DescriptiveStatistics stat = new DescriptiveStatistics(input); double resultDouble = stat.getStandardDeviation(); BigDecimal returned = deviation.well(well, mc); BigDecimal result = new BigDecimal(resultDouble); BigDecimal[] corrected = correctRoundingErrors(returned, result); assertEquals(corrected[0], corrected[1]); } } }
From source file:com.github.jessemull.microflexbiginteger.stat.KurtosisTest.java
/** * Tests well calculation.//from w ww . jav a 2 s .c o m */ @Test public void testWell() { for (Plate plate : array) { for (Well well : plate) { double[] input = new double[well.size()]; int index = 0; for (BigInteger bi : well) { input[index++] = bi.doubleValue(); } DescriptiveStatistics stat = new DescriptiveStatistics(input); double resultDouble = stat.getKurtosis(); BigDecimal returned = kurtosis.well(well, mc); BigDecimal result = new BigDecimal(resultDouble); BigDecimal[] corrected = correctRoundingErrors(returned, result); assertEquals(corrected[0], corrected[1]); } } }
From source file:com.github.jessemull.microflexbiginteger.stat.SkewnessTest.java
/** * Tests well calculation.//from www .j a va 2 s. co m */ @Test public void testWell() { for (Plate plate : array) { for (Well well : plate) { double[] input = new double[well.size()]; int index = 0; for (BigInteger bi : well) { input[index++] = bi.doubleValue(); } DescriptiveStatistics stat = new DescriptiveStatistics(input); double resultDouble = stat.getSkewness(); BigDecimal returned = skewness.well(well, mc); BigDecimal result = new BigDecimal(resultDouble); BigDecimal[] corrected = correctRoundingErrors(returned, result); assertEquals(corrected[0], corrected[1]); } } }
From source file:com.github.jessemull.microflexbiginteger.stat.SumTest.java
/** * Tests well calculation using indices. *//* ww w .j av a2 s. c o m*/ @Test public void testWellIndices() { for (Plate plate : arrayIndices) { for (Well well : plate) { double[] input = new double[well.size()]; int index = 0; for (BigInteger bi : well) { input[index++] = bi.doubleValue(); } int size = arrayIndices[0].first().size(); int begin = random.nextInt(size - 5); int end = (begin + 4) + random.nextInt(size - (begin + 4) + 1); DescriptiveStatistics stat = new DescriptiveStatistics(ArrayUtils.subarray(input, begin, end)); double resultDouble = stat.getSum(); BigDecimal returned = sum.well(well, begin, end - begin, mc); BigDecimal result = new BigDecimal(resultDouble); BigDecimal[] corrected = correctRoundingErrors(returned, result); assertEquals(corrected[0], corrected[1]); } } }
From source file:com.github.jessemull.microflex.stat.statbiginteger.KurtosisBigIntegerTest.java
/** * Tests well calculation.// w w w . j av a 2s . c o m */ @Test public void testWell() { for (PlateBigInteger plate : array) { for (WellBigInteger well : plate) { double[] input = new double[well.size()]; int index = 0; for (BigInteger bi : well) { input[index++] = bi.doubleValue(); } DescriptiveStatistics stat = new DescriptiveStatistics(input); double resultDouble = stat.getKurtosis(); BigDecimal returned = kurtosis.well(well, mc); BigDecimal result = new BigDecimal(resultDouble); BigDecimal[] corrected = correctRoundingErrors(returned, result); assertEquals(corrected[0], corrected[1]); } } }
From source file:com.github.jessemull.microflex.stat.statbiginteger.MaxBigIntegerTest.java
/** * Tests well calculation.//from www . j av a 2 s . c o m */ @Test public void testWell() { for (PlateBigInteger plate : array) { for (WellBigInteger well : plate) { double[] input = new double[well.size()]; int index = 0; for (BigInteger bi : well) { input[index++] = bi.doubleValue(); } DescriptiveStatistics stat = new DescriptiveStatistics(input); double resultDouble = stat.getMax(); BigDecimal returned = max.well(well); BigDecimal result = new BigDecimal(resultDouble); BigDecimal[] corrected = correctRoundingErrors(returned, result); assertEquals(corrected[0], corrected[1]); } } }
From source file:com.github.jessemull.microflex.stat.statbiginteger.MinBigIntegerTest.java
/** * Tests well calculation./* w w w. j a v a 2 s . co m*/ */ @Test public void testWell() { for (PlateBigInteger plate : array) { for (WellBigInteger well : plate) { double[] input = new double[well.size()]; int index = 0; for (BigInteger bi : well) { input[index++] = bi.doubleValue(); } DescriptiveStatistics stat = new DescriptiveStatistics(input); double resultDouble = stat.getMin(); BigDecimal returned = min.well(well); BigDecimal result = new BigDecimal(resultDouble); BigDecimal[] corrected = correctRoundingErrors(returned, result); assertEquals(corrected[0], corrected[1]); } } }
From source file:com.github.jessemull.microflex.stat.statbiginteger.SkewnessBigIntegerTest.java
/** * Tests well calculation.//from w ww . ja v a2 s. co m */ @Test public void testWell() { for (PlateBigInteger plate : array) { for (WellBigInteger well : plate) { double[] input = new double[well.size()]; int index = 0; for (BigInteger bi : well) { input[index++] = bi.doubleValue(); } DescriptiveStatistics stat = new DescriptiveStatistics(input); double resultDouble = stat.getSkewness(); BigDecimal returned = skewness.well(well, mc); BigDecimal result = new BigDecimal(resultDouble); BigDecimal[] corrected = correctRoundingErrors(returned, result); assertEquals(corrected[0], corrected[1]); } } }
From source file:com.github.jessemull.microflex.stat.statbiginteger.SumBigIntegerTest.java
/** * Tests well calculation.//from w ww. j av a 2s.c om */ @Test public void testWell() { for (PlateBigInteger plate : array) { for (WellBigInteger well : plate) { double[] input = new double[well.size()]; int index = 0; for (BigInteger bi : well) { input[index++] = bi.doubleValue(); } DescriptiveStatistics stat = new DescriptiveStatistics(input); double resultDouble = stat.getSum(); BigDecimal returned = sum.well(well, mc); BigDecimal result = new BigDecimal(resultDouble); BigDecimal[] corrected = correctRoundingErrors(returned, result); assertEquals(corrected[0], corrected[1]); } } }