Examples of pointCount()


Examples of net.algart.math.patterns.Pattern.pointCount()

                System.out.println(new TreeSet<Point>(points));
            t1 = System.nanoTime();
            List<Pattern> minkowskiDecomposition = p.minkowskiDecomposition(minimalPointCountForDecomposition);
            t2 = System.nanoTime();
            System.out.printf(Locale.US, "Minkowski decomposition to %d patterns (%.3f ms, %.3f ns / point):%n",
                minkowskiDecomposition.size(), (t2 - t1) * 1e-6, (t2 - t1) / (double)p.pointCount());
            for (Pattern q : minkowskiDecomposition) {
                System.out.println("    " + q);
            }
            System.out.println();

View Full Code Here

Examples of net.algart.math.patterns.Pattern.pointCount()

            List<List<Pattern>> allUnionDecompositions = p.allUnionDecompositions(minimalPointCountForDecomposition);
            t2 = System.nanoTime();
            for (int k = 0, n = allUnionDecompositions.size(); k < n; k++) {
                List<Pattern> unionDecomposition = allUnionDecompositions.get(k);
                System.out.printf(Locale.US, "Union decompositions #%d to %d patterns (%.3f ms, %.3f ns / point):%n",
                    k + 1, unionDecomposition.size(), (t2 - t1) * 1e-6, (t2 - t1) / (double) p.pointCount());
                for (Pattern q : unionDecomposition) {
                    System.out.println("    " + q
                        + (!q.hasMinkowskiDecomposition() ? " " + new TreeSet<IPoint>(q.roundedPoints()) : ""));
                }
                t1 = System.nanoTime();
View Full Code Here

Examples of net.algart.math.patterns.Pattern.pointCount()

                        totalPointCount += s.pointCount();
                }
                t2 = System.nanoTime();
                System.out.printf(Locale.US, "Minkowski decomposition of this union elements to %d patterns, "
                    + "%d total points (%.3f ms, %.3f ns / point)%n%n",
                    totalPatternCount, totalPointCount, (t2 - t1) * 1e-6, (t2 - t1) / (double)p.pointCount());
            }
        }
    }
}
View Full Code Here

Examples of net.algart.math.patterns.Pattern.pointCount()

            points.add(IPoint.valueOf(2000000000 + k, k));
            points.add(IPoint.valueOf(k, 2000000000 + k));
        }
        Pattern p2 = Patterns.newIntegerPattern(points);
        Pattern pSum = Patterns.newMinkowskiSum(p1, p2);
        System.out.println("Large sum: " + pSum + ", contains " + pSum.pointCount() + " points");
    }
}
View Full Code Here

Examples of net.algart.math.patterns.UniformGridPattern.pointCount()

        double step = Double.parseDouble(args[++argIndex]);
        int minimalPointCountForDecomposition = Integer.parseInt(args[++argIndex]);
        UniformGridPattern p = Patterns.newRectangularIntegerPattern(ranges)
            .multiply(step).shift(Point.valueOf(origin));
        System.out.println("Created pattern: " + p);
        System.out.println("Integer number of points: " + p.pointCount());
        System.out.println("Approximate number of points: " + p.largePointCount());
        if (p instanceof QuickPointCountPattern && ((QuickPointCountPattern) p).isPointCountVeryLarge()) {
            System.out.println("It is very large");
        }
        if (p.isActuallyRectangular()) {
View Full Code Here

Examples of net.algart.math.patterns.UniformGridPattern.pointCount()

            System.out.println("It is origin of coordinates");
        }
        if (p.isSurelyInteger()) {
            System.out.println("It is integer");
        }
        if (p.pointCount() < 1000) {
            Pattern samePoints = Patterns.newPattern(p.points());
            System.out.println("Pattern with same points: " + samePoints);
            if (samePoints instanceof UniformGridPattern && ((UniformGridPattern)samePoints).isActuallyRectangular()) {
                System.out.println("It is also rectangular");
            }
View Full Code Here

Examples of research.connection.ElbowConnection.pointCount()

    }

    public void invokeStep(InputEvent inputEvent, int x, int y, int anchorX, int anchorY, DrawingView view) {
        ElbowConnection line = ownerConnection();

        if ((fSegment == 0) || (fSegment == line.pointCount() - 2)){
           return;
        } else {
            Point p1 = line.pointAt(fSegment);
            Point p2 = line.pointAt(fSegment + 1);
            int ddx = x - fLastX;
View Full Code Here

Examples of research.connection.ElbowConnection2.pointCount()

                line.insertPointAt(new Point(_x, _y), fSegment + 1);
                line.insertPointAt(new Point(_x, _y), fSegment + 1);

                fSegment = 2;
            }
        } else if (fSegment == line.pointCount() - 2) {//����ĩ�˵����ӷ�ʽ(H <-> V)
            if ((inputEvent != null) && (inputEvent.isShiftDown())) {
                Point p2 = line.pointAt(fSegment + 1);
                line.insertPointAt(new Point(p2), fSegment + 1);

                int displayMode = ((Integer) line.getAttribute(ElbowConnection2.DISPLAY_MODE)).intValue();
View Full Code Here

Examples of research.connection.ElbowConnection2.pointCount()

    }

    public void invokeEnd(int x, int y, int anchorX, int anchorY, DrawingView view) {
        ElbowConnection2 line = ownerConnection();

        if (line.pointCount() <= 4) return;

        boolean _isCurrentVertical = isCurrentVertical();

        Point p1 = line.pointAt(fSegment);
        Point p2 = line.pointAt(fSegment + 1);
View Full Code Here

Examples of research.connection.ElbowConnection2.pointCount()

                    hasJointed = true;
                }
            }
        }

        if (!hasJointed && fSegment <= line.pointCount() - 4) {
            Point p3 = line.pointAt(fSegment + 2);
            Point pe = line.pointAt(fSegment + 3);

            if (_isCurrentVertical) {
                if (Math.abs(pe.x - p1.x) < 3) {
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.