public void scaleEquals( double scaleFactor) { // Iterators loop over all values, or all nonzero, values in "this". // The resulting matrix doesn't need to element-wise multiply the // zero values, since the result would be zero anyway. for (MatrixEntry e : this) { e.setValue(e.getValue() * scaleFactor); } }
public void scaleEquals( double scaleFactor) { // Iterators loop over all values, or all nonzero, values in "this". // The resulting matrix doesn't need to element-wise multiply the // zero values, since the result would be zero anyway. for (MatrixEntry e : this) { e.setValue(e.getValue() * scaleFactor); } }
public void scaleEquals( double scaleFactor) { // Iterators loop over all values, or all nonzero, values in "this". // The resulting matrix doesn't need to element-wise multiply the // zero values, since the result would be zero anyway. for (MatrixEntry e : this) { e.setValue(e.getValue() * scaleFactor); } }
@Override public void dotTimesEquals( final Matrix other) { // This is a generic implementation to support interoperability. // Sub-classes should make custom ones for performance. this.assertSameDimensions(other); for (final MatrixEntry entry : this) { entry.setValue(entry.getValue() * other.get(entry.getRowIndex(), entry.getColumnIndex())); } }
@Override public void dotTimesEquals( final Matrix other) { // This is a generic implementation to support interoperability. // Sub-classes should make custom ones for performance. this.assertSameDimensions(other); for (final MatrixEntry entry : this) { entry.setValue(entry.getValue() * other.get(entry.getRowIndex(), entry.getColumnIndex())); } }
@Override public void dotTimesEquals( final Matrix other) { // This is a generic implementation to support interoperability. // Sub-classes should make custom ones for performance. this.assertSameDimensions(other); for (final MatrixEntry entry : this) { entry.setValue(entry.getValue() * other.get(entry.getRowIndex(), entry.getColumnIndex())); } }
/** * Inline element-wise multiplication of the elements in <code>this</code> * and <code>matrix</code>, modifies the elements of <code>this</code> * * @param matrix Must have same dimensions <code>this</code> */ public void dotTimesEquals( final AbstractMTJMatrix matrix) { // make sure the matrices are the same dimension this.assertSameDimensions(matrix); // Iterators loop over all values, or all nonzero, values in "this". // The resulting matrix doesn't need to element-wise multiply the // zero values, since the result would be zero anyway. for (MatrixEntry e : this) { double otherValue = matrix.getElement( e.getRowIndex(), e.getColumnIndex()); e.setValue(e.getValue() * otherValue); } }
/** * Inline element-wise multiplication of the elements in <code>this</code> * and <code>matrix</code>, modifies the elements of <code>this</code> * * @param matrix Must have same dimensions <code>this</code> */ public void dotTimesEquals( final AbstractMTJMatrix matrix) { // make sure the matrices are the same dimension this.assertSameDimensions(matrix); // Iterators loop over all values, or all nonzero, values in "this". // The resulting matrix doesn't need to element-wise multiply the // zero values, since the result would be zero anyway. for (MatrixEntry e : this) { double otherValue = matrix.getElement( e.getRowIndex(), e.getColumnIndex()); e.setValue(e.getValue() * otherValue); } }
/** * Inline element-wise multiplication of the elements in <code>this</code> * and <code>matrix</code>, modifies the elements of <code>this</code> * * @param matrix Must have same dimensions <code>this</code> */ public void dotTimesEquals( final AbstractMTJMatrix matrix) { // make sure the matrices are the same dimension this.assertSameDimensions(matrix); // Iterators loop over all values, or all nonzero, values in "this". // The resulting matrix doesn't need to element-wise multiply the // zero values, since the result would be zero anyway. for (MatrixEntry e : this) { double otherValue = matrix.getElement( e.getRowIndex(), e.getColumnIndex()); e.setValue(e.getValue() * otherValue); } }