Subversion Repositories gelsvn

Rev

Rev 595 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 595 Rev 630
1
/* ----------------------------------------------------------------------- *
1
/* ----------------------------------------------------------------------- *
2
 * This file is part of GEL, http://www.imm.dtu.dk/GEL
2
 * This file is part of GEL, http://www.imm.dtu.dk/GEL
3
 * Copyright (C) the authors and DTU Informatics
3
 * Copyright (C) the authors and DTU Informatics
4
 * For license and list of authors, see ../../doc/intro.pdf
4
 * For license and list of authors, see ../../doc/intro.pdf
5
 * ----------------------------------------------------------------------- */
5
 * ----------------------------------------------------------------------- */
6
 
6
 
7
/** @file eigensolution.h
7
/** @file eigensolution.h
8
 * @brief Compute eigensolutions for symmetric CGLA matrices.
8
 * @brief Compute eigensolutions for symmetric CGLA matrices.
9
 */
9
 */
10
 
10
 
11
#ifndef __CGLA_EIGENSOLUTION_H__
11
#ifndef __CGLA_EIGENSOLUTION_H__
12
#define __CGLA_EIGENSOLUTION_H__
12
#define __CGLA_EIGENSOLUTION_H__
13
 
13
 
14
namespace CGLA
14
namespace CGLA
15
{
15
{
16
	/** Use the power method to obtain an eigensolution.
16
	/** Use the power method to obtain an eigensolution.
17
			Given a matrix A, the function returns the number
17
			Given a matrix A, the function returns the number
18
			of eigensolutions found, and the eigenvectors are
18
			of eigensolutions found, and the eigenvectors are
19
			stored in Q as the rows, and the corresponding 
19
			stored in Q as the rows, and the corresponding 
20
			values are stored in the diagonal of L upon return of 
20
			values are stored in the diagonal of L upon return of 
21
			the function.
21
			the function.
22
 
22
 
23
			The so called power method is used to find the dominant 
23
			The so called power method is used to find the dominant 
24
			eigenvalue, and the method of deflation is used to find
24
			eigenvalue, and the method of deflation is used to find
25
			the following values. This restricts this function to
25
			the following values. This restricts this function to
26
			work only on symmetric matrices. 
26
			work only on symmetric matrices. 
27
 
27
 
28
			DO NOT CALL THIS FUNCTION WITH AN UNSYMMETRIC MATRIX.
28
			DO NOT CALL THIS FUNCTION WITH AN UNSYMMETRIC MATRIX.
29
 
29
 
30
			The final argument is the number of solutions to find. If only
30
			The final argument is the number of solutions to find. If only
31
			a number of solutions are interesting, use this argument to save
31
			a number of solutions are interesting, use this argument to save
32
			cycles.
32
			cycles.
33
	*/
33
	*/
34
	template <class MT>
34
	template <class MT>
35
	int power_eigensolution(const MT& A, MT& Q, MT& L, unsigned int max_sol=1000);
35
	int power_eigensolution(const MT& A, MT& Q, MT& L, unsigned int max_sol=1000);
36
}
36
}
37
#endif
37
#endif
38
 
38