/** * Merges this instance with the given instance and returns the result. * Dataset is set to null. The returned instance is of the same type as this * instance. * * @param inst the instance to be merged with this one * @return the merged instances */ @Override public Instance mergeInstance(Instance inst) { int m = 0; double[] newVals = new double[numAttributes() + inst.numAttributes()]; for (int j = 0; j < numAttributes(); j++, m++) { newVals[m] = value(j); } for (int j = 0; j < inst.numAttributes(); j++, m++) { newVals[m] = inst.value(j); } return new DenseInstance(1.0, newVals); }
/** * Merges this instance with the given instance and returns the result. * Dataset is set to null. The returned instance is of the same type as this * instance. * * @param inst the instance to be merged with this one * @return the merged instances */ @Override public Instance mergeInstance(Instance inst) { int m = 0; double[] newVals = new double[numAttributes() + inst.numAttributes()]; for (int j = 0; j < numAttributes(); j++, m++) { newVals[m] = value(j); } for (int j = 0; j < inst.numAttributes(); j++, m++) { newVals[m] = inst.value(j); } return new DenseInstance(1.0, newVals); }