public static double [ ] rowMeans ( RealMatrix matrix ) { // Get the col sums: double [ ] retval = EMatrixUtils . rowSums ( matrix ) ; // Iterate over return value and divide by the length: for ( int i = 0 ; i < retval . length ; i ++ ) { retval [ i ] = retval [ i ] / matrix . getColumnDimension ( ) ; } // Done, return row means: return retval ; }
Returns the means of rows .