| Chunk |
|---|
| Conflicting content |
|---|
public SparseHashDoubleVector(double[] values) {
maxLength = values.length;
vector = new TIntDoubleHashMap();
<<<<<<< HEAD
magnitude = 0;
=======
nonZeroIndices = null;
magnitude = -1;
>>>>>>> f531ee97edf575d4db5e38bd4bc23688231acb62
for (int i = 0; i < values.length; ++i) {
if (values[i] != 0) {
vector.put(i, values[i]); |
| Solution content |
|---|
public SparseHashDoubleVector(double[] values) {
maxLength = values.length;
vector = new TIntDoubleHashMap();
nonZeroIndices = null;
magnitude = -1;
for (int i = 0; i < values.length; ++i) {
if (values[i] != 0) {
vector.put(i, values[i]); |
| File |
|---|
| SparseHashDoubleVector.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Attribute |
| Chunk |
|---|
| Conflicting content |
|---|
*/
public SparseHashDoubleVector(DoubleVector values) {
maxLength = values.length();
<<<<<<< HEAD
vector = new TIntDoubleHashMap();
magnitude = values.magnitude();
if (values instanceof SparseVector) {
=======
nonZeroIndices = null;
magnitude = -1;
if (values instanceof SparseHashDoubleVector) {
SparseHashDoubleVector v = (SparseHashDoubleVector)values;
vector = new TIntDoubleHashMap(v.vector);
}
else if (values instanceof SparseVector) {
>>>>>>> f531ee97edf575d4db5e38bd4bc23688231acb62
int[] nonZeros = ((SparseVector) values).getNonZeroIndices();
vector = new TIntDoubleHashMap(nonZeros.length);
for (int index : nonZeros) |
| Solution content |
|---|
*/
public SparseHashDoubleVector(DoubleVector values) {
maxLength = values.length();
nonZeroIndices = null;
magnitude = -1;
if (values instanceof SparseHashDoubleVector) {
SparseHashDoubleVector v = (SparseHashDoubleVector)values;
vector = new TIntDoubleHashMap(v.vector);
}
else if (values instanceof SparseVector) {
int[] nonZeros = ((SparseVector) values).getNonZeroIndices();
vector = new TIntDoubleHashMap(nonZeros.length);
for (int index : nonZeros) |
| File |
|---|
| SparseHashDoubleVector.java |
| Developer's decision |
|---|
| Version 2 |
| Kind of conflict |
|---|
| Attribute |
| Cast expression |
| If statement |
| Method invocation |
| Variable |