/* size of the matrix */ #define N 4 #define epsilon 0.0001 typedef float NUM; NUM A[N][N]; NUM b[N]; NUM gi[N]; NUM gsi[N]; NUM hi[N]; NUM hsi[N]; NUM xi[N]; NUM xsi[N]; NUM gamma; NUM rho; void evalA(NUM *x, NUM *y) { /* computes y=Ax */ int i,j; for (i=0;i epsilon) { /* if (k>=1) norm = __BUILTIN_DAED_FPRINT(norm,norm);*/ evalA(hi,temp); rho = scalarproduct(hi,temp); norm2 = norm; gamma = norm2/rho; multadd(xi,hi,1,gamma,xsi); multadd(gi,temp,1,-gamma,gsi); norm = scalarproduct(gsi,gsi); beta = norm/norm2; multadd(gsi,hi,1,beta,hsi); for (j=0;j