10using namespace MATKIT;
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;
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
static const SparseMatrix * Sptr
A pointer to the input sparse symmetric matrix via setFilter().
Definition polyfilt.h:763
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 setFilter(const SparseMatrix &S0, const Vector &frame, mkIndex polyDeg, mkIndex baseDeg, IntervalOptions &opts)
This member function sets the sparse matrix S translated from S0, and also the base filter P(z).
static Vector intervalWeights
intervalWeights(j) is the weight of jth interval [intervals(j),intervals(j+1)).
Definition polyfilt.h:789
static Vector intervals
The jth interval is [intervals(j),intervals(j+1)).
Definition polyfilt.h:786
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
static Matrix baseFilter
A base filter, which is a piecewise polynomial typically from Hermite interpolation.
Definition polyfilt.h:803
static mkIndex baseDegree
Left-and-right degree of the base filter in each interval.
Definition polyfilt.h:795
static PolynomialFilterInfo filterInfo
The information of computing the polynomial filter. See class PolynomialFilterInfo in polyfilt....
Definition polyfilt.h:811
static Vector zn
A zero vector of length the number of rows/columns of S.
Definition polyfilt.h:806
static mkIndex polyDegree
Maximum possible degree of s(z), with z*s(z) the polynomial filter.
Definition polyfilt.h:792
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 ‘t...
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’ ...
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 ‘translat...
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 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 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....
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)|...
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 ...
Vector NewtonPolynomial(const Vector &x, const Vector &y)
Build a polynomial P(z) by Newton's divided differences and return the coefficient vector a.
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.
An instance of this class, taken by GetIntervals() and PolynomialFilterInterface::setFilter(),...
Definition polyfilt.h:155
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
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 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 shiftStepExpansionRate
The rate at which the shift step expands (default 1.5), effective only for mid-pass filters.
Definition polyfilt.h:185
IntervalOptions()
A default constructor to set default parameters.
Definition polyfilt.h:213
Vector intervalWeights
Interval weights (default 100,1,1,1,100).
Definition polyfilt.h:163
bool reverseInterval
This parameter tells whether to reverse the interval or not. It is effective only for mid-pass filter...
Definition polyfilt.h:173
Real yRippleLimit
The limit of height of ripples (not in the interval of desired eigenvalues) relative to the bottom of...
Definition polyfilt.h:209
Real initialPlateau
Initial length of ‘plateau’, relative to the length of the interval of desired eigenvalues (default 0...
Definition polyfilt.h:176
mkIndex maxInnerIter
Maximum number of inner iterations (default 30), effective only for mid-pass filters.
Definition polyfilt.h:188
mkIndex maxOuterIter
Maximum number of outer iterations (default 50).
Definition polyfilt.h:197
Real transitionIntervalRatio
The (relative) length of transition interval (default 0.6), effective only for high-pass filters,...
Definition polyfilt.h:168
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
Real initialShiftStep
Initial shift step, relative to the length of the interval of desired eigenvalues (default 0....
Definition polyfilt.h:182
The routine GetIntervals() returns an instance of this class, which gives the information of a polyno...
Definition polyfilt.h:244
Real yLimit
The lowest polynomial value P(z) for z in the interval [a1,b1] of desired eigenvalues.
Definition polyfilt.h:268
mkIndex totalNumIter
Total number of iterations performed.
Definition polyfilt.h:265
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 numRightSteps
Number of steps moving rightward.
Definition polyfilt.h:288
mkIndex numIter
Number of iterations to get the (transition) intervals.
Definition polyfilt.h:260
Vector intervals
The partition of the range of spectrum which decides the base filter and the polynomial filter.
Definition polyfilt.h:248
Real ySummit
The height of (highest, if more than one) summit in the interval [a1,b1] of desired eigenvalues.
Definition polyfilt.h:271
mkIndex numLeftSteps
Number of steps moving leftward.
Definition polyfilt.h:274
Real yLeftSummit
The height of highest summit in the left-hand side of the interval of desired eigenvalues.
Definition polyfilt.h:277
PolynomialFilterInfo()
A default constructor to initialze all zero.
Definition polyfilt.h:298
Real filterQualityIndex
Between 0.0 and 1.0; the higher the better quality of the filter.
Definition polyfilt.h:257
Real yLeftBottom
The height of lowest bottom in the left-hand side of the interval of desired eigenvalues.
Definition polyfilt.h:280
Real yRightBottom
The height of lowest bottom in the right-hand side of the interval of desired eigenvalues.
Definition polyfilt.h:294
Real yLimitGap
In general, it is |p(a1)-p(b1)|, where [a1,b1] is the interval of desired eigenvalues.
Definition polyfilt.h:285
Real yRightSummit
The height of highest summit in the right-hand side of the interval of desired eigenvalues.
Definition polyfilt.h:291
int filterType
1 means a high-pass filter (or low-pass filter with conversion); 2 means a mid-pass filter.
Definition polyfilt.h:251