public double apply(int i, int j, double value) { setQuick(i, j, value); return value; } });
public double apply(int i, int j, double value) { setQuick(i, j, value); return value; } });
public double apply(int i, int j, double value) { setQuick(i, j, alpha * getQuick(i, j) + value); return value; } });
public double apply(int i, int j, double value) { setQuick(i, j, getQuick(i, j) + alpha * value); return value; } });
public double apply(int i, int j, double value) { setQuick(i, j, getQuick(i, j) + alpha * value); return value; } });
public double apply(int i, int j, double value) { setQuick(i, j, alpha * getQuick(i, j) + value); return value; } });
/** * Creates the interpolation (prolongation) matrix based on the smoothed * aggregates */ private SparseCCDoubleMatrix2D createInterpolationMatrix(List<Map<Integer, Double>> P, int n) { // Determine the sparsity pattern of I int c = P.size(); // int[][] nz = new int[c][]; // for (int j = 0; j < c; ++j) { // // Map<Integer, Double> Pj = P.get(j); // nz[j] = new int[Pj.size()]; // // int l = 0; // for (int k : Pj.keySet()) // nz[j][l++] = k; // } I = new SparseCCDoubleMatrix2D(n, c); // Populate it with numerical entries for (int j = 0; j < c; ++j) { Map<Integer, Double> Pj = P.get(j); for (Map.Entry<Integer, Double> e : Pj.entrySet()) I.setQuick(e.getKey(), j, e.getValue()); } return I; }
/** * Creates the interpolation (prolongation) matrix based on the smoothed * aggregates */ private SparseCCDoubleMatrix2D createInterpolationMatrix(List<Map<Integer, Double>> P, int n) { // Determine the sparsity pattern of I int c = P.size(); // int[][] nz = new int[c][]; // for (int j = 0; j < c; ++j) { // // Map<Integer, Double> Pj = P.get(j); // nz[j] = new int[Pj.size()]; // // int l = 0; // for (int k : Pj.keySet()) // nz[j][l++] = k; // } I = new SparseCCDoubleMatrix2D(n, c); // Populate it with numerical entries for (int j = 0; j < c; ++j) { Map<Integer, Double> Pj = P.get(j); for (Map.Entry<Integer, Double> e : Pj.entrySet()) I.setQuick(e.getKey(), j, e.getValue()); } return I; }