Package java.util

Examples of java.util.Random.nextDouble()


     */
    double[] createRealData(final int n) {
        final Random random = new Random(SEED);
        final double[] data = new double[n];
        for (int i = 0; i < n; i++) {
            data[i] = 2.0 * random.nextDouble() - 1.0;
        }
        return data;
    }

    /*
 
View Full Code Here


    private static Complex[] createComplexData(final int n) {
        final Random random = new Random(SEED);
        final Complex[] data = new Complex[n];
        for (int i = 0; i < n; i++) {
            final double re = 2.0 * random.nextDouble() - 1.0;
            final double im = 2.0 * random.nextDouble() - 1.0;
            data[i] = new Complex(re, im);
        }
        return data;
    }
View Full Code Here

    private static Complex[] createComplexData(final int n) {
        final Random random = new Random(SEED);
        final Complex[] data = new Complex[n];
        for (int i = 0; i < n; i++) {
            final double re = 2.0 * random.nextDouble() - 1.0;
            final double im = 2.0 * random.nextDouble() - 1.0;
            data[i] = new Complex(re, im);
        }
        return data;
    }

View Full Code Here

        for (int i = 20; i <= 5000; i += 20) {
           
            ArrayList<Point> pts = new ArrayList<Point>();
           
            for(int j = 0; j < i; j++) {
                pts.add(new Point(rand.nextDouble()*10, rand.nextDouble()*10));
            }
           
            double start = Calendar.getInstance().getTimeInMillis();
           
            Delaunay.bruteForce(pts);
View Full Code Here

        for (int i = 20; i <= 5000; i += 20) {
           
            ArrayList<Point> pts = new ArrayList<Point>();
           
            for(int j = 0; j < i; j++) {
                pts.add(new Point(rand.nextDouble()*10, rand.nextDouble()*10));
            }
           
            double start = Calendar.getInstance().getTimeInMillis();
           
            Delaunay.bruteForce(pts);
View Full Code Here

        for (int i = 5020; i <= 8000; i += 20) {
           
            ArrayList<Point> pts = new ArrayList<Point>();
           
            for(int j = 0; j < i; j++) {
                pts.add(new Point(rand.nextDouble()*10, rand.nextDouble()*10));
            }
           
            double start = Calendar.getInstance().getTimeInMillis();
           
            Delaunay.randomizedIncremental(pts);
View Full Code Here

        for (int i = 5020; i <= 8000; i += 20) {
           
            ArrayList<Point> pts = new ArrayList<Point>();
           
            for(int j = 0; j < i; j++) {
                pts.add(new Point(rand.nextDouble()*10, rand.nextDouble()*10));
            }
           
            double start = Calendar.getInstance().getTimeInMillis();
           
            Delaunay.randomizedIncremental(pts);
View Full Code Here

        for (int repeat = 0; repeat < 1000; repeat++) {
            for (int i = 2; i <= 20; i++) {
                ArrayList<Segment> segments = new ArrayList<Segment>();

                for(int j = 0; j < i; j++) {
                    segments.add(new Segment(new Point(rand.nextDouble()*100, rand.nextDouble()*100),
                                             new Point(rand.nextDouble()*100, rand.nextDouble()*100)));
                }

                assertTrue(SegmentsIntersect.any(segments) ==
                            SegmentsIntersect.any_Naive(segments));
View Full Code Here

        for (int repeat = 0; repeat < 1000; repeat++) {
            for (int i = 2; i <= 20; i++) {
                ArrayList<Segment> segments = new ArrayList<Segment>();

                for(int j = 0; j < i; j++) {
                    segments.add(new Segment(new Point(rand.nextDouble()*100, rand.nextDouble()*100),
                                             new Point(rand.nextDouble()*100, rand.nextDouble()*100)));
                }

                assertTrue(SegmentsIntersect.any(segments) ==
                            SegmentsIntersect.any_Naive(segments));
View Full Code Here

            for (int i = 2; i <= 20; i++) {
                ArrayList<Segment> segments = new ArrayList<Segment>();

                for(int j = 0; j < i; j++) {
                    segments.add(new Segment(new Point(rand.nextDouble()*100, rand.nextDouble()*100),
                                             new Point(rand.nextDouble()*100, rand.nextDouble()*100)));
                }

                assertTrue(SegmentsIntersect.any(segments) ==
                            SegmentsIntersect.any_Naive(segments));
            }
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.