/** * Get the histogram (coherent followed by incoherent) as a double * vector. * * @return A {@link DoubleFV} feature vector */ public DoubleFV asDoubleFV() { final double[] d = new double[coherentHistogram.values.length + incoherentHistogram.values.length]; int i = 0; for (final double dd : coherentHistogram.asDoubleVector()) d[i++] = dd; for (final double dd : incoherentHistogram.asDoubleVector()) d[i++] = dd; return new DoubleFV(d); }
/** * Get the histogram (coherent followed by incoherent) as a double * vector. * * @return A {@link DoubleFV} feature vector */ public DoubleFV asDoubleFV() { final double[] d = new double[coherentHistogram.values.length + incoherentHistogram.values.length]; int i = 0; for (final double dd : coherentHistogram.asDoubleVector()) d[i++] = dd; for (final double dd : incoherentHistogram.asDoubleVector()) d[i++] = dd; return new DoubleFV(d); }
/** * Get the histogram as a multidimensional vector, where the coherent * and incoherent histograms occupy different dimensions. So the vector * will be 2xnBins. * * @return A {@link MultidimensionalDoubleFV} */ public MultidimensionalDoubleFV asMultidimensionalDoubleFV() { final double[][] d = new double[2][coherentHistogram.values.length]; int i = 0; for (final double dd : coherentHistogram.asDoubleVector()) d[0][i++] = dd; i = 0; for (final double dd : incoherentHistogram.asDoubleVector()) d[1][i++] = dd; return new MultidimensionalDoubleFV(d); } }
/** * Get the histogram as a multidimensional vector, where the coherent * and incoherent histograms occupy different dimensions. So the vector * will be 2xnBins. * * @return A {@link MultidimensionalDoubleFV} */ public MultidimensionalDoubleFV asMultidimensionalDoubleFV() { final double[][] d = new double[2][coherentHistogram.values.length]; int i = 0; for (final double dd : coherentHistogram.asDoubleVector()) d[0][i++] = dd; i = 0; for (final double dd : incoherentHistogram.asDoubleVector()) d[1][i++] = dd; return new MultidimensionalDoubleFV(d); } }