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.microflexbigdecimal.stat.NTest.java

/**
 * Tests well calculation.//ww  w.  j  a  v  a2  s.c om
 */
@Test
public void testWell() {

    for (Plate plate : array) {

        for (Well well : plate) {

            double[] input = new double[well.size()];
            int index = 0;

            for (BigDecimal bd : well) {
                input[index++] = bd.doubleValue();
            }

            DescriptiveStatistics stat = new DescriptiveStatistics(input);
            double result = stat.getN();
            double returned = n.well(well);

            assertTrue(result == returned);
        }
    }
}

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

/**
 * Tests well calculation.//from  w  ww .  j  av  a 2s  .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 result = stat.getN();
            double returned = n.well(well);

            assertTrue(result == returned);
        }
    }
}

From source file:com.github.jessemull.microflex.stat.statinteger.NIntegerTest.java

/**
 * Tests the plate statistics method./* w  ww.j  a v a 2 s  .c  om*/
 */
@Test
public void testPlate() {

    for (PlateInteger plate : array) {

        Map<WellInteger, Integer> resultMap = new TreeMap<WellInteger, Integer>();
        Map<WellInteger, Integer> returnedMap = n.plate(plate);

        for (WellInteger well : plate) {

            double[] input = new double[well.size()];
            int index = 0;

            for (double db : well) {
                input[index++] = db;
            }

            DescriptiveStatistics stat = new DescriptiveStatistics(input);
            double result = stat.getN();

            resultMap.put(well, (int) result);
        }

        for (WellInteger well : plate) {

            int result = resultMap.get(well);
            int returned = returnedMap.get(well);

            assertEquals(result, returned);
        }
    }
}

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

/**
 * Tests the plate statistics method./* w ww. j  av  a  2 s.c om*/
 */
@Test
public void testPlate() {

    for (Plate plate : array) {

        Map<Well, Integer> resultMap = new TreeMap<Well, Integer>();
        Map<Well, Integer> returnedMap = n.plate(plate);

        for (Well well : plate) {

            double[] input = new double[well.size()];
            int index = 0;

            for (double db : well) {
                input[index++] = db;
            }

            DescriptiveStatistics stat = new DescriptiveStatistics(input);
            double result = stat.getN();

            resultMap.put(well, (int) result);
        }

        for (Well well : plate) {

            int result = resultMap.get(well);
            int returned = returnedMap.get(well);

            assertEquals(result, returned);
        }
    }
}

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

/**
 * Tests the plate statistics method.//from   w  w  w.java 2s.  com
 */
@Test
public void testPlate() {

    for (PlateDouble plate : array) {

        Map<WellDouble, Integer> resultMap = new TreeMap<WellDouble, Integer>();
        Map<WellDouble, Integer> returnedMap = n.plate(plate);

        for (WellDouble well : plate) {

            double[] input = new double[well.size()];
            int index = 0;

            for (double db : well) {
                input[index++] = db;
            }

            DescriptiveStatistics stat = new DescriptiveStatistics(input);
            double result = stat.getN();

            resultMap.put(well, (int) result);
        }

        for (WellDouble well : plate) {

            int result = resultMap.get(well);
            int returned = returnedMap.get(well);

            assertEquals(result, returned);
        }
    }
}

From source file:com.github.jessemull.microflex.stat.statinteger.NIntegerTest.java

/**
 * Tests set calculation./* w  ww . ja v  a  2s  . co m*/
 */
@Test
public void testSet() {

    for (PlateInteger plate : array) {

        Map<WellInteger, Integer> resultMap = new TreeMap<WellInteger, Integer>();
        Map<WellInteger, Integer> returnedMap = n.set(plate.dataSet());

        for (WellInteger well : plate) {

            double[] input = new double[well.size()];
            int index = 0;

            for (double db : well) {
                input[index++] = db;
            }

            DescriptiveStatistics stat = new DescriptiveStatistics(input);
            double result = stat.getN();

            resultMap.put(well, (int) result);
        }

        for (WellInteger well : plate) {

            int result = resultMap.get(well);
            int returned = returnedMap.get(well);

            assertEquals(result, returned);
        }
    }

}

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

/**
 * Tests set calculation.//from  w w w.  ja  v a  2  s  .  com
 */
@Test
public void testSet() {

    for (Plate plate : array) {

        Map<Well, Integer> resultMap = new TreeMap<Well, Integer>();
        Map<Well, Integer> returnedMap = n.set(plate.dataSet());

        for (Well well : plate) {

            double[] input = new double[well.size()];
            int index = 0;

            for (double db : well) {
                input[index++] = db;
            }

            DescriptiveStatistics stat = new DescriptiveStatistics(input);
            double result = stat.getN();

            resultMap.put(well, (int) result);
        }

        for (Well well : plate) {

            int result = resultMap.get(well);
            int returned = returnedMap.get(well);

            assertEquals(result, returned);
        }
    }

}

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

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

    for (PlateBigDecimal plate : array) {

        Map<WellBigDecimal, Integer> resultMap = new TreeMap<WellBigDecimal, Integer>();
        Map<WellBigDecimal, Integer> returnedMap = n.plate(plate);

        for (WellBigDecimal well : plate) {

            double[] input = new double[well.size()];
            int index = 0;

            for (BigDecimal bd : well) {
                input[index++] = bd.doubleValue();
            }

            DescriptiveStatistics stat = new DescriptiveStatistics(input);
            double result = stat.getN();

            resultMap.put(well, (int) result);
        }

        for (WellBigDecimal well : plate) {

            int result = resultMap.get(well);
            int returned = returnedMap.get(well);

            assertEquals(result, returned);
        }
    }
}

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

/**
 * Tests the plate statistics method./*from  ww w  .  j a  v a2s .  c om*/
 */
@Test
public void testPlate() {

    for (PlateBigInteger plate : array) {

        Map<WellBigInteger, Integer> resultMap = new TreeMap<WellBigInteger, Integer>();
        Map<WellBigInteger, Integer> returnedMap = n.plate(plate);

        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 result = stat.getN();

            resultMap.put(well, (int) result);
        }

        for (WellBigInteger well : plate) {

            int result = resultMap.get(well);
            int returned = returnedMap.get(well);

            assertEquals(result, returned);
        }
    }
}

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

/**
 * Tests set calculation./*www .j a v  a 2  s.  com*/
 */
@Test
public void testSet() {

    for (PlateDouble plate : array) {

        Map<WellDouble, Integer> resultMap = new TreeMap<WellDouble, Integer>();
        Map<WellDouble, Integer> returnedMap = n.set(plate.dataSet());

        for (WellDouble well : plate) {

            double[] input = new double[well.size()];
            int index = 0;

            for (double db : well) {
                input[index++] = db;
            }

            DescriptiveStatistics stat = new DescriptiveStatistics(input);
            double result = stat.getN();

            resultMap.put(well, (int) result);
        }

        for (WellDouble well : plate) {

            int result = resultMap.get(well);
            int returned = returnedMap.get(well);

            assertEquals(result, returned);
        }
    }

}