54 for(
int i=0;i<size;i++)
55 for(
int j=i;j<size;j++)
56 matrix(i,j) = matrix(j,i) = rand()*1.0/RAND_MAX;
58 vector<double> a(m,0);
59 vector<double> b(m,0);
69 double norm = sqrt(dot(qb,qb));
79 (*f1) += matrix*(*f2);
81 a[i-1] = dot(*f1,*f2);
83 (*f1) -= a[i-1]*(*f2);
85 b[i] = sqrt(dot(*f1,*f1));
87 if( fabs(b[i]) < 1e-10 )
104 T(j,j-1) = T(j-1,j) = b[j];
107 vec eigs1 = eig_sym(T);
108 vec eigs2 = eig_sym(matrix);
110 cout << eigs1[0] << endl;
112 cout << eigs2[0] << endl;