Package net.algart.math.functions

Examples of net.algart.math.functions.Func


        double[] weights = new double[shifted.size()];
        assert weights.length <= 31;
        for (int k = 0; k < weights.length; k++) {
            weights[k] = 1L << k;
        }
        Func packingShiftedBits = LinearFunc.getInstance(0.0, weights);
        return Matrices.asFuncMatrix(packingShiftedBits, IntArray.class, shifted);
    }
View Full Code Here


            throw new NullPointerException("Null src argument");
        if (pattern == null)
            throw new NullPointerException("Null pattern argument");
        if (pattern.dimCount() != src.dimCount())
            throw new IllegalArgumentException("Number of dimensions of the pattern and the matrix mismatch");
        Func processingFunc = LinearFunc.getInstance(
            PFloatingArray.class.isAssignableFrom(src.type()) ? 0.0 : 0.5,
            1.0 / pattern.pointCount());
        return asFunctionOfSum(src, pattern, processingFunc);
    }
View Full Code Here

            throw new NullPointerException("Null src argument");
        if (pattern == null)
            throw new NullPointerException("Null pattern argument");
        if (pattern.dimCount() != src.dimCount())
            throw new IllegalArgumentException("Number of dimensions of the pattern and the matrix mismatch");
        Func processingFunc = LinearFunc.getInstance(
            PFloatingArray.class.isAssignableFrom(src.type()) ? 0.0 : 0.5,
            1.0 / pattern.pointCount());
        functionOfSum(dest, src, pattern, processingFunc);
    }
View Full Code Here

            {
                LinearOperator inverseTransform = (LinearOperator)((UniversalFramePosition)p).inverseTransform();
//                System.out.println("1 frame branch: linear operator " + inverseTransform);
                LinearOperator shift = LinearOperator.getShiftInstance(area.min().coordinates());
                LinearOperator lo = shift.superposition(inverseTransform);
                Func f = Matrices.asInterpolationFunc(m, Matrices.InterpolationMethod.POLYLINEAR_FUNCTION,
                    outsideValue(actualFrames));
                f = lo.apply(f);
                return Matrices.asCoordFuncMatrix(f, requiredType, dimensions);
            }
        }
View Full Code Here

                }
            }

        } else { // not direct
            // here we are sure that layers are large, so multiprocessing can be useful: we shall not disable it
            final Func updater = LinearFunc.getInstance(0.0, 1.0, -1.0, 1.0);
            UpdatablePArray acc = (UpdatablePArray) memoryModel().newUnresizableArray(accElementType, layerSize);
            for (long shift = min; shift <= max; shift++) {
                long i = (-shift * layerSize) % length; // "% length", because min..max can be negative or large
                if (i < 0) {
                    i += length;
View Full Code Here

    }

    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);
        return inverseTransform.apply(f);
View Full Code Here

TOP

Related Classes of net.algart.math.functions.Func

Copyright © 2018 www.massapicom. 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.