Updates the values along the main diagonal of the matrix by adding a constant to them @param A the matrix to perform the update on @param start the first index of the diagonals to update (inclusive) @param to the last index of the diagonals to update (exclusive) @param c the constant to add to the d
(Matrix A, int start, int to, double c)
| 15 | * @param c the constant to add to the diagonal |
| 16 | */ |
| 17 | public static void addDiag(Matrix A, int start, int to, double c) |
| 18 | { |
| 19 | for(int i = start; i < to; i++) |
| 20 | A.increment(i, i, c); |
| 21 | } |
| 22 | |
| 23 | /** |
| 24 | * Updates the values of row <tt>i</tt> in the given matrix to be A[i,:] = A[i,:]+ c |