Examples of scalarMultiply()


Examples of org.apache.commons.math.geometry.Vector3D.scalarMultiply()

  }

  public void testScalarProduct() {
    Vector3D v = new Vector3D(1, 2, 3);
    v = v.scalarMultiply(3);
    checkVector(v, 3, 6, 9);

    checkVector(v.scalarMultiply(0.5), 1.5, 3, 4.5);

  }
View Full Code Here

Examples of org.apache.commons.math.geometry.Vector3D.scalarMultiply()

  public void testScalarProduct() {
    Vector3D v = new Vector3D(1, 2, 3);
    v = v.scalarMultiply(3);
    checkVector(v, 3, 6, 9);

    checkVector(v.scalarMultiply(0.5), 1.5, 3, 4.5);

  }

  public void testVectorialProducts() {
    Vector3D v1 = new Vector3D(2, 1, -4);
View Full Code Here

Examples of org.apache.commons.math3.geometry.euclidean.twod.Vector2D.scalarMultiply()

        final Vector2D center = new Vector2D(300, 300);
        double range = 2.0 * FastMath.PI;
        double step = range / (samples + 1);
        for (double angle = 0; angle < range; angle += step) {
            Vector2D circle = new Vector2D(FastMath.cos(angle), FastMath.sin(angle));
            points.add(circle.scalarMultiply(200).add(center));
        }
       
        return points;
    }

View Full Code Here

Examples of org.apache.commons.math3.linear.Array2DRowRealMatrix.scalarMultiply()

        ccovmuSep = FastMath.min(1 - ccov1, ccovmu * (dimension + 1.5) / 3);
        chiN = FastMath.sqrt(dimension) *
                (1 - 1 / ((double) 4 * dimension) + 1 / ((double) 21 * dimension * dimension));
        // intialize CMA internal values - updated each generation
        xmean = MatrixUtils.createColumnRealMatrix(guess); // objective variables
        diagD = insigma.scalarMultiply(1 / sigma);
        diagC = square(diagD);
        pc = zeros(dimension, 1); // evolution paths for C and sigma
        ps = zeros(dimension, 1); // B defines the coordinate system
        normps = ps.getFrobeniusNorm();

View Full Code Here

Examples of org.apache.commons.math3.linear.Array2DRowRealMatrix.scalarMultiply()

        ccovmuSep = FastMath.min(1 - ccov1, ccovmu * (dimension + 1.5) / 3);
        chiN = FastMath.sqrt(dimension) *
            (1 - 1 / ((double) 4 * dimension) + 1 / ((double) 21 * dimension * dimension));
        // intialize CMA internal values - updated each generation
        xmean = MatrixUtils.createColumnRealMatrix(guess); // objective variables
        diagD = insigma.scalarMultiply(1 / sigma);
        diagC = square(diagD);
        pc = zeros(dimension, 1); // evolution paths for C and sigma
        ps = zeros(dimension, 1); // B defines the coordinate system
        normps = ps.getFrobeniusNorm();

View Full Code Here

Examples of org.apache.commons.math3.linear.Array2DRowRealMatrix.scalarMultiply()

                new double[][] { { FastMath.pow(dt, 4d) / 4d, FastMath.pow(dt, 3d) / 2d },
                                 { FastMath.pow(dt, 3d) / 2d, FastMath.pow(dt, 2d) } });

        // Q = [ dt^4/4 dt^3/2 ]
        //     [ dt^3/2 dt^2   ]
        RealMatrix Q = tmp.scalarMultiply(FastMath.pow(accelNoise, 2));

        // P0 = [ 1 1 ]
        //      [ 1 1 ]
        RealMatrix P0 = new Array2DRowRealMatrix(new double[][] { { 1, 1 }, { 1, 1 } });
View Full Code Here

Examples of org.apache.commons.math3.linear.Array2DRowRealMatrix.scalarMultiply()

        chiN = Math.sqrt(dimension) *
                (1. - 1. / (4. * dimension) + 1 / (21. * dimension * dimension));
        // intialize CMA internal values - updated each generation
        xmean = MatrixUtils.createColumnRealMatrix(guess); // objective
                                                           // variables
        diagD = insigma.scalarMultiply(1. / sigma);
        diagC = square(diagD);
        pc = zeros(dimension, 1); // evolution paths for C and sigma
        ps = zeros(dimension, 1); // B defines the coordinate system
        normps = ps.getFrobeniusNorm();

View Full Code Here

Examples of org.apache.commons.math3.linear.Array2DRowRealMatrix.scalarMultiply()

                new double[][] { { FastMath.pow(dt, 4d) / 4d, FastMath.pow(dt, 3d) / 2d },
                                 { FastMath.pow(dt, 3d) / 2d, FastMath.pow(dt, 2d) } });

        // Q = [ dt^4/4 dt^3/2 ]
        //     [ dt^3/2 dt^2   ]
        RealMatrix Q = tmp.scalarMultiply(FastMath.pow(accelNoise, 2));

        // P0 = [ 1 1 ]
        //      [ 1 1 ]
        RealMatrix P0 = new Array2DRowRealMatrix(new double[][] { { 1, 1 }, { 1, 1 } });
View Full Code Here

Examples of org.apache.commons.math3.linear.Array2DRowRealMatrix.scalarMultiply()

        ccovmuSep = FastMath.min(1 - ccov1, ccovmu * (dimension + 1.5) / 3);
        chiN = FastMath.sqrt(dimension) *
            (1 - 1 / ((double) 4 * dimension) + 1 / ((double) 21 * dimension * dimension));
        // intialize CMA internal values - updated each generation
        xmean = MatrixUtils.createColumnRealMatrix(guess); // objective variables
        diagD = insigma.scalarMultiply(1 / sigma);
        diagC = square(diagD);
        pc = zeros(dimension, 1); // evolution paths for C and sigma
        ps = zeros(dimension, 1); // B defines the coordinate system
        normps = ps.getFrobeniusNorm();

View Full Code Here

Examples of org.apache.commons.math3.linear.Array2DRowRealMatrix.scalarMultiply()

        ccovmuSep = FastMath.min(1 - ccov1, ccovmu * (dimension + 1.5) / 3);
        chiN = FastMath.sqrt(dimension) *
                (1 - 1 / ((double) 4 * dimension) + 1 / ((double) 21 * dimension * dimension));
        // intialize CMA internal values - updated each generation
        xmean = MatrixUtils.createColumnRealMatrix(guess); // objective variables
        diagD = insigma.scalarMultiply(1 / sigma);
        diagC = square(diagD);
        pc = zeros(dimension, 1); // evolution paths for C and sigma
        ps = zeros(dimension, 1); // B defines the coordinate system
        normps = ps.getFrobeniusNorm();

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.