#include
#include
#define m 10 /*数组长度m >= 维数n */
float f(float x[]);
void mjtf(int n,float x0[],float h,float s[],float a[],float b[]);
void mhjfgf(int n,float a[],float b[],float flag,float x[]);
void mbwef(int n,float x0[],float h,float flag,float a[],float b[],float x[]);
float f(float x[])
{
float result;
result=(x[0]-2)*(x[0]-2)+(x[1]-3)*(x[1]-3)+(x[2]-4)*(x[2]-4);
return result;
}
/*多维进退法子程序*/
void mjtf(int n,float x0[],float h,float s[],float a[],float b[])
{
int i;
float x1[m],x2[m],x3[m],f1,f2,f3;
for(i=0;i
1