Subversion Repositories gelsvn

Rev

Rev 2 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 45
1
#ifndef __CGLA_EIGENSOLUTION_H__
1
#ifndef __CGLA_EIGENSOLUTION_H__
2
#define __CGLA_EIGENSOLUTION_H__
2
#define __CGLA_EIGENSOLUTION_H__
3
 
3
 
4
namespace CGLA
4
namespace CGLA
5
{
5
{
6
	/** Use the power method to obtain an eigensolution.
6
	/** Use the power method to obtain an eigensolution.
7
			Given a matrix A, the function returns the number
7
			Given a matrix A, the function returns the number
8
			of eigensolutions found, and the eigenvectors are
8
			of eigensolutions found, and the eigenvectors are
9
			stored in Q as the rows, and the corresponding 
9
			stored in Q as the rows, and the corresponding 
10
			values are stored in the diagonal of L upon return of 
10
			values are stored in the diagonal of L upon return of 
11
			the function.
11
			the function.
12
 
12
 
13
			The so called power method is used to find the dominant 
13
			The so called power method is used to find the dominant 
14
			eigenvalue, and the method of deflation is used to find
14
			eigenvalue, and the method of deflation is used to find
15
			the following values. This restricts this function to
15
			the following values. This restricts this function to
16
			work only on symmetric matrices. 
16
			work only on symmetric matrices. 
17
 
17
 
18
			DO NOT CALL THIS FUNCTION WITH AN UNSYMMETRIC MATRIX.
18
			DO NOT CALL THIS FUNCTION WITH AN UNSYMMETRIC MATRIX.
19
 
19
 
20
			The final argument is the number of solutions to find. If only
20
			The final argument is the number of solutions to find. If only
21
			a number of solutions are interesting, use this argument to save
21
			a number of solutions are interesting, use this argument to save
22
			cycles.
22
			cycles.
23
	*/
23
	*/
24
	template <class MT>
24
	template <class MT>
25
	int power_eigensolution(const MT& A, MT& Q, MT& L, int max_sol=1000);
25
	int power_eigensolution(const MT& A, MT& Q, MT& L, unsigned int max_sol=1000);
26
}
26
}
27
#endif
27
#endif
28
 
28