@Override public double get( final int rowIndex, final int columnIndex) { checkBounds(rowIndex, columnIndex); if (rowIndex == columnIndex) { return diagonal[rowIndex]; } return 0.0; }
@Override public double get( final int rowIndex, final int columnIndex) { checkBounds(rowIndex, columnIndex); if (rowIndex == columnIndex) { return diagonal[rowIndex]; } return 0.0; }
@Override public double get( final int rowIndex, final int columnIndex) { checkBounds(rowIndex, columnIndex); if (rowIndex == columnIndex) { return diagonal[rowIndex]; } return 0.0; }
/** * Returns the value stored at the input locations * * @param rowIndex The row index * @param columnIndex The column index * @return the value stored at the input locations * @throws ArrayIndexOutOfBoundsException if the input values are outside * the matrix */ @Override final public double getElement( final int rowIndex, final int columnIndex) { checkBounds(rowIndex, columnIndex); if (rowIndex == columnIndex) { return diagonal[rowIndex]; } return 0.0; }
/** * Returns the value stored at the input locations * * @param rowIndex The row index * @param columnIndex The column index * @return the value stored at the input locations * @throws ArrayIndexOutOfBoundsException if the input values are outside * the matrix */ @Override final public double getElement( final int rowIndex, final int columnIndex) { checkBounds(rowIndex, columnIndex); if (rowIndex == columnIndex) { return diagonal[rowIndex]; } return 0.0; }
/** * Returns the value stored at the input locations * * @param rowIndex The row index * @param columnIndex The column index * @return the value stored at the input locations * @throws ArrayIndexOutOfBoundsException if the input values are outside * the matrix */ @Override final public double getElement( final int rowIndex, final int columnIndex) { checkBounds(rowIndex, columnIndex); if (rowIndex == columnIndex) { return diagonal[rowIndex]; } return 0.0; }
/** * Set the value stored at the input locations to the input value * * @param rowIndex The row index * @param columnIndex The column index * @param value The new value for the input location * @throws ArrayIndexOutOfBoundsException if the input indices are outside * the matrix * @throws IllegalArgumentException if the input indices attempt to set a * non-zero value off the main axis */ @Override final public void setElement( final int rowIndex, final int columnIndex, final double value) { checkBounds(rowIndex, columnIndex); if (rowIndex == columnIndex) { diagonal[rowIndex] = value; } else if (value != 0) { throw new IllegalArgumentException( "Unable to set an off-axis value in " + "a diagonal matrix"); } }
/** * Set the value stored at the input locations to the input value * * @param rowIndex The row index * @param columnIndex The column index * @param value The new value for the input location * @throws ArrayIndexOutOfBoundsException if the input indices are outside * the matrix * @throws IllegalArgumentException if the input indices attempt to set a * non-zero value off the main axis */ @Override final public void setElement( final int rowIndex, final int columnIndex, final double value) { checkBounds(rowIndex, columnIndex); if (rowIndex == columnIndex) { diagonal[rowIndex] = value; } else if (value != 0) { throw new IllegalArgumentException( "Unable to set an off-axis value in " + "a diagonal matrix"); } }
/** * Set the value stored at the input locations to the input value * * @param rowIndex The row index * @param columnIndex The column index * @param value The new value for the input location * @throws ArrayIndexOutOfBoundsException if the input indices are outside * the matrix * @throws IllegalArgumentException if the input indices attempt to set a * non-zero value off the main axis */ @Override final public void setElement( final int rowIndex, final int columnIndex, final double value) { checkBounds(rowIndex, columnIndex); if (rowIndex == columnIndex) { diagonal[rowIndex] = value; } else if (value != 0) { throw new IllegalArgumentException( "Unable to set an off-axis value in " + "a diagonal matrix"); } }