1
public static double PrazenWindowDensity(double [][] Xn, double x, double sigma2)
{
double gauss = 0;
foreach(double [] arr in Xn)
{
foreach (double item in arr)
{
double xx = GausianFunction(item, x, sigma2);
gauss += xx;
}
}
return gauss/Xn.Length; //this is surely incorrect. Isn't it?
}
ここには何が書けますか?2Dジグザグ配列の要素数を調べる標準的な方法は何ですか?
return gauss/Xn.Length;
です。 http://stackoverflow.com/questions/262934/is-it-costly-to-do-array-length-or-list-count-in-a-loop – Eric
@Eric、hmmm ...正しいです! – anonymous