Examples of DiagonalMatrix


Examples of edu.ucla.sspace.matrix.DiagonalMatrix

           
            int rows = sigma.rows();
            double[] sigmaInv = new double[rows];
            for (int i = 0; i < rows; ++i)
                sigmaInv[i] = 1d / sigma.get(i, i);
            DiagonalMatrix sigmaInvMatrix = new DiagonalMatrix(sigmaInv);

            UtimesSigmaInv =
                Matrices.multiply(U, sigmaInvMatrix);
            // Update the field with the new reference to the precomputed matrix
            UtimesSigmaInvRef = new WeakReference<Matrix>(UtimesSigmaInv);
View Full Code Here

Examples of edu.ucla.sspace.matrix.DiagonalMatrix

    public Matrix getSingularValues() {
        if (singularValues == null)
            throw new IllegalStateException(
                "The matrix has not been factorized yet");
        // NOTE: make this read-only?
        return new DiagonalMatrix(singularValues);
    }
View Full Code Here

Examples of mikera.matrixx.impl.DiagonalMatrix

    assertEquals(m.getBand(0),m.getBandWrapped(0));
    assertEquals(Vector.of(1,5,6),m.getBandWrapped(-2));
  }
 
  @Test public void testDiagonalMatrix() {
    DiagonalMatrix m=DiagonalMatrix.create(Vector.of(0,1,2));
   
    assertEquals(0,m.upperBandwidth());
    assertEquals(0,m.upperBandwidthLimit());
    assertEquals(0,m.lowerBandwidth());
    assertEquals(0,m.lowerBandwidthLimit());
  }
View Full Code Here

Examples of org.apache.commons.math3.linear.DiagonalMatrix

     * Creates a diagonal weight matrix.
     *
     * @param weight List of the values of the diagonal.
     */
    public Weight(double[] weight) {
        weightMatrix = new DiagonalMatrix(weight);
    }
View Full Code Here

Examples of org.apache.commons.math3.linear.DiagonalMatrix

     * @return the square-root of the weight matrix.
     */
    private RealMatrix squareRoot(RealMatrix m) {
        if (m instanceof DiagonalMatrix) {
            final int dim = m.getRowDimension();
            final RealMatrix sqrtM = new DiagonalMatrix(dim);
            for (int i = 0; i < dim; i++) {
                sqrtM.setEntry(i, i, FastMath.sqrt(m.getEntry(i, i)));
            }
            return sqrtM;
        } else {
            final EigenDecomposition dec = new EigenDecomposition(m);
            return dec.getSquareRoot();
View Full Code Here

Examples of org.apache.commons.math3.linear.DiagonalMatrix

     * Creates a diagonal weight matrix.
     *
     * @param weight List of the values of the diagonal.
     */
    public Weight(double[] weight) {
        weightMatrix = new DiagonalMatrix(weight);
    }
View Full Code Here

Examples of org.apache.commons.math3.linear.DiagonalMatrix

     * Creates a diagonal weight matrix.
     *
     * @param weight List of the values of the diagonal.
     */
    public Weight(double[] weight) {
        weightMatrix = new DiagonalMatrix(weight);
    }
View Full Code Here

Examples of org.apache.commons.math3.linear.DiagonalMatrix

     * @return the square-root of the weight matrix.
     */
    private RealMatrix squareRoot(RealMatrix m) {
        if (m instanceof DiagonalMatrix) {
            final int dim = m.getRowDimension();
            final RealMatrix sqrtM = new DiagonalMatrix(dim);
            for (int i = 0; i < dim; i++) {
                sqrtM.setEntry(i, i, FastMath.sqrt(m.getEntry(i, i)));
            }
            return sqrtM;
        } else {
            final EigenDecomposition dec = new EigenDecomposition(m);
            return dec.getSquareRoot();
View Full Code Here

Examples of org.apache.commons.math3.linear.DiagonalMatrix

        return new LeastSquaresBuilder().
                maxEvaluations(Integer.MAX_VALUE).
                maxIterations(maxIter).
                start(startPoint).
                target(target).
                weight(new DiagonalMatrix(weights)).
                model(model.getModelFunction(), model.getModelFunctionJacobian()).
                build();

    }
View Full Code Here

Examples of org.apache.commons.math3.linear.DiagonalMatrix

        return new LeastSquaresBuilder().
                maxEvaluations(Integer.MAX_VALUE).
                maxIterations(maxIter).
                start(initialGuess).
                target(target).
                weight(new DiagonalMatrix(weights)).
                model(model.getModelFunction(), model.getModelFunctionJacobian()).
                build();

    }
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.