Example usage for org.apache.commons.math3.stat.descriptive DescriptiveStatistics getN

List of usage examples for org.apache.commons.math3.stat.descriptive DescriptiveStatistics getN

Introduction

In this page you can find the example usage for org.apache.commons.math3.stat.descriptive DescriptiveStatistics getN.

Prototype

public long getN() 

Source Link

Document

Returns the number of available values

Usage

From source file:com.github.jessemull.microflex.stat.statdouble.NDoubleTest.java

/**
 * Tests the aggregated plate statistics method.
 *///  www .  j  a v  a 2  s  .  co m
@Test
public void testAggregatedPlate() {

    for (PlateDouble plate : array) {

        List<Double> resultList = new ArrayList<Double>();
        int aggregatedReturned = n.platesAggregated(plate);

        for (WellDouble well : plate) {

            for (double db : well) {
                resultList.add(db);
            }

        }

        double[] inputAggregated = new double[resultList.size()];

        for (int i = 0; i < resultList.size(); i++) {
            inputAggregated[i] = resultList.get(i);
        }

        DescriptiveStatistics statAggregated = new DescriptiveStatistics(inputAggregated);
        double resultAggregated = statAggregated.getN();

        assertEquals((int) resultAggregated, aggregatedReturned);
    }
}

From source file:com.github.jessemull.microflex.stat.statdouble.NDoubleTest.java

/**
 * Tests the aggregated plate statistics method.
 *///from ww w. j  a  va2 s . c om
@Test
public void testAggregatedSet() {

    for (PlateDouble plate : array) {

        List<Double> resultList = new ArrayList<Double>();
        int aggregatedReturned = n.setsAggregated(plate.dataSet());

        for (WellDouble well : plate) {

            for (double db : well) {
                resultList.add(db);
            }

        }

        double[] inputAggregated = new double[resultList.size()];

        for (int i = 0; i < resultList.size(); i++) {
            inputAggregated[i] = resultList.get(i);
        }

        DescriptiveStatistics statAggregated = new DescriptiveStatistics(inputAggregated);
        double resultAggregated = statAggregated.getN();

        assertEquals((int) resultAggregated, aggregatedReturned);
    }
}

From source file:com.github.jessemull.microflex.stat.statbigdecimal.NBigDecimalTest.java

/**
 * Tests the aggregated plate statistics method.
 */// w  w w.  jav  a 2s .co  m
@Test
public void testAggregatedPlate() {

    for (PlateBigDecimal plate : array) {

        List<Double> resultList = new ArrayList<Double>();
        int aggregatedReturned = n.platesAggregated(plate);

        for (WellBigDecimal well : plate) {

            for (BigDecimal bd : well) {
                resultList.add(bd.doubleValue());
            }

        }

        double[] inputAggregated = new double[resultList.size()];

        for (int i = 0; i < resultList.size(); i++) {
            inputAggregated[i] = resultList.get(i);
        }

        DescriptiveStatistics statAggregated = new DescriptiveStatistics(inputAggregated);
        double resultAggregated = statAggregated.getN();

        assertEquals((int) resultAggregated, aggregatedReturned);
    }
}

From source file:com.github.jessemull.microflex.stat.statbigdecimal.NBigDecimalTest.java

/**
 * Tests the aggregated plate statistics method.
 *///  w w  w .  j a  v  a 2s.  co m
@Test
public void testAggregatedSet() {

    for (PlateBigDecimal plate : array) {

        List<Double> resultList = new ArrayList<Double>();
        int aggregatedReturned = n.setsAggregated(plate.dataSet());

        for (WellBigDecimal well : plate) {

            for (BigDecimal bd : well) {
                resultList.add(bd.doubleValue());
            }

        }

        double[] inputAggregated = new double[resultList.size()];

        for (int i = 0; i < resultList.size(); i++) {
            inputAggregated[i] = resultList.get(i);
        }

        DescriptiveStatistics statAggregated = new DescriptiveStatistics(inputAggregated);
        double resultAggregated = statAggregated.getN();

        assertEquals((int) resultAggregated, aggregatedReturned);
    }
}

From source file:com.github.jessemull.microflex.stat.statbiginteger.NBigIntegerTest.java

/**
 * Tests the aggregated plate statistics method.
 *//*from w  ww .  j  a v  a2  s  .c  om*/
@Test
public void testAggregatedPlate() {

    for (PlateBigInteger plate : array) {

        List<Double> resultList = new ArrayList<Double>();
        int aggregatedReturned = n.platesAggregated(plate);

        for (WellBigInteger well : plate) {

            for (BigInteger bi : well) {
                resultList.add(bi.doubleValue());
            }

        }

        double[] inputAggregated = new double[resultList.size()];

        for (int i = 0; i < resultList.size(); i++) {
            inputAggregated[i] = resultList.get(i);
        }

        DescriptiveStatistics statAggregated = new DescriptiveStatistics(inputAggregated);
        double resultAggregated = statAggregated.getN();

        assertEquals((int) resultAggregated, aggregatedReturned);
    }
}

