protected double[] aggregateInternal(double[][] descriptors) {
		double[] vlad = new double[numCentroids * descriptorLength];
		// when there are 0 local descriptors extracted
		if (descriptors.length == 0) {
			return vlad;
		}

		for (double[] descriptor : descriptors) {
			int nnIndex = computeNearestCentroid(descriptor);
			for (int i = 0; i < descriptorLength; i++) {
				vlad[nnIndex * descriptorLength + i] += descriptor[i] - codebook[nnIndex][i];
			}
		}
		return vlad;
	}
protected double [ ] aggregateInternal ( double [ ] [ ] descriptors ) { double [ ] vlad = new double [ numCentroids * descriptorLength ] ; if ( descriptors . length == 0 ) { return vlad ; } for ( double [ ] descriptor : descriptors ) { int nnIndex = computeNearestCentroid ( descriptor ) ; for ( int i = 0 ; i < descriptorLength ; i ++ ) { vlad [ nnIndex * descriptorLength + i ] += descriptor [ i ] - codebook [ nnIndex ] [ i ] ; } } return vlad ; }
Same as {@link #aggregateInternal(ArrayList)} but takes a two-dimensional array as input.

@param descriptors
@return the VLAD vector
@throws Exception