compress(); int nnz = numNonZeroAfterOp(other, SparseMatrix.Combiner.OR); double[] valsAfter = new double[nnz]; int[] locsAfter = new int[nnz];
compress(); int nnz = numNonZeroAfterOp(other, SparseMatrix.Combiner.OR); double[] valsAfter = new double[nnz]; int[] locsAfter = new int[nnz];
compress(); int nnz = numNonZeroAfterOp(other, SparseMatrix.Combiner.OR); double[] valsAfter = new double[nnz]; int[] locsAfter = new int[nnz];
@Override public final void dotTimesEquals( final SparseVector other) { this.assertSameDimensionality(other); compress(); other.compress(); int nnz = numNonZeroAfterOp(other, SparseMatrix.Combiner.AND); double[] valsAfter = new double[nnz]; int[] locsAfter = new int[nnz]; int outidx = 0; int otheridx = 0; for (int i = 0; i < values.length; ++i) { while (other.indices[otheridx] < indices[i]) { ++otheridx; } if (other.indices[otheridx] == indices[i]) { valsAfter[outidx] = values[i] * other.values[otheridx]; locsAfter[outidx] = indices[i]; ++outidx; ++otheridx; } } values = valsAfter; indices = locsAfter; }
@Override public final void dotTimesEquals( final SparseVector other) { this.assertSameDimensionality(other); compress(); other.compress(); int nnz = numNonZeroAfterOp(other, SparseMatrix.Combiner.AND); double[] valsAfter = new double[nnz]; int[] locsAfter = new int[nnz]; int outidx = 0; int otheridx = 0; for (int i = 0; i < values.length; ++i) { while (other.indices[otheridx] < indices[i]) { ++otheridx; } if (other.indices[otheridx] == indices[i]) { valsAfter[outidx] = values[i] * other.values[otheridx]; locsAfter[outidx] = indices[i]; ++outidx; ++otheridx; } } values = valsAfter; indices = locsAfter; }
@Override public final void dotTimesEquals( final SparseVector other) { this.assertSameDimensionality(other); compress(); other.compress(); int nnz = numNonZeroAfterOp(other, SparseMatrix.Combiner.AND); double[] valsAfter = new double[nnz]; int[] locsAfter = new int[nnz]; int outidx = 0; int otheridx = 0; for (int i = 0; i < values.length; ++i) { while (other.indices[otheridx] < indices[i]) { ++otheridx; } if (other.indices[otheridx] == indices[i]) { valsAfter[outidx] = values[i] * other.values[otheridx]; locsAfter[outidx] = indices[i]; ++outidx; ++otheridx; } } values = valsAfter; indices = locsAfter; }