protected double innerProduct(double[] x,double[] y){
  double sum=0;
  for (int i=0; i < x.length; i++) {
    sum+=x[i] * y[i];
  }
  return sum;
}

protected double innerProduct ( double [ ] x , double [ ] y ) { double sum = 0 ; for ( int i = 0 ; i < x . length ; i ++ ) { sum += x [ i ] * y [ i ] ; } return sum ; }
return the inner product of x and y ( x . length = = y . length assumed )
