Examples of UniformIntegerDistribution


Examples of eu.stratosphere.api.common.distributions.UniformIntegerDistribution

    final int NUM_BUCKETS = 137;
    final double BUCKET_WIDTH = DISTR_RANGE / ((double) NUM_BUCKETS);
   
    final int NUM_ELEMENTS = 10000000;
   
    final DataDistribution distri = new UniformIntegerDistribution(DISTR_MIN, DISTR_MAX);
   
    @SuppressWarnings("unchecked")
    final RecordComparator intComp = new RecordComparator(new int[] {0}, new Class[] {IntValue.class});
    final ChannelSelector<Record> oe = new RecordOutputEmitter(ShipStrategyType.PARTITION_RANGE, intComp, distri);
   
View Full Code Here

Examples of eu.stratosphere.api.common.distributions.UniformIntegerDistribution

        .recordDelimiter('\n')
        .fieldDelimiter('|')
        .lenient(true)
        .field(IntValue.class, 0);
     
      sink.setGlobalOrder(new Ordering(0, IntValue.class, Order.ASCENDING), new UniformIntegerDistribution(Integer.MIN_VALUE, Integer.MAX_VALUE));
      sink.setInput(source);
     
      return new Plan(sink);
    }
View Full Code Here

Examples of org.apache.commons.math3.distribution.UniformIntegerDistribution

        return outBuffer.toString().substring(0, len);
    }

    /** {@inheritDoc} */
    public int nextInt(final int lower, final int upper) throws NumberIsTooLargeException {
        return new UniformIntegerDistribution(getRandomGenerator(), lower, upper).sample();
    }
View Full Code Here

Examples of org.apache.commons.math3.distribution.UniformIntegerDistribution

        return outBuffer.toString().substring(0, len);
    }

    /**  {@inheritDoc} */
    public int nextSecureInt(final int lower, final int upper) throws NumberIsTooLargeException {
        return new UniformIntegerDistribution(getSecRan(), lower, upper).sample();
    }
View Full Code Here

Examples of org.apache.commons.math3.distribution.UniformIntegerDistribution

                final int target;
                if (i == start) {
                    target = start;
                } else {
                    // NumberIsTooLargeException cannot occur.
                    target = new UniformIntegerDistribution(rng, start, i).sample();
                }
                final int temp = list[target];
                list[target] = list[i];
                list[i] = temp;
            }
        }
            break;
        case HEAD: {
            for (int i = 0; i <= start; i++) {
                final int target;
                if (i == start) {
                    target = start;
                } else {
                    // NumberIsTooLargeException cannot occur.
                    target = new UniformIntegerDistribution(rng, i, start).sample();
                }
                final int temp = list[target];
                list[target] = list[i];
                list[i] = temp;
            }
View Full Code Here

Examples of org.apache.commons.math3.distribution.UniformIntegerDistribution

    public void testWithInitialCapacity() {

        ResizableDoubleArray eDA2 = new ResizableDoubleArray(2);
        Assert.assertEquals("Initial number of elements should be 0", 0, eDA2.getNumElements());

        final IntegerDistribution randomData = new UniformIntegerDistribution(100, 1000);
        final int iterations = randomData.sample();

        for( int i = 0; i < iterations; i++) {
            eDA2.addElement( i );
        }
View Full Code Here

Examples of org.apache.commons.math3.distribution.UniformIntegerDistribution

    public void testWithInitialCapacityAndExpansionFactor() {

        ResizableDoubleArray eDA3 = new ResizableDoubleArray(3, 3.0, 3.5);
        Assert.assertEquals("Initial number of elements should be 0", 0, eDA3.getNumElements() );

        final IntegerDistribution randomData = new UniformIntegerDistribution(100, 3000);
        final int iterations = randomData.sample();

        for( int i = 0; i < iterations; i++) {
            eDA3.addElement( i );
        }
View Full Code Here

Examples of org.apache.commons.math3.distribution.UniformIntegerDistribution

        double[] values = new double[len];
        double[] weights = new double[len];

        // Fill weights array with random int values between 1 and 5
        int[] intWeights = new int[len];
        final IntegerDistribution weightDist = new UniformIntegerDistribution(1, 5);
        for (int i = 0; i < len; i++) {
            intWeights[i] = weightDist.sample();
            weights[i] = intWeights[i];
        }

        // Fill values array with random data from N(mu, sigma)
        // and fill valuesList with values from values array with
View Full Code Here

Examples of org.apache.commons.math3.distribution.UniformIntegerDistribution

        return outBuffer.toString().substring(0, len);
    }

    /** {@inheritDoc} */
    public int nextInt(final int lower, final int upper) throws NumberIsTooLargeException {
        return new UniformIntegerDistribution(getRandomGenerator(), lower, upper).sample();
    }
View Full Code Here

Examples of org.apache.commons.math3.distribution.UniformIntegerDistribution

        return outBuffer.toString().substring(0, len);
    }

    /**  {@inheritDoc} */
    public int nextSecureInt(final int lower, final int upper) throws NumberIsTooLargeException {
        return new UniformIntegerDistribution(getSecRan(), lower, upper).sample();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.