public Vector apply(Vector b, Vector x) { // R'y = b, y = R'\b Rt.transSolve(b, y); // Rx = R'\b = y return Rt.solve(y, x); }
public Vector apply(Vector b, Vector x) { // R'y = b, y = R'\b Rt.transSolve(b, y); // Rx = R'\b = y return Rt.solve(y, x); }
/** * Solve for "X" in the equation: this*X = B * @param B must satisfy this.getNumRows() == B.numRows() * @param X must satisfy this.getNumColumns() == X.getNumRows() */ protected void solveInto( final DenseMatrix B, DenseMatrix X ) { this.getInternalMatrix().solve( B.getInternalMatrix(), X.getInternalMatrix() ); }
/** * Solve for "x" in the equation: this*x = b * @param b must satisfy this.getNumRows() == b.getDimensionality() * @param x must satisfy this.getNumColumns() == x.getDimensionality() */ protected void solveInto( final DenseVector b, DenseVector x ) { this.getInternalMatrix().solve( b.getInternalVector(), x.getInternalVector() ); }
/** * Solve for "x" in the equation: this*x = b * @param b must satisfy this.getNumRows() == b.getDimensionality() * @param x must satisfy this.getNumColumns() == x.getDimensionality() */ protected void solveInto( final DenseVector b, DenseVector x ) { this.getInternalMatrix().solve( b.getInternalVector(), x.getInternalVector() ); }
/** * Solve for "x" in the equation: this*x = b * @param b must satisfy this.getNumRows() == b.getDimensionality() * @param x must satisfy this.getNumColumns() == x.getDimensionality() */ protected void solveInto( final DenseVector b, DenseVector x ) { this.getInternalMatrix().solve( b.getInternalVector(), x.getInternalVector() ); }
/** * Solve for "X" in the equation: this*X = B * @param B must satisfy this.getNumRows() == B.numRows() * @param X must satisfy this.getNumColumns() == X.getNumRows() */ protected void solveInto( final DenseMatrix B, DenseMatrix X ) { this.getInternalMatrix().solve( B.getInternalMatrix(), X.getInternalMatrix() ); }
/** * Solve for "X" in the equation: this*X = B * @param B must satisfy this.getNumRows() == B.numRows() * @param X must satisfy this.getNumColumns() == X.getNumRows() */ protected void solveInto( final DenseMatrix B, DenseMatrix X ) { this.getInternalMatrix().solve( B.getInternalMatrix(), X.getInternalMatrix() ); }
DenseMatrix I = Matrices.identity(m); DenseMatrix CwInverse = I.copy(); System.err.println("CwInverse : \n" + Cw.solve(I, CwInverse));
aTa.add(i, i, ridge); Vector coeffsWithoutIntercept = aTa.solve(aTy, new DenseVector(numAttributes)); System.arraycopy(((DenseVector) coeffsWithoutIntercept).getData(), 0, coefficients, 0, numAttributes); } else { // Use QR decomposition dependent = null; Vector c = new DenseVector(Arrays.copyOf(cPlusd.getData(), numAttributes)); Vector y = R.solve(c, new DenseVector(numAttributes)); Vector coeffsWithoutIntercept = P.mult(y, new DenseVector(numAttributes)); System.arraycopy(((DenseVector) coeffsWithoutIntercept).getData(), 0, coefficients, 0, numAttributes);
aTa.add(i, i, ridge); Vector coeffsWithoutIntercept = aTa.solve(aTy, new DenseVector(numAttributes)); System.arraycopy(((DenseVector) coeffsWithoutIntercept).getData(), 0, coefficients, 0, numAttributes); } else { // Use QR decomposition dependent = null; Vector c = new DenseVector(Arrays.copyOf(cPlusd.getData(), numAttributes)); Vector y = R.solve(c, new DenseVector(numAttributes)); Vector coeffsWithoutIntercept = P.mult(y, new DenseVector(numAttributes)); System.arraycopy(((DenseVector) coeffsWithoutIntercept).getData(), 0, coefficients, 0, numAttributes);
m_Weights = scatter.solve(diff, new DenseVector(scatter.numColumns())); m_Weights.scale(1.0 / m_Weights.norm(Vector.Norm.Two));