FILTLAN 1.0a
Loading...
Searching...
No Matches
filtlan.h
Go to the documentation of this file.
1
34#ifndef FILTLAN_H
35#define FILTLAN_H
41#include "laneig.h"
42#include "polyfilt.h"
43
44#ifdef USE_NAMESPACE
45using namespace MATKIT;
46namespace MATKIT {
47#endif
48
49class Vector;
50class Matrix;
51class SparseMatrix;
52
53#ifdef USE_NAMESPACE
54} // end of namespace MATKIT
55#endif
56
57
64// an instance of this class, taken by FilteredLanczosEigenSolver(), is a collection of options for the filtered Lanczos procedure to solve symmetric eigenvalue problems
67
71 // this parameter tells whether eigenvalues are wanted or not (default true)
72 // note that the filtered Lanczos procedure computes the eigenvectors first
73 // the computation of eigenvalues is unnecessary if only the invariant subspace is required
74 // note that the option wantEigVec inherited from LanczosOptions is no longer effective in the filtered Lanczos procedure
77
84 // neigWanted is the number of eigenvalues/eigenvectors desired
85 // if nev == 0 is given (the default), then it means that all eigenvalues/eigenvectors in the requested interval are to be sought
86 // otherwise, let nev be the number of eigenvalues in the requested interval
87 // if nev <= neigWanted, then the iteration continues until all nev eigenvalues/eigenvectors in the requested interval converge
88 // if nev > neigWanted, then the iteration stops when neigWanted eigenvalues in the requested interval converge
89 mkIndex neigWanted;
91
95 // number of Lanczos iterations to determine an interval which (tightly) contains all eigenvalues (default 30)
96 // the filtered Lanczos procedure requires an interval which (tightly) contains all eigenvalues
97 // if it is not provided, then we use a standard Lanczos procedure with numIterForEigenRange iterations to compute one
98 // the higher the numIterForEigenRange, the tighter the interval
100
102 // a collection of options to determine the intervals
104
106 // a constructor to set default options
108 wantEigVal = true; // filtered Lanczos computes eigenvectors first;
109 // if only the invariant subspace is wanted, then the computation of eigenvalues is not required,
110 // in which case wantEigVal can be set false
111 neigWanted = 0; // means to compute all eigenvalues in the given range
112 // if neigWanted > 0, then quit the Lanczos loop when neigWanted eigenvalues are found in the specified range,
113 // or when all ( < neigWanted ) eigenvalues are found in the specified range
114 numIterForEigenRange = 30; // number of Lanczos iterations to determine the eigen-range
115 extraIter = 20; // laneig has the default extraIter==60
116 // filtlan requires less extraIter for comparable accuracy of eigenvalues
117 defaultMinIterFactor = 2; // likewise, filtlan can have less defaultMinIterFactor,
118 defaultMaxIterFactor = 30; // and also defaultMaxIterFactor than laneig
119 }
120};
121
123// FilteredLanczosEigenSolver() returns an instance of this class which gives the information of the filtered Lanczos procedure
126 // information about the Lanczos procedure to determine the range of eigenvalues by approximating the largest eigenvalue and the smallest eigenvalue, if this range is not provided
129 // CPU time (in seconds) to determine the range of eigenvalues, if this range is not provided
132
134 // the range of eigenvalues is partitioned into intervals which determine the base filter approximated by a polynomial filter
135 // the j-th interval is [intervals(j),intervals(j+1))
136 Vector intervals;
137};
138
139
141
164// this routine computes the eigenvalues in the requested window and the corresponding eigenvectors
165// the window can contain the largest or smallest eigenvalues, in which case the requested are the extreme eigenvalues
166// the window can also be well inside the range of the spectrum, in which case it is often referred to as an interior eigenvalue problem
167// eigVal is a vector which contains the computed eigenvalues (if opts.wantEigVal==true)
168// eigVec is a matrix whose columns are computed eigenvectors
169// more precisely, eigVec(:,j) is the eigenvector corresponding to the eigenvalue eigVal(j)
170// S is the sparse matrix whose eigenvalues / eigenvectors are to be sought
171// frame is a vector of 2 or 4 elements
172// if frame consists of 2 elements, then [frame(1),frame(2)] is the interval in which the eigenvalues are sought
173// if frame consists of 4 elements, then [frame(2),frame(3)] is the interval in which the eigenvalues are sought, and
174// [frame(1),frame(4)] is the interval which (tightly) contains all eigenvalues
175// in the former case, an interval which contains (tightly) all eigenvalues is not given, and will be determined by a standard Lanczos procedure
176// polyDegree is the degree of s(z), with z*s(z) the polynomial filter
177// baseDegree is the left-and-right degree of the base filter for each interval
178// opts is a collection of options for the filtered Lanczos procedure
179// the return FilteredLanczosInfo gives the information of the filtered Lanczos procedure
180FilteredLanczosInfo FilteredLanczosEigenSolver(Vector &eigVal, Matrix &eigVec,
181 const SparseMatrix &S, Vector &frame,
182 mkIndex polyDegree, mkIndex baseDegree, FilteredLanczosOptions &opts);
183
184 // end of group_filtlan
185
186
187#endif
FilteredLanczosInfo FilteredLanczosEigenSolver(Vector &eigVal, Matrix &eigVec, const SparseMatrix &S, Vector &frame, mkIndex polyDegree, mkIndex baseDegree, FilteredLanczosOptions &opts)
This routine computes the eigenvalues in the requested window and the corresponding eigenvectors.
FilteredLanczosEigenSolver() returns an instance of this class which gives the information of the fil...
Definition filtlan.h:124
Vector intervals
The range of eigenvalues is partitioned into intervals which determine the base filter approximated b...
Definition filtlan.h:136
LanczosInfo forEigenRangeInfo
Information about the Lanczos procedure to determine the range of eigenvalues by approximating the la...
Definition filtlan.h:127
Real forEigenRangeCpuTime
CPU time (in seconds) to determine the range of eigenvalues, if this range is not provided.
Definition filtlan.h:130
An instance of this class, taken by FilteredLanczosEigenSolver(), is a collection of options for the ...
Definition filtlan.h:65
bool wantEigVal
This parameter tells whether eigenvalues are wanted or not (default true).
Definition filtlan.h:75
mkIndex numIterForEigenRange
Number of Lanczos iterations to determine an interval which (tightly) contains all eigenvalues (defau...
Definition filtlan.h:99
IntervalOptions intervalOpts
A collection of options to determine the intervals.
Definition filtlan.h:103
mkIndex neigWanted
Number of eigenvalues/eigenvectors desired.
Definition filtlan.h:89
FilteredLanczosOptions()
A constructor to set default options.
Definition filtlan.h:107
An instance of this class, taken by GetIntervals() and PolynomialFilterInterface::setFilter(),...
Definition polyfilt.h:155
LanczosEigenSolver() returns an instance of this class which gives the information of the Lanczos pro...
Definition laneig.h:320
An instance of this class, taken by LanczosEigenSolver(), is a collection of options for the Lanczos ...
Definition laneig.h:33
mkIndex extraIter
Extra number of Lanczos iterations (default 100).
Definition laneig.h:87
mkIndex defaultMaxIterFactor
The default LanczosOptions::maxIter, if not set, is 500 plus LanczosOptions::defaultMaxIterFactor tim...
Definition laneig.h:102
mkIndex defaultMinIterFactor
The default LanczosOptions::minIter, if not set, is LanczosOptions::defaultMinIterFactor times the nu...
Definition laneig.h:96