question: public static void checkValid ( double [ ] x ) { for ( double v : x ) { if ( Double . isNaN ( v ) ) { throw new RuntimeException ( "Invalid entry " + v ) ; } } }
target:  Loop and ensure all elements are non-infiite and non-nan, throws an exception if one is