public static double [ ] rowSums ( double [ ] [ ] data ) { double [ ] x = new double [ data . length ] ; for ( int i = 0 ; i < x . length ; i ++ ) { x [ i ] = sum ( data [ i ] ) ; } return x ; }
Returns the row sums for a matrix .