Examples of coordinates()


Examples of net.algart.math.IPoint.coordinates()

            Matrix<DoubleArray> cyclic = matrix.subMatr(submatrixPos, submatrixDim,
                Matrix.ContinuationMode.CYCLIC);

            IPoint from = IPoint.valueOf(cyclic.subMatrixFrom());
            IPoint to = IPoint.valueOf(cyclic.subMatrixTo());
            Matrix<DoubleArray> pseudoCyclic = matrix.subMatrix(from.coordinates(), to.coordinates(),
                Matrix.ContinuationMode.PSEUDO_CYCLIC);
            System.out.println(testCount + ": testing " + from + ".." + to
                + " inside " + JArrays.toString(matrix.dimensions(), "x", 100));
            for (int shiftIndex = 0; shiftIndex < 1000; shiftIndex++) {
                boolean showResults = shiftIndex < 10;
View Full Code Here

Examples of net.algart.math.IPoint.coordinates()

                            (cyclic.dim(k) + shiftIndex - 1) % cyclic.dim(k) :
                            Math.round(rnd.nextDouble() * (cyclic.dim(k) - 1));
                }
                IPoint p = IPoint.valueOf(shift);
                IPoint shifted = from.add(p);
                long cyclicIndex = matrix.cyclicIndex(shifted.coordinates());
                long pseudoCyclicIndex = matrix.pseudoCyclicIndex(shifted.coordinates());
                long oneDimensional = shifted.toOneDimensional(matrix.dimensions(), true);
                if (pseudoCyclicIndex != oneDimensional)
                    throw new AssertionError("Bug A detected: pseudo-cyclic index calculated differently "
                        + "in Matrix and IPoint: " + pseudoCyclicIndex + " and " + oneDimensional);
View Full Code Here

Examples of net.algart.math.IPoint.coordinates()

                            Math.round(rnd.nextDouble() * (cyclic.dim(k) - 1));
                }
                IPoint p = IPoint.valueOf(shift);
                IPoint shifted = from.add(p);
                long cyclicIndex = matrix.cyclicIndex(shifted.coordinates());
                long pseudoCyclicIndex = matrix.pseudoCyclicIndex(shifted.coordinates());
                long oneDimensional = shifted.toOneDimensional(matrix.dimensions(), true);
                if (pseudoCyclicIndex != oneDimensional)
                    throw new AssertionError("Bug A detected: pseudo-cyclic index calculated differently "
                        + "in Matrix and IPoint: " + pseudoCyclicIndex + " and " + oneDimensional);
                long rPseudoCyclicIndex = hugePseudoCyclicIndex(matrix.dimensions(), shifted.coordinates());
View Full Code Here

Examples of net.algart.math.IPoint.coordinates()

                long pseudoCyclicIndex = matrix.pseudoCyclicIndex(shifted.coordinates());
                long oneDimensional = shifted.toOneDimensional(matrix.dimensions(), true);
                if (pseudoCyclicIndex != oneDimensional)
                    throw new AssertionError("Bug A detected: pseudo-cyclic index calculated differently "
                        + "in Matrix and IPoint: " + pseudoCyclicIndex + " and " + oneDimensional);
                long rPseudoCyclicIndex = hugePseudoCyclicIndex(matrix.dimensions(), shifted.coordinates());
                if (pseudoCyclicIndex != rPseudoCyclicIndex)
                    throw new AssertionError("Bug B detected: pseudo-cyclic index calculated incorrectly: "
                        + pseudoCyclicIndex + " instead of " + rPseudoCyclicIndex);
                if (cyclic.size() == 0) {
                    continue; // cannot test internal indexes
View Full Code Here

Examples of net.algart.math.IPoint.coordinates()

            // and if the checks "i < 0" lead to the same stable result (almost always true or, little better,
            // almost always false), then CPU can optimize this branching.
//            System.out.println("QUICK");
            final IPoint min = pattern.coordMin().toRoundedPoint();
            final Pattern shiftedPattern = pattern.shift(min.symmetric().toPoint()); // "normalized" coordinates >=0
            final Matrix<?> shiftedSrc = Matrices.asShifted(src, min.coordinates());
            Matrix<? extends UpdatablePArray> clone = Arrays.SMM.newMatrix(UpdatablePArray.class, src);
            Matrices.copy(arrayContext == null ? null : arrayContext.part(0.0, 0.05),
                clone, shiftedSrc);
            Matrix<? extends PArray> lazy = asProcessed(requiredType, clone, additionalMatrices, shiftedPattern);
            new Arrays.Copier(arrayContext == null ? null : arrayContext.part(0.05, 1.0),
View Full Code Here

Examples of net.algart.math.IPoint.coordinates()

        }
        assert bufSize < size;

        final IPoint min = pattern.coordMin().toRoundedPoint();
        final Pattern shiftedPattern = pattern.shift(min.symmetric().toPoint()); // "normalized" coordinates >=0
        final Matrix<? extends PArray> shiftedSrc = Matrices.asShifted(src, min.coordinates()).cast(PArray.class);

        final long[] dimensions = src.dimensions();
        final long lSize = Arrays.longMul(dimensions, 0, dimensions.length - 1);
        final long lastDim = dimensions[dimensions.length - 1];
        assert lastDim * lSize == size;
View Full Code Here

Examples of net.algart.math.Point.coordinates()

        final int dimCount = projection.dimCount();
        final Set<IPoint> projectionIndexes = projection.gridIndexes();
        final Point projectionOrigin = projection.originOfGrid();
        final double[] projectionSteps = projection.stepsOfGrid();
        double[] origin = new double[dimCount + 1];
        projectionOrigin.coordinates(origin);
        origin[dimCount] = lastCoordinateOfOrigin;
        double[] steps = new double[dimCount + 1];
        System.arraycopy(projectionSteps, 0, steps, 0, dimCount);
        steps[dimCount] = lastCoordinateStep;
        Set<IPoint> resultIndexes = new HashSet<IPoint>();
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.