/** * {@inheritDoc} * * NOTE: Upon completion this is in the compressed Yale format. * * @param rowIndex {@inheritDoc} * @param columnIndex {@inheritDoc} * @param value {@inheritDoc} * @throws ArrayIndexOutOfBoundsException if the indices are out of bounds */ @Override public void set( final int rowIndex, final int columnIndex, final double value) { setElement(rowIndex, columnIndex, value); }
/** * {@inheritDoc} * * NOTE: Upon completion this is in the compressed Yale format. * * @param rowIndex {@inheritDoc} * @param columnIndex {@inheritDoc} * @param value {@inheritDoc} * @throws ArrayIndexOutOfBoundsException if the indices are out of bounds */ @Override public void set( final int rowIndex, final int columnIndex, final double value) { setElement(rowIndex, columnIndex, value); }
/** * {@inheritDoc} * * NOTE: Upon completion this is in the compressed Yale format. * * @param rowIndex {@inheritDoc} * @param columnIndex {@inheritDoc} * @param value {@inheritDoc} * @throws ArrayIndexOutOfBoundsException if the indices are out of bounds */ @Override public void set( final int rowIndex, final int columnIndex, final double value) { setElement(rowIndex, columnIndex, value); }
int j = eachPartsStart[toGroup] + toIndex; multipartiteAdjacency.setElement(i, j, weight); multipartiteAdjacency.setElement(j, i, weight);
int j = eachPartsStart[toGroup] + toIndex; multipartiteAdjacency.setElement(i, j, weight); multipartiteAdjacency.setElement(j, i, weight);
int j = eachPartsStart[toGroup] + toIndex; multipartiteAdjacency.setElement(i, j, weight); multipartiteAdjacency.setElement(j, i, weight);
@Override final public Matrix getSubMatrix( final int minRow, final int maxRow, final int minColumn, final int maxColumn) { checkSubmatrixRange(minRow, maxRow, minColumn, maxColumn); SparseMatrix result = new SparseMatrix(maxRow - minRow + 1, maxColumn - minColumn + 1); // You only need worry about the diagonal, so one of the extents will do for (int i = minRow; i <= maxRow; ++i) { // Check to make sure that this element of the diagonal is also in // the other extents if (i >= minColumn && i <= maxColumn) { // If it is, add it at the right place in the output result.setElement(i - minRow, i - minColumn, get(i, i)); } } return result; }
@Override final public Matrix getSubMatrix( final int minRow, final int maxRow, final int minColumn, final int maxColumn) { checkSubmatrixRange(minRow, maxRow, minColumn, maxColumn); SparseMatrix result = new SparseMatrix(maxRow - minRow + 1, maxColumn - minColumn + 1); // You only need worry about the diagonal, so one of the extents will do for (int i = minRow; i <= maxRow; ++i) { // Check to make sure that this element of the diagonal is also in // the other extents if (i >= minColumn && i <= maxColumn) { // If it is, add it at the right place in the output result.setElement(i - minRow, i - minColumn, get(i, i)); } } return result; }
@Override final public Matrix getSubMatrix( final int minRow, final int maxRow, final int minColumn, final int maxColumn) { checkSubmatrixRange(minRow, maxRow, minColumn, maxColumn); SparseMatrix result = new SparseMatrix(maxRow - minRow + 1, maxColumn - minColumn + 1); // You only need worry about the diagonal, so one of the extents will do for (int i = minRow; i <= maxRow; ++i) { // Check to make sure that this element of the diagonal is also in // the other extents if (i >= minColumn && i <= maxColumn) { // If it is, add it at the right place in the output result.setElement(i - minRow, i - minColumn, get(i, i)); } } return result; }
/** * {@inheritDoc} * * NOTE: Upon completion, this is in compressed Yale format. Returned sparse * matrix is in sparse vector format. * * @return {@inheritDoc} */ @Override final public Matrix transpose() { SparseMatrix result = new SparseMatrix(numCols, numRows); if (!isCompressed()) { compress(); } int rowNum = 0; for (int i = 0; i < values.length; ++i) { while (i >= firstIndicesForRows[rowNum + 1]) { ++rowNum; } result.setElement(columnIndices[i], rowNum, values[i]); } return result; }
/** * {@inheritDoc} * * NOTE: Upon completion, this is in compressed Yale format. Returned sparse * matrix is in sparse vector format. * * @return {@inheritDoc} */ @Override final public Matrix transpose() { SparseMatrix result = new SparseMatrix(numCols, numRows); if (!isCompressed()) { compress(); } int rowNum = 0; for (int i = 0; i < values.length; ++i) { while (i >= firstIndicesForRows[rowNum + 1]) { ++rowNum; } result.setElement(columnIndices[i], rowNum, values[i]); } return result; }
/** * {@inheritDoc} * * NOTE: Upon completion, this is in compressed Yale format. Returned sparse * matrix is in sparse vector format. * * @return {@inheritDoc} */ @Override final public Matrix transpose() { SparseMatrix result = new SparseMatrix(numCols, numRows); if (!isCompressed()) { compress(); } int rowNum = 0; for (int i = 0; i < values.length; ++i) { while (i >= firstIndicesForRows[rowNum + 1]) { ++rowNum; } result.setElement(columnIndices[i], rowNum, values[i]); } return result; }