/** * {@inheritDoc} * @throws SingularMatrixException if the decomposed matrix is singular. */ public RealMatrix getInverse() { return solve(MatrixUtils.createRealIdentityMatrix(qrt[0].length)); } }
/** * Get the inverse of the decomposed matrix. * * @return the inverse matrix. */ public RealMatrix getInverse() { return solve(MatrixUtils.createRealIdentityMatrix(lTData.length)); } }
/** * Get the inverse of the decomposed matrix. * * @return the inverse matrix. * @throws SingularMatrixException if the decomposed matrix is singular. */ public RealMatrix getInverse() { return solve(MatrixUtils.createRealIdentityMatrix(pivot.length)); } }
/** * {@inheritDoc} * @throws SingularMatrixException if the decomposed matrix is singular. */ public RealMatrix getInverse() { return solve(MatrixUtils.createRealIdentityMatrix(p.getRowDimension())); } }
return MatrixUtils.createRealIdentityMatrix(this.getRowDimension());
param.setNu0(1); param.setMu0(new OpenMapRealVector(2)); param.setPsi0(MatrixUtils.createRealIdentityMatrix(2));
param.setNu0(1); param.setMu0(new OpenMapRealVector(2)); param.setPsi0(MatrixUtils.createRealIdentityMatrix(2));
RealMatrix identity = MatrixUtils.createRealIdentityMatrix(kalmanGain.getRowDimension()); errorCovariance = identity.subtract(kalmanGain.multiply(measurementMatrix)).multiply(errorCovariance);
/** * Get the inverse of the decomposed matrix. * * @return the inverse matrix. * @throws SingularMatrixException if the decomposed matrix is singular. */ public RealMatrix getInverse() { return solve(MatrixUtils.createRealIdentityMatrix(pivot.length)); } }
/** * Get the inverse of the decomposed matrix. * * @return the inverse matrix. * @throws SingularMatrixException if the decomposed matrix is singular. */ public RealMatrix getInverse() { return solve(MatrixUtils.createRealIdentityMatrix(pivot.length)); } }
/** * {@inheritDoc} * @throws SingularMatrixException if the decomposed matrix is singular. */ public RealMatrix getInverse() { return solve(MatrixUtils.createRealIdentityMatrix(qrt[0].length)); } }
/** * Get the inverse of the decomposed matrix. * * @return the inverse matrix. */ public RealMatrix getInverse() { return solve(MatrixUtils.createRealIdentityMatrix(lTData.length)); } }
/** * {@inheritDoc} * @throws SingularMatrixException if the decomposed matrix is singular. */ public RealMatrix getInverse() { return solve(MatrixUtils.createRealIdentityMatrix(qrt[0].length)); } }
/** * Get the inverse of the decomposed matrix. * * @return the inverse matrix. */ public RealMatrix getInverse() { return solve(MatrixUtils.createRealIdentityMatrix(lTData.length)); } }
/** * {@inheritDoc} * @throws SingularMatrixException if the decomposed matrix is singular. */ public RealMatrix getInverse() { return solve(MatrixUtils.createRealIdentityMatrix(p.getRowDimension())); } }
/** * {@inheritDoc} * @throws SingularMatrixException if the decomposed matrix is singular. */ public RealMatrix getInverse() { return solve(MatrixUtils.createRealIdentityMatrix(p.getRowDimension())); } }
/** * Create the barrier function for the Phase I. * It is an instance of this class for the constraint: * <br>G + Sum[x_i * F_i(x),i] < t * I * @see "S.Boyd and L.Vandenberghe, Convex Optimization, 11.6.2" */ @Override public BarrierFunction createPhase1BarrierFunction(){ List<double[][]> FiPh1MatrixList = new ArrayList<double[][]>(); for(int i=0; i<this.Fi.length; i++){ FiPh1MatrixList.add(FiPh1MatrixList.size(), this.Fi[i].getData()); } FiPh1MatrixList.add(FiPh1MatrixList.size(), MatrixUtils.createRealIdentityMatrix(p).scalarMultiply(-1).getData()); return new SDPLogarithmicBarrier(FiPh1MatrixList, this.G.getData()); }
/** * Translate the algebraic form of the ellipsoid to the offset. * * @param center vector containing the offset of the ellipsoid. * @param a the algebraic form of the polynomial. * @return the offset translated form of the algebraic ellipsoid. */ private RealMatrix translateToCenter(RealVector center, RealMatrix a) { // Form the corresponding translation matrix. RealMatrix t = MatrixUtils.createRealIdentityMatrix(4); RealMatrix centerMatrix = new Array2DRowRealMatrix(1, 3); centerMatrix.setRowVector(0, center); t.setSubMatrix(centerMatrix.getData(), 3, 0); // Translate to the offset. RealMatrix r = t.multiply(a).multiply(t.transpose()); return r; }
public static double sumWalks(RealMatrix m, RealVector s, RealVector t) { int n = m.getColumnDimension(); if (n != m.getRowDimension()) { throw new InputMismatchException("sum walks can only be computed on square matrices"); } LUDecomposition d = new LUDecomposition(MatrixUtils.createRealIdentityMatrix(n).subtract(m)); RealMatrix sum = d.getSolver().getInverse(); if (s == null) s = new ArrayRealVector(n, 1.0); if (t == null) t = new ArrayRealVector(n, 1.0); return sum.preMultiply(s).dotProduct(t); }
/** numIterations >= 0 means use Newton's method with the given numIterations. * numIterations < 0 means use an exact LU decomposition to solve for the inverse. */ public static RealMatrix doInverse(RealMatrix matrix, int numIterations) { // long t = System.currentTimeMillis(); RealMatrix X; if (numIterations >= 0) { int numRows = matrix.getRowDimension(); RealMatrix transpose = matrix.transpose(); X = transpose.scalarMultiply(1.0 / (matrix.getNorm() * transpose.getNorm())); for (int i = 0; i < numIterations; i++) { // max iterations arbitrary X = X.multiply(MatrixUtils.createRealIdentityMatrix(numRows).scalarMultiply(2) .subtract(matrix.multiply(X))); } } else { X = new LUDecomposition(matrix).getSolver().getInverse(); } // log.debug("Inverse time for "+numIterations+" iterations: "+(System.currentTimeMillis()-t)); return X; }