From source file:com.github.jessemull.microflex.stat.statbiginteger.NBigIntegerTest.java

/**
 * Tests the aggregated plate statistics method.
 *//*w w w . j a v a2  s  .  c  o m*/
@Test
public void testAggregatedSet() {

    for (PlateBigInteger plate : array) {

        List<Double> resultList = new ArrayList<Double>();
        int aggregatedReturned = n.setsAggregated(plate.dataSet());

        for (WellBigInteger well : plate) {

            for (BigInteger bi : well) {
                resultList.add(bi.doubleValue());
            }

        }

        double[] inputAggregated = new double[resultList.size()];

        for (int i = 0; i < resultList.size(); i++) {
            inputAggregated[i] = resultList.get(i);
        }

        DescriptiveStatistics statAggregated = new DescriptiveStatistics(inputAggregated);
        double resultAggregated = statAggregated.getN();

        assertEquals((int) resultAggregated, aggregatedReturned);
    }
}

From source file:com.github.jessemull.microflexbigdecimal.stat.NTest.java

/**
 * Tests the aggregated plate statistics method.
 *///  w  w  w.  ja  va  2s .  c om
@Test
public void testAggregatedPlate() {

    for (Plate plate : array) {

        List<Double> resultList = new ArrayList<Double>();
        int aggregatedReturned = n.platesAggregated(plate);

        for (Well well : plate) {

            for (BigDecimal bd : well) {
                resultList.add(bd.doubleValue());
            }

        }

        double[] inputAggregated = new double[resultList.size()];

        for (int i = 0; i < resultList.size(); i++) {
            inputAggregated[i] = resultList.get(i);
        }

        DescriptiveStatistics statAggregated = new DescriptiveStatistics(inputAggregated);
        double resultAggregated = statAggregated.getN();

        assertEquals((int) resultAggregated, aggregatedReturned);
    }
}

From source file:com.github.jessemull.microflexbigdecimal.stat.NTest.java

/**
 * Tests the aggregated plate statistics method.
 *//* w w  w. j  a v  a  2 s . c  o  m*/
@Test
public void testAggregatedSet() {

    for (Plate plate : array) {

        List<Double> resultList = new ArrayList<Double>();
        int aggregatedReturned = n.setsAggregated(plate.dataSet());

        for (Well well : plate) {

            for (BigDecimal bd : well) {
                resultList.add(bd.doubleValue());
            }

        }

        double[] inputAggregated = new double[resultList.size()];

        for (int i = 0; i < resultList.size(); i++) {
            inputAggregated[i] = resultList.get(i);
        }

        DescriptiveStatistics statAggregated = new DescriptiveStatistics(inputAggregated);
        double resultAggregated = statAggregated.getN();

        assertEquals((int) resultAggregated, aggregatedReturned);
    }
}

From source file:com.github.jessemull.microflexbiginteger.stat.NTest.java

/**
 * Tests the aggregated plate statistics method.
 *///from  w  w  w .  j a  va 2s. c  om
@Test
public void testAggregatedPlate() {

    for (Plate plate : array) {

        List<Double> resultList = new ArrayList<Double>();
        int aggregatedReturned = n.platesAggregated(plate);

        for (Well well : plate) {

            for (BigInteger bi : well) {
                resultList.add(bi.doubleValue());
            }

        }

        double[] inputAggregated = new double[resultList.size()];

        for (int i = 0; i < resultList.size(); i++) {
            inputAggregated[i] = resultList.get(i);
        }

        DescriptiveStatistics statAggregated = new DescriptiveStatistics(inputAggregated);
        double resultAggregated = statAggregated.getN();

        assertEquals((int) resultAggregated, aggregatedReturned);
    }
}

From source file:com.github.jessemull.microflexbiginteger.stat.NTest.java

/**
 * Tests the aggregated plate statistics method.
 *///from w ww  .j a  v a  2  s .co m
@Test
public void testAggregatedSet() {

    for (Plate plate : array) {

        List<Double> resultList = new ArrayList<Double>();
        int aggregatedReturned = n.setsAggregated(plate.dataSet());

        for (Well well : plate) {

            for (BigInteger bi : well) {
                resultList.add(bi.doubleValue());
            }

        }

        double[] inputAggregated = new double[resultList.size()];

        for (int i = 0; i < resultList.size(); i++) {
            inputAggregated[i] = resultList.get(i);
        }

        DescriptiveStatistics statAggregated = new DescriptiveStatistics(inputAggregated);
        double resultAggregated = statAggregated.getN();

        assertEquals((int) resultAggregated, aggregatedReturned);
    }
}