CppNoddy  0.92
Loading...
Searching...
No Matches
LinearEigenSystem_base.h
Go to the documentation of this file.
1/// \file LinearEigenSystem_base.h
2/// Specification of the linear eigensystem base class.
3
4#ifndef LINEAREIGENSYSTEM_BASE_H
5#define LINEAREIGENSYSTEM_BASE_H
6
7#include <set>
8
9#include <Types.h>
10
11namespace CppNoddy {
12
13 /// A linear Nth-order generalised eigensystem base class.
14 /// Here we can construct a linear eigenproblem in the form
15 /// \f[ A_{NxN} \,{\underline x}_i = \lambda_i\, B_{NxN}\, {\underline x}_i \f]
16 /// for matrices \f$ A \f$ and \f$ B \f$. The eigenvalues
17 /// and eigenvectors can be tagged and retrieved as required.
19
20 protected:
21
22 typedef std::set
23 < unsigned, std::less<unsigned> >::iterator iter;
24 typedef std::set
25 < unsigned, std::less<unsigned> >::const_iterator citer;
26
27 public:
28
29 /// Constructor for a linear system object.
31
32 /// Destructor for a linear system object.
34
35 /// Solve the matrix linear eigensystem
36 virtual void eigensolve();
37
38 /// Compute the eigenvectors in any eigenvalue computation
39 /// \param flag The boolean value to set.
40 void set_calc_eigenvectors(bool flag);
41
42 /// Set the shift value to be used in tagging
43 /// \param z The shift value to be used
44 void set_shift(const D_complex& z);
45
46 /// Get the shift value associated with this class (used for tagging)
47 /// and eigenvalue tagging
48 D_complex get_shift() const;
49
50 /// Tag those eigenvalues that are to the right of a specified
51 /// shft point.
52 /// \param val Tags are added or removed for val +ve or -ve
53 virtual void tag_eigenvalues_right(const int &val);
54
55 /// Tag those eigenvalues that are to the left of a specified
56 /// point.
57 /// \param val Tags are added or removed for val +ve or -ve
58 virtual void tag_eigenvalues_left(const int &val);
59
60 /// Tag those eigenvalues that are in the upper half-plane above a
61 /// specified point.
62 /// \param val Tags are added or removed for val +ve or -ve
63 virtual void tag_eigenvalues_upper(const int &val);
64
65 /// Tag those eigenvalues that are in the lower half-plane below a specified
66 /// point.
67 /// \param val Tags are added or removed for val +ve or -ve
68 virtual void tag_eigenvalues_lower(const int &val);
69
70 /// Tag those eigenvalues that are within a disc centred
71 /// at a point in the complex plane.
72 /// \param val Tags are added or removed for val +ve or -ve
73 /// \param radius The radius of the disc to be considered
74 virtual void tag_eigenvalues_disc(const int &val, const double &radius);
75
76 /// Tag all the eigenvalues returned from the ARPACK routine.
77 virtual void tag_eigenvalues_all();
78
79 virtual void clear_all_tags() {
80 m_tagged_indices.clear();
81 }
82
83 /// Get the the tagged eigenvalues. All of the tagged eigenvalues
84 /// are returned in a complex vector, with no ordering guaranteed.
85 /// \return The tagged eigenvalues as a complex vector
87
88 /// Get the the tagged eigenvectors. All of the eigenvectors associated
89 /// with the tagged eigenvalues are returned, with the i-th eigenvector corresponding
90 /// to the i-th eigenvalue as returned by the get_tagged_eigenvalues method.
91 /// The i-th eigenvector is returned in row i of the complex dense matrix.
92 /// \return The tagged eigenvectors as a complex matrix
94
95 protected:
96
97 /// storage for eigenvectors and eigenvalues
100
101 /// a set of tagged eigenvalue indices
102 std::set
103 < unsigned, std::less<unsigned> > m_tagged_indices;
104
105 /// The complex shift value
107
108 /// calculate the eigenvectors in any eigenvalue computation
110
111 };
112
113} //end namepsace
114#endif
Some standard typedefs.
A matrix class that constructs a DENSE matrix as a row major std::vector of DenseVectors.
Definition: DenseMatrix.h:25
An DenseVector class – a dense vector object.
Definition: DenseVector.h:34
A linear Nth-order generalised eigensystem base class.
virtual DenseMatrix< D_complex > get_tagged_eigenvectors() const
Get the the tagged eigenvectors.
std::set< unsigned, std::less< unsigned > >::const_iterator citer
virtual void tag_eigenvalues_right(const int &val)
Tag those eigenvalues that are to the right of a specified shft point.
virtual void tag_eigenvalues_all()
Tag all the eigenvalues returned from the ARPACK routine.
virtual void tag_eigenvalues_lower(const int &val)
Tag those eigenvalues that are in the lower half-plane below a specified point.
D_complex m_shift
The complex shift value.
virtual void tag_eigenvalues_disc(const int &val, const double &radius)
Tag those eigenvalues that are within a disc centred at a point in the complex plane.
std::set< unsigned, std::less< unsigned > >::iterator iter
DenseVector< D_complex > m_all_eigenvalues
storage for eigenvectors and eigenvalues
virtual void tag_eigenvalues_left(const int &val)
Tag those eigenvalues that are to the left of a specified point.
std::set< unsigned, std::less< unsigned > > m_tagged_indices
a set of tagged eigenvalue indices
virtual void eigensolve()
Solve the matrix linear eigensystem.
D_complex get_shift() const
Get the shift value associated with this class (used for tagging) and eigenvalue tagging.
bool m_calc_eigenvectors
calculate the eigenvectors in any eigenvalue computation
virtual ~LinearEigenSystem_base()
Destructor for a linear system object.
LinearEigenSystem_base()
Constructor for a linear system object.
void set_shift(const D_complex &z)
Set the shift value to be used in tagging.
void set_calc_eigenvectors(bool flag)
Compute the eigenvectors in any eigenvalue computation.
DenseMatrix< D_complex > m_all_eigenvectors
virtual DenseVector< D_complex > get_tagged_eigenvalues() const
Get the the tagged eigenvalues.
virtual void tag_eigenvalues_upper(const int &val)
Tag those eigenvalues that are in the upper half-plane above a specified point.
A collection of OO numerical routines aimed at simple (typical) applied problems in continuum mechani...
std::complex< double > D_complex
A complex double precision number using std::complex.
Definition: Types.h:98

© 2012

R.E. Hewitt