@Override public void minusEquals( final Vector other) { // This is a generic implementation to support interoperability. // Sub-classes should make custom ones for performance. this.assertSameDimensionality(other); for (final VectorEntry entry : other) { this.decrement(entry.getIndex(), entry.getValue()); } }
@Override public void plusEquals( final Vector other) { // This is a generic implementation to support interoperability. // Sub-classes should make custom ones for performance. this.assertSameDimensionality(other); for (final VectorEntry entry : other) { this.increment(entry.getIndex(), entry.getValue()); } }
@Override public void minusEquals( final Vector other) { // This is a generic implementation to support interoperability. // Sub-classes should make custom ones for performance. this.assertSameDimensionality(other); for (final VectorEntry entry : other) { this.decrement(entry.getIndex(), entry.getValue()); } }
@Override public void plusEquals( final Vector other) { // This is a generic implementation to support interoperability. // Sub-classes should make custom ones for performance. this.assertSameDimensionality(other); for (final VectorEntry entry : other) { this.increment(entry.getIndex(), entry.getValue()); } }
@Override public void plusEquals( final Vector other) { // This is a generic implementation to support interoperability. // Sub-classes should make custom ones for performance. this.assertSameDimensionality(other); for (final VectorEntry entry : other) { this.increment(entry.getIndex(), entry.getValue()); } }
@Override public void minusEquals( final Vector other) { // This is a generic implementation to support interoperability. // Sub-classes should make custom ones for performance. this.assertSameDimensionality(other); for (final VectorEntry entry : other) { this.decrement(entry.getIndex(), entry.getValue()); } }
@Override public void scaledPlusEquals( final double scaleFactor, final Vector other) { // This is a generic implementation to support interoperability. // Sub-classes should make custom ones for performance. this.assertSameDimensionality(other); for (final VectorEntry entry : other) { this.increment(entry.getIndex(), scaleFactor * entry.getValue()); } }
@Override public void scaledPlusEquals( final double scaleFactor, final Vector other) { // This is a generic implementation to support interoperability. // Sub-classes should make custom ones for performance. this.assertSameDimensionality(other); for (final VectorEntry entry : other) { this.increment(entry.getIndex(), scaleFactor * entry.getValue()); } }
@Override public void scaledPlusEquals( final double scaleFactor, final Vector other) { // This is a generic implementation to support interoperability. // Sub-classes should make custom ones for performance. this.assertSameDimensionality(other); for (final VectorEntry entry : other) { this.increment(entry.getIndex(), scaleFactor * entry.getValue()); } }
@Override public double dotProduct( final Vector other) { // This is a generic implementation to support interoperability. // Sub-classes should make custom ones for performance. this.assertSameDimensionality(other); double result = 0.0; for (final VectorEntry entry : this) { result += entry.getValue() * other.get(entry.getIndex()); } return result; }
@Override public double dotProduct( final Vector other) { // This is a generic implementation to support interoperability. // Sub-classes should make custom ones for performance. this.assertSameDimensionality(other); double result = 0.0; for (final VectorEntry entry : this) { result += entry.getValue() * other.get(entry.getIndex()); } return result; }
@Override public double dotProduct( final Vector other) { // This is a generic implementation to support interoperability. // Sub-classes should make custom ones for performance. this.assertSameDimensionality(other); double result = 0.0; for (final VectorEntry entry : this) { result += entry.getValue() * other.get(entry.getIndex()); } return result; }
/** * Assigns the values in the provided vector into this. * * @param parameters The vector to convert. */ @Override public void convertFromVector( final Vector parameters ) { this.assertSameDimensionality( parameters ); final int dimensionality = this.getDimensionality(); for (int i = 0; i < dimensionality; i++) { this.setElement( i, parameters.getElement( i ) ); } }
/** * Assigns the values in the provided vector into this. * * @param parameters The vector to convert. */ @Override public void convertFromVector( final Vector parameters ) { this.assertSameDimensionality( parameters ); final int dimensionality = this.getDimensionality(); for (int i = 0; i < dimensionality; i++) { this.setElement( i, parameters.getElement( i ) ); } }
@Override public void dotTimesEquals( final Vector other) { // This is a generic implementation to support interoperability. // Sub-classes should make custom ones for performance. this.assertSameDimensionality(other); for (final VectorEntry entry : this) { entry.setValue(entry.getValue() * other.get(entry.getIndex())); } }
@Override public void dotDivideEquals( final Vector other) { this.assertSameDimensionality(other); // This is a dense loop since there is no sparsity in division. final int dimensionality = this.getDimensionality(); for (int i = 0; i < dimensionality; i++) { this.setElement(i, this.getElement(i) / other.getElement(i)); } }
@Override public void dotTimesEquals( final Vector other) { // This is a generic implementation to support interoperability. // Sub-classes should make custom ones for performance. this.assertSameDimensionality(other); for (final VectorEntry entry : this) { entry.setValue(entry.getValue() * other.get(entry.getIndex())); } }
@Override public void dotDivideEquals( final Vector other) { this.assertSameDimensionality(other); // This is a dense loop since there is no sparsity in division. final int dimensionality = this.getDimensionality(); for (int i = 0; i < dimensionality; i++) { this.setElement(i, this.getElement(i) / other.getElement(i)); } }
@Override public void dotTimesEquals( final Vector other) { // This is a generic implementation to support interoperability. // Sub-classes should make custom ones for performance. this.assertSameDimensionality(other); for (final VectorEntry entry : this) { entry.setValue(entry.getValue() * other.get(entry.getIndex())); } }
@Override public void dotDivideEquals( final Vector other) { this.assertSameDimensionality(other); // This is a dense loop since there is no sparsity in division. final int dimensionality = this.getDimensionality(); for (int i = 0; i < dimensionality; i++) { this.setElement(i, this.getElement(i) / other.getElement(i)); } }