Subversion Repositories gelsvn

Rev

Rev 378 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 378 Rev 417
Line 21... Line 21...
21
using namespace LinAlg;
21
using namespace LinAlg;
22
using namespace CGLA;
22
using namespace CGLA;
23
 
23
 
24
int main()
24
int main()
25
{
25
{
26
		srand(0);
26
		gel_srand(0);
27
		double max_err_eigen=0;
27
		double max_err_eigen=0;
28
		double max_err_eigen_vec=0;
28
		double max_err_eigen_vec=0;
29
		for(int i=0;i<30;++i)
29
		for(int i=0;i<30;++i)
30
		{
30
		{
31
			int N = rand()%50+2;
31
			int N = gel_rand()%50+2;
32
			CMatrix mat(N,N,0);
32
			CMatrix mat(N,N,0);
33
			for(int i=0;i<N;++i)
33
			for(int i=0;i<N;++i)
34
				for(int j=0;j<N;++j)
34
				for(int j=0;j<N;++j)
35
				{
35
				{
36
					double x = rand()/double(RAND_MAX)-0.5;
36
					double x = gel_rand()/double(GEL_RAND_MAX)-0.5;
37
					mat.set(i,j,x);
37
					mat.set(i,j,x);
38
					mat.set(j,i,x);
38
					mat.set(j,i,x);
39
				}
39
				}
40
			CVector b;
40
			CVector b;
41
			CMatrix Q=mat;
41
			CMatrix Q=mat;