need help on simplex method


LocalKing
01-14-2007, 11:19 AM
Hi, I'm new to this forum and this is my first post. I'm trying to use the simplex method and have the following code:
...
int ntmp;
float p[3][2], y[3];

p[0][0]=p[0][1]=0.5;
p[1][0]=p[0][0]-0.2;
p[1][1]=p[0][1]-0.2;
p[2][0]=p[0][0]+0.2;
p[2][1]=p[0][1]-0.2;

amoeba(p, y, 2, 1.0e-5, getfunc, &ntmp);
...

where getfunc is something like
float getfunc(float x[])
{...}

The problem is that the amoeba subroutine cannot read the initial values of p. I don't know if it is because the declaration of p or something else.

Thank you for your help!