Examples of DiagonalMatrix


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

    LeastSquaresBuilder builder(StraightLineProblem problem){
        return new LeastSquaresBuilder()
                .model(problem.getModelFunction(), problem.getModelFunctionJacobian())
                .target(problem.target())
                .weight(new DiagonalMatrix(problem.weight()))
                //unused start point to avoid NPE
                .start(new double[2]);
    }
View Full Code Here

Examples of org.apache.mahout.math.DiagonalMatrix

  /**
   * Constructs a sampler with diagonal scale matrix.
   * @param diagonal The diagonal elements of the scale matrix.
   */
  public MultiNormal(Vector diagonal) {
    this(new DiagonalMatrix(diagonal), null);
  }
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.