10 using namespace MATKIT;
16 class SymmetricMatrix;
215 intervalWeights.resize(5);
216 intervalWeights(1) = 100.0;
217 intervalWeights(2) = 1.0;
218 intervalWeights(3) = 1.0;
219 intervalWeights(4) = 1.0;
220 intervalWeights(5) = 100.0;
223 transitionIntervalRatio = 0.6;
226 reverseInterval =
false;
227 initialPlateau = 0.1;
228 plateauShrinkRate = 1.5;
229 initialShiftStep = 0.01;
230 shiftStepExpansionRate = 1.5;
301 filterQualityIndex = 0.0;
647 const Vector &w, mkIndex niter);
738 const Matrix &pp,
const Vector &intv,
const Vector &w,
739 mkIndex niter, Real tol=0.0);
763 static const SparseMatrix *
Sptr;
766 static SparseMatrix
S;
833 static Vector setFilter(
const SparseMatrix &S0,
const Vector &frame, mkIndex polyDeg, mkIndex baseDeg,
IntervalOptions &opts);
Real filterQualityIndex
Between 0.0 and 1.0; the higher the better quality of the filter.
Definition: polyfilt.h:257
mkIndex numIter
Number of iterations to get the (transition) intervals.
Definition: polyfilt.h:260
Vector NewtonPolynomial(const Vector &x, const Vector &y)
Build a polynomial P(z) by Newton's divided differences and return the coefficient vector a...
static Vector intervals
The jth interval is [intervals(j),intervals(j+1)).
Definition: polyfilt.h:786
int filterOK
0 means no acceptable is found; 1 means an OK filter is found; 2 means an optimal filter is found...
Definition: polyfilt.h:254
mkIndex numGridPoints
Number of grid points, used to measure the maximum function value of the polynomial P(z) for z not in...
Definition: polyfilt.h:203
Real yLimit
The lowest polynomial value P(z) for z in the interval [a1,b1] of desired eigenvalues.
Definition: polyfilt.h:268
Matrix FilteredConjugateResidualPolynomial(const Matrix &pp, const Vector &intv, const Vector &w, mkIndex niter)
This routine employs a conjugate-residual-type algorithm in polynomial space to minimize ||P(z)-Q(z)|...
PolynomialFilterInfo()
A default constructor to initialze all zero.
Definition: polyfilt.h:298
static SparseMatrix S
The sparse symmetric matrix S in computing R(S)*v; S is translated from the input sparse symmetric ma...
Definition: polyfilt.h:766
mkIndex maxInnerIter
Maximum number of inner iterations (default 30), effective only for mid-pass filters.
Definition: polyfilt.h:188
Real PolynomialEvaluationInChebyshevBasis(const Vector &c, Real z0, Real aa=-1.0, Real bb=1.0)
Evaluate P(z) at z=z0, where P(z) is a polynomial expanded in a basis of the ‘translated’ (i...
Real yLeftSummit
The height of highest summit in the left-hand side of the interval of desired eigenvalues.
Definition: polyfilt.h:277
Real yRightBottom
The height of lowest bottom in the right-hand side of the interval of desired eigenvalues.
Definition: polyfilt.h:294
Real yBottomLine
This is the bottom line (default 0.001) which the function value of the polynomial must be greater th...
Definition: polyfilt.h:206
Real ySummit
The height of (highest, if more than one) summit in the interval [a1,b1] of desired eigenvalues...
Definition: polyfilt.h:271
Real yRightSummit
The height of highest summit in the right-hand side of the interval of desired eigenvalues.
Definition: polyfilt.h:291
mkIndex maxOuterIter
Maximum number of outer iterations (default 50).
Definition: polyfilt.h:197
int filterType
1 means a high-pass filter (or low-pass filter with conversion); 2 means a mid-pass filter...
Definition: polyfilt.h:251
static Vector filteredSparseMatrixPolynomialVectorProduct(const Vector &v)
This routine computes R(S)*v, where it is assumed that S and R(S) have been defined by setFilter()...
Definition: polyfilt.h:853
static Vector zn
A zero vector of length the number of rows/columns of S.
Definition: polyfilt.h:806
Real yLimitTol
A mid-pass filter P(x) should have P(a1)=P(b1), where [a1,b1] is the interval of desired eigenvalues;...
Definition: polyfilt.h:192
static PolynomialFilterInfo filterInfo
The information of computing the polynomial filter. See class PolynomialFilterInfo in polyfilt...
Definition: polyfilt.h:811
Vector intervals
The partition of the range of spectrum which decides the base filter and the polynomial filter...
Definition: polyfilt.h:248
Matrix PiecewisePolynomialInChebyshevBasisMultiplyX(const Matrix &pp, const Vector &intv)
compute Q(z) = z*P(z), where P(z) and Q(z) are piecewise polynomials expanded in a basis of ‘transla...
IntervalOptions()
A default constructor to set default parameters.
Definition: polyfilt.h:213
Real yRippleLimit
The limit of height of ripples (not in the interval of desired eigenvalues) relative to the bottom of...
Definition: polyfilt.h:209
PolynomialFilterInfo GetIntervals(Vector &intv, const Vector &frame, mkIndex polyDeg, mkIndex baseDeg, IntervalOptions &opts)
This routine determines the intervals (including the transition one(s)) by an interative process...
Vector ExpandNewtonPolynomialInChebyshevBasis(Real aa, Real bb, const Vector &a, const Vector &x)
Translate the coefficients of a Newton polynomial to the coefficients in a basis of the ‘translatedâ€...
Real initialShiftStep
Initial shift step, relative to the length of the interval of desired eigenvalues (default 0...
Definition: polyfilt.h:182
static Vector intervalWeights
intervalWeights(j) is the weight of jth interval [intervals(j),intervals(j+1)).
Definition: polyfilt.h:789
Real yLimitGap
In general, it is |p(a1)-p(b1)|, where [a1,b1] is the interval of desired eigenvalues.
Definition: polyfilt.h:285
Real yLeftBottom
The height of lowest bottom in the left-hand side of the interval of desired eigenvalues.
Definition: polyfilt.h:280
mkIndex numLeftSteps
Number of steps moving leftward.
Definition: polyfilt.h:274
Real plateauShrinkRate
The rate at which the plateau shrinks at each iteration (default 1.5), effective only for mid-pass fi...
Definition: polyfilt.h:179
static mkIndex polyDegree
Maximum possible degree of s(z), with z*s(z) the polynomial filter.
Definition: polyfilt.h:792
static Matrix baseFilter
A base filter, which is a piecewise polynomial typically from Hermite interpolation.
Definition: polyfilt.h:803
An interface to define R(S), i.e. set R and S, and compute R(S)*v, where R is the residual polynomial...
Definition: polyfilt.h:758
bool reverseInterval
This parameter tells whether to reverse the interval or not. It is effective only for mid-pass filter...
Definition: polyfilt.h:173
The routine GetIntervals() returns an instance of this class, which gives the information of a polyno...
Definition: polyfilt.h:244
Real PiecewisePolynomialInnerProductInChebyshevBasis(const Matrix &pp, const Matrix &qq, const Vector &intervalWeights)
Compute the weighted inner product of two piecewise polynomials expanded in a basis of ‘translated’...
Real initialPlateau
Initial length of ‘plateau’, relative to the length of the interval of desired eigenvalues (default...
Definition: polyfilt.h:176
Real transitionIntervalRatio
The (relative) length of transition interval (default 0.6), effective only for high-pass filters...
Definition: polyfilt.h:168
mkIndex totalNumIter
Total number of iterations performed.
Definition: polyfilt.h:265
Vector intervalWeights
Interval weights (default 100,1,1,1,100).
Definition: polyfilt.h:163
static const SparseMatrix * Sptr
A pointer to the input sparse symmetric matrix via setFilter().
Definition: polyfilt.h:763
An instance of this class, taken by GetIntervals() and PolynomialFilterInterface::setFilter(), is a collection of options to determine the intervals which decides the base filter.
Definition: polyfilt.h:155
Real PiecewisePolynomialEvaluationInChebyshevBasis(const Matrix &pp, const Vector &intv, Real z0, bool basisTranslated=true)
Evaluate P(z) at z=z0, where P(z) is a piecewise polynomial expanded in a basis of the (optionally tr...
Real NewtonPolynomialEvaluation(const Vector &a, const Vector &x, const Real z0)
Evaluate P(z0), i.e. the value of P(z) at z=z0, where P(z) is a Newton polynomial defined by a and x...
static mkIndex baseDegree
Left-and-right degree of the base filter in each interval.
Definition: polyfilt.h:795
Real shiftStepExpansionRate
The rate at which the shift step expands (default 1.5), effective only for mid-pass filters...
Definition: polyfilt.h:185
Matrix HermiteBaseFilterInChebyshevBasis(const Vector &intv, const int *HiLowFlags, mkIndex baseDeg)
Compute a base filter P(z) which is a continuous, piecewise polynomial P(z) expanded in a basis of ‘...
Vector FilteredConjugateResidualMatrixPolynomialVectorProduct(const SparseMatrix &A, const Vector &x0, const Vector &b, const Matrix &pp, const Vector &intv, const Vector &w, mkIndex niter, Real tol=0.0)
This routine employs a conjugate-residual-type algorithm in polynomial space to compute x=x0+s(A)*r0 ...
mkIndex numRightSteps
Number of steps moving rightward.
Definition: polyfilt.h:288