I want to change the function of probability density function from Gaussian to Kernel(Opendtect). But, I have got an error, "Error C2109: subscript requires array or pointer type"
Is anyone have solution? I'm using Visual Studio 2013. Thanks before.
The problem is that nowhere in your code have you defined any array variables.
1 2 3 4 5 6 7 8 9 10 11 12 13
// Neither x1 nor x2 are arrays, they are single floating point numbers.
r = pow((x1 - x1[i]), 2);
s = pow((x2 - x2[j]), 2);
// epow is not a multidimensional array, just a single int.
epow[x1][x2] = Math::Exp(-1.0f * (r + s) / onemccsq);
// Also array indexes must be integral types, not floating point types.
sum += epow[x1][x2];
}
}
// Why are you all of a sudden treating epow as a single int here?
return fac * epow;