@Override public void set( final int rowIndex, final int columnIndex, final double value) { setElement(rowIndex, columnIndex, value); }
@Override public void set( final int rowIndex, final int columnIndex, final double value) { setElement(rowIndex, columnIndex, value); }
@Override public void set( final int rowIndex, final int columnIndex, final double value) { setElement(rowIndex, columnIndex, value); }
/** * Sets elements of the group with their score (+1/-1 or similar) and how * much to trust that weight. * * @param group The element's group id * @param index The element's within-group id * @param trust The amount the score should be trusted * @param score The score assigned to the element */ public void setElementsScore(int group, int index, double trust, double score) { isInitialized = false; // Make sure its in within space checkNode(group, index); // Add to solution and diagonal int i = eachPartsStart[group] + index; rhs.setElement(i, trust * score); additional.setElement(i, i, trust); }
/** * Sets elements of the group with their score (+1/-1 or similar) and how * much to trust that weight. * * @param group The element's group id * @param index The element's within-group id * @param trust The amount the score should be trusted * @param score The score assigned to the element */ public void setElementsScore(int group, int index, double trust, double score) { isInitialized = false; // Make sure its in within space checkNode(group, index); // Add to solution and diagonal int i = eachPartsStart[group] + index; rhs.setElement(i, trust * score); additional.setElement(i, i, trust); }
/** * Sets elements of the group with their score (+1/-1 or similar) and how * much to trust that weight. * * @param group The element's group id * @param index The element's within-group id * @param trust The amount the score should be trusted * @param score The score assigned to the element */ public void setElementsScore(int group, int index, double trust, double score) { isInitialized = false; // Make sure its in within space checkNode(group, index); // Add to solution and diagonal int i = eachPartsStart[group] + index; rhs.setElement(i, trust * score); additional.setElement(i, i, trust); }
/** * Creates a new {@link MatrixVectorMultiplierDiagonalPreconditioner} for * the given matrix. * * @param m * The matrix. */ public MatrixVectorMultiplierDiagonalPreconditioner(Matrix m) { super(m); if (!m.isSquare()) { throw new IllegalArgumentException("This preconditioner only works " + "on square matrices"); } int n = m.getNumRows(); Minv = new DiagonalMatrix(n); for (int i = 0; i < n; ++i) { double ij = m.getElement(i, i); if (ij == 0) { throw new IllegalArgumentException("Diagonal preconditioner " + "only serves for matrices with non-zero diagonal elements"); } Minv.setElement(i, i, 1.0 / ij); } }
/** * Creates a new {@link MatrixVectorMultiplierDiagonalPreconditioner} for * the given matrix. * * @param m * The matrix. */ public MatrixVectorMultiplierDiagonalPreconditioner(Matrix m) { super(m); if (!m.isSquare()) { throw new IllegalArgumentException("This preconditioner only works " + "on square matrices"); } int n = m.getNumRows(); Minv = new DiagonalMatrix(n); for (int i = 0; i < n; ++i) { double ij = m.getElement(i, i); if (ij == 0) { throw new IllegalArgumentException("Diagonal preconditioner " + "only serves for matrices with non-zero diagonal elements"); } Minv.setElement(i, i, 1.0 / ij); } }
/** * Creates a new {@link MatrixVectorMultiplierDiagonalPreconditioner} for * the given matrix. * * @param m * The matrix. */ public MatrixVectorMultiplierDiagonalPreconditioner(Matrix m) { super(m); if (!m.isSquare()) { throw new IllegalArgumentException("This preconditioner only works " + "on square matrices"); } int n = m.getNumRows(); Minv = new DiagonalMatrix(n); for (int i = 0; i < n; ++i) { double ij = m.getElement(i, i); if (ij == 0) { throw new IllegalArgumentException("Diagonal preconditioner " + "only serves for matrices with non-zero diagonal elements"); } Minv.setElement(i, i, 1.0 / ij); } }
for (int i = 0; i < size; ++i) this.additional.setElement(i, i, DEFAULT_TRUST);
for (int i = 0; i < size; ++i) this.additional.setElement(i, i, DEFAULT_TRUST);
for (int i = 0; i < size; ++i) this.additional.setElement(i, i, DEFAULT_TRUST);
diag.setElement(i, i, rowSum);
diag.setElement(i, i, rowSum);
diag.setElement(i, i, rowSum);