@Override public void setValue(int attributeIndex, double d) { int index = locateIndex(attributeIndex); if (index(index) == attributeIndex) { this.attributeValues[index] = d; } else { // We need to add the value } }
/** * Sets the value. * * @param attributeIndex the attribute index * @param d the d */ @Override public void setValue(int attributeIndex, double d) { int index = locateIndex(attributeIndex); if (index(index) == attributeIndex) { this.attributeValues[index] = d; } else { // We need to add the value } }
@Override public double[] toDoubleArray() { double[] array = new double[numAttributes()]; for (int i=0; i<numValues() ; i++) { array[index(i)] = valueSparse(i); } return array; }
/** * To double array. * * @return the double[] */ @Override public double[] toDoubleArray() { double[] array = new double[numAttributes()]; for (int i = 0; i < numValues(); i++) { array[index(i)] = valueSparse(i); } return array; }