public static TupleDesc_F64 combine ( List < TupleDesc_F64 > inputs , TupleDesc_F64 combined ) { int N = 0 ; for ( int i = 0 ; i < inputs . size ( ) ; i ++ ) { N += inputs . get ( i ) . size ( ) ; } if ( combined == null ) { combined = new TupleDesc_F64 ( N ) ; } else { if ( N != combined . size ( ) ) throw new RuntimeException ( "The combined feature needs to be " + N + " not " + combined . size ( ) ) ; } int start = 0 ; for ( int i = 0 ; i < inputs . size ( ) ; i ++ ) { double v [ ] = inputs . get ( i ) . value ; System . arraycopy ( v , 0 , combined . value , start , v . length ) ; start += v . length ; } return combined ; }
Concats the list of tuples together into one big feature . The combined feature must be large enough to store all the inputs .