Subversion Repositories gelsvn

Rev

Rev 501 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 501 Rev 595
Line -... Line 1...
-
 
1
/* ----------------------------------------------------------------------- *
-
 
2
 * This file is part of GEL, http://www.imm.dtu.dk/GEL
-
 
3
 * Copyright (C) the authors and DTU Informatics
-
 
4
 * For license and list of authors, see ../../doc/intro.pdf
-
 
5
 * ----------------------------------------------------------------------- */
-
 
6
 
1
#include "eigensolution.h"
7
#include "eigensolution.h"
2
 
8
 
3
#include "Mat2x2f.h"
9
#include "Mat2x2f.h"
4
#include "Mat3x3f.h"
10
#include "Mat3x3f.h"
5
#include "Mat4x4f.h"
11
#include "Mat4x4f.h"
Line 27... Line 33...
27
 
33
        
28
				typedef typename MT::VectorType VT;
34
        typedef typename MT::VectorType VT;
29
				MT A = Ap;
35
        MT A = Ap;
30
				unsigned int n = s_min(MT::get_v_dim(), max_sol);
36
        unsigned int n = s_min(MT::get_v_dim(), max_sol);
31
 
37
        
-
 
38
        gel_srand(0);
32
				for(unsigned int i=0;i<n;++i)
39
        for(unsigned int i=0;i<n;++i)
33
				{
40
        {
34
						// Seed the eigenvector estimate
41
            // Seed the eigenvector estimate
35
						VT q(1);
42
            VT q;
-
 
43
            for (int j=0; j<MT::get_v_dim(); ++j) 
-
 
44
                q[j] = gel_rand()/static_cast<double>(GEL_RAND_MAX);
-
 
45
            
36
						q.normalize();
46
            q.normalize();
37
						double l=123.0,l_old;
47
            double l=123,l_old;
38
 
48
            
39
						// As long as we haven't reached the max iterations and the
49
            // As long as we haven't reached the max iterations and the
40
						// eigenvalue has not converged, do
50
            // eigenvalue has not converged, do
41
						unsigned int k=0;
51
            unsigned int k=0;
42
						do
52
            do