@Override public Double set( final int i, final Double value) { final int row = i % this.rowCount; final int column = i / this.rowCount; final double previous = getElement(row, column); setElement(row, column, value); return previous; }
@Override public Double set( final int i, final Double value) { final int row = i % this.rowCount; final int column = i / this.rowCount; final double previous = getElement(row, column); setElement(row, column, value); return previous; }
@Override public Double set( final int i, final Double value) { final int row = i % this.rowCount; final int column = i / this.rowCount; final double previous = getElement(row, column); setElement(row, column, value); return previous; }
@Override public void increment( final int row, final int column, final double value) { this.setElement(row, column, this.getElement(row, column) + value); }
@Override public void increment( final int row, final int column, final double value) { this.setElement(row, column, this.getElement(row, column) + value); }
@Override public void increment( final int row, final int column, final double value) { this.setElement(row, column, this.getElement(row, column) + value); }
@Override public void setSubMatrix( final int minRow, final int minColumn, final Matrix submatrix ) { final int M = submatrix.getNumRows(); final int N = submatrix.getNumColumns(); for (int i = 0; i < M; i++) { final int setRow = minRow+i; for (int j = 0; j < N; j++) { final double v = submatrix.getElement( i, j ); this.setElement( setRow, minColumn + j, v ); } } }
@Override public void setSubMatrix( final int minRow, final int minColumn, final Matrix submatrix ) { final int M = submatrix.getNumRows(); final int N = submatrix.getNumColumns(); for (int i = 0; i < M; i++) { final int setRow = minRow+i; for (int j = 0; j < N; j++) { final double v = submatrix.getElement( i, j ); this.setElement( setRow, minColumn + j, v ); } } }
@Override public void setSubMatrix( final int minRow, final int minColumn, final Matrix submatrix ) { final int M = submatrix.getNumRows(); final int N = submatrix.getNumColumns(); for (int i = 0; i < M; i++) { final int setRow = minRow+i; for (int j = 0; j < N; j++) { final double v = submatrix.getElement( i, j ); this.setElement( setRow, minColumn + j, v ); } } }
@Override public void setRow( int rowIndex, Vector rowVector ) { int N = this.getNumColumns(); if (N != rowVector.getDimensionality()) { throw new DimensionalityMismatchException( N, rowVector.getDimensionality() ); } for (int j = 0; j < N; j++) { this.setElement( rowIndex, j, rowVector.getElement( j ) ); } }
@Override public void setColumn( int columnIndex, Vector columnVector ) { int M = this.getNumRows(); if (M != columnVector.getDimensionality()) { throw new DimensionalityMismatchException( M, columnVector.getDimensionality() ); } for (int i = 0; i < M; i++) { this.setElement( i, columnIndex, columnVector.getElement( i ) ); } }
@Override public void setRow( int rowIndex, Vector rowVector ) { int N = this.getNumColumns(); if (N != rowVector.getDimensionality()) { throw new DimensionalityMismatchException( N, rowVector.getDimensionality() ); } for (int j = 0; j < N; j++) { this.setElement( rowIndex, j, rowVector.getElement( j ) ); } }
@Override public void setColumn( int columnIndex, Vector columnVector ) { int M = this.getNumRows(); if (M != columnVector.getDimensionality()) { throw new DimensionalityMismatchException( M, columnVector.getDimensionality() ); } for (int i = 0; i < M; i++) { this.setElement( i, columnIndex, columnVector.getElement( i ) ); } }
@Override public void setColumn( int columnIndex, Vector columnVector ) { int M = this.getNumRows(); if (M != columnVector.getDimensionality()) { throw new DimensionalityMismatchException( M, columnVector.getDimensionality() ); } for (int i = 0; i < M; i++) { this.setElement( i, columnIndex, columnVector.getElement( i ) ); } }
@Override public void setRow( int rowIndex, Vector rowVector ) { int N = this.getNumColumns(); if (N != rowVector.getDimensionality()) { throw new DimensionalityMismatchException( N, rowVector.getDimensionality() ); } for (int j = 0; j < N; j++) { this.setElement( rowIndex, j, rowVector.getElement( j ) ); } }
@Override public void dotDivideEquals( final Matrix other) { this.assertSameDimensions(other); // This is a dense loop since there is no sparsity in division. final int rowCount = this.getNumRows(); final int columnCount = this.getNumColumns(); for (int i = 0; i < rowCount; i++) { for (int j = 0; j < columnCount; j++) { this.setElement(i, j, this.getElement(i, j) / other.getElement(i, j)); } } }
@Override public void dotDivideEquals( final Matrix other) { this.assertSameDimensions(other); // This is a dense loop since there is no sparsity in division. final int rowCount = this.getNumRows(); final int columnCount = this.getNumColumns(); for (int i = 0; i < rowCount; i++) { for (int j = 0; j < columnCount; j++) { this.setElement(i, j, this.getElement(i, j) / other.getElement(i, j)); } } }
@Override public void dotDivideEquals( final Matrix other) { this.assertSameDimensions(other); // This is a dense loop since there is no sparsity in division. final int rowCount = this.getNumRows(); final int columnCount = this.getNumColumns(); for (int i = 0; i < rowCount; i++) { for (int j = 0; j < columnCount; j++) { this.setElement(i, j, this.getElement(i, j) / other.getElement(i, j)); } } }