Examples of toRoundedPoint()


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

            Matrix<? extends PArray> m = singleFrame.matrix();
            FramePosition p = singleFrame.position();
            if (integerShiftPositions) {
//                System.out.println("1 frame branch: integer coordinates");
                Point o = p.area().min();
                IPoint localOffset = o.toRoundedPoint();
                assert o.equals(localOffset.toPoint());
                Matrix<T> casted = Matrices.asFuncMatrix(Func.IDENTITY, requiredType, m);
                // - must be before subMatr, if requiredType allows outsideValue, but the source matrix does not
                return casted.subMatr(localOffset.symmetric().coordinates(), dimensions,
                    Matrix.ContinuationMode.getConstantMode(outsideValue(actualFrames)));
View Full Code Here

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

            // optimization: here we can just create corresponded submatrices
            List<Matrix<? extends PArray>> expandedMatrices =
                new ArrayList<Matrix<? extends PArray>>(actualFrames.size());
            for (Frame<P> localFrame : actualFrames) {
                Point o = localFrame.position().area().min();
                IPoint localOffset = o.toRoundedPoint();
                assert o.equals(localOffset.toPoint());
                Matrix<? extends PArray> m = localFrame.matrix();
                m = Matrices.asFuncMatrix(Func.IDENTITY, DoubleArray.class, m);
                // - we need Double virtual matrix to provide correct NaN values to the combining function
                m = m.subMatr(localOffset.symmetric().coordinates(), dimensions, Matrix.ContinuationMode.NAN_CONSTANT);
View Full Code Here

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

    }

    public static <P extends FramePosition> boolean integerOffsets(List<Frame<P>> frames, Point offset) {
        for (Frame<?> frame : frames) {
            Point o = frame.position().area().min().subtract(offset);
            if (!o.equals(o.toRoundedPoint().toPoint())) {
                return false;
            }
        }
        return true;
    }
View Full Code Here

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

            } else {
                Point preciseRectEndOrStart = negativeSegments ? ptn.coordMax() : ptn.coordMin();
                assert preciseRectEndOrStart.isInteger();
                // - this method is called only in union-decomposition mode,
                // which is not used for non-integer or (N+1)-dimensional patterns
                rectEndOrStart = preciseRectEndOrStart.toRoundedPoint();
                normalized = ptn.shift(rectEndOrStart.symmetric().toPoint());
                // normalized segment has origin at the left or right end:
                // so minkowskiIncrement will consists of little positive / negative points
                // that provide good (small) leftward / rightward shifts
                minkowskiIncrement = lastNormalized == null ?
View Full Code Here

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

        return area;
    }

    public Func asInterpolationFunc(Matrix<? extends PArray> sourceMatrix) {
        Point o = area.min();
        boolean integerShift = isShift && o.equals(o.toRoundedPoint().toPoint());
        Func f = Matrices.asInterpolationFunc(sourceMatrix,
            integerShift ?
                Matrices.InterpolationMethod.STEP_FUNCTION :
                Matrices.InterpolationMethod.POLYLINEAR_FUNCTION,
            Double.NaN);
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.