 EVSL  1.1.0 EigenValues Slicing Library
ratfilter.c File Reference

Computing and applying rational filters. More...

`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include <complex.h>`
`#include <math.h>`
`#include "def.h"`
`#include "blaslapack.h"`
`#include "struct.h"`
`#include "internal_proto.h"`

Go to the source code of this file.

## Functions

void contQuad (int method, int n, complex double *zk)
Compute the locations of the poles. More...

void ratf2p2 (int n, int *mulp, complex double *zk, complex double *alp, int m, double *z, double *xx)
Compute the function value of the multiple pole rational filter at real locations. More...

void pfe2 (complex double s1, complex double s2, int k1, int k2, complex double *alp, complex double *bet)
Get the fraction expansion of 1/[(z-s1)^k1 (z-s2)^k2]. More...

complex double integg2 (complex double s1, complex double s2, complex double *alp, int k1, complex double *bet, int k2, double a, double b)
Integration of 1/[(z-s1)^k1 (z-s2)^k2] from a to b. More...

void weights (int n, complex double *zk, int *mulp, double lambda, complex double *omega)
Compute the LS weight for each multiple pole. More...

int scaleweigthts (int n, double a, double b, complex double *zk, int *mulp, complex double *omegaM)
Compute the weights and pole locations on [a, b]. More...

void set_ratf_def (ratparams *rat)
Sets default values for ratparams struct. More...

int find_ratf (double *intv, ratparams *rat)

void free_rat (ratparams *rat)

void RatFiltApply (int n, ratparams *rat, double *b, double *x, double *w6)
Apply rational filter R to a vetor b. More...

## Detailed Description

Computing and applying rational filters.

Definition in file ratfilter.c.

## Function Documentation

 void contQuad ( int method, int n, complex double * zk )

Compute the locations of the poles.

----------------------— Cauchy integration-based filter -----------—

Parameters
 method 0 for Guass Legendre; 1 for midpoint n Number of poles in the upper half plane [out] zk Vector of pole locations

Definition at line 23 of file ratfilter.c.

References DSTEV(), M_PI, and Malloc.

Referenced by find_ratf().

Here is the call graph for this function: Here is the caller graph for this function: int find_ratf ( double * intv, ratparams * rat )

Parameters
 intv = an array of length 4 [intv, intv] is the interval of desired eigenvalues [intv, intv] is the global interval of all eigenvalues it must contain all eigenvalues of A

OUT:

Parameters
 [out] rat these are set in rat struct: omega : expansion coefficients of rational filter zk : location of the poles used aa : adjusted left endpoint bb : adjusted right endpoint dd : half-width and.. cc : ..center of interval

Definition at line 375 of file ratfilter.c.

Referenced by evsl_find_rat(), and main().

Here is the call graph for this function: Here is the caller graph for this function: void free_rat ( ratparams * rat )

Definition at line 424 of file ratfilter.c.

References _ratparams::ASIGBsol, _ratparams::mulp, _ratparams::omega, and _ratparams::zk.

Referenced by evsl_free_rat(), and main().

Here is the caller graph for this function: complex double integg2 ( complex double s1, complex double s2, complex double * alp, int k1, complex double * bet, int k2, double a, double b )

Integration of 1/[(z-s1)^k1 (z-s2)^k2] from a to b.

Definition at line 129 of file ratfilter.c.

Referenced by weights().

Here is the caller graph for this function: void pfe2 ( complex double s1, complex double s2, int k1, int k2, complex double * alp, complex double * bet )

Get the fraction expansion of 1/[(z-s1)^k1 (z-s2)^k2].

Definition at line 95 of file ratfilter.c.

Referenced by weights().

Here is the caller graph for this function: void ratf2p2 ( int n, int * mulp, complex double * zk, complex double * alp, int m, double * z, double * xx )

Compute the function value of the multiple pole rational filter at real locations.

---------------—Multiple pole rational filter evaluation -----------—

Parameters
 n number of the pole mulp multiplicity of the pole zk array containing the poles. alp fractional expansion coefficients m number of locations to be evaluated z real locations to be evaluated [out] xx : function values at real locations z

Definition at line 69 of file ratfilter.c.

Referenced by scaleweigthts(), and weights().

Here is the caller graph for this function: void RatFiltApply ( int n, ratparams * rat, double * b, double * x, double * w6 )

Apply rational filter R to a vetor b.

For generalized e.v problem x = L' * (A-SB) \ L*b [w:=work] x = L * b w = (A-sB) \ x x = L' * w

Parameters
 [in] rat ratparams struct [in] n Length of array [in] b x = L * b w6 Work array of size 4*n for standard ev problem, size 6*n for generalized ev problem [out] x Becomes R(A)b

Definition at line 448 of file ratfilter.c.

Referenced by RatLanNr(), and RatLanTr().

Here is the call graph for this function: Here is the caller graph for this function: int scaleweigthts ( int n, double a, double b, complex double * zk, int * mulp, complex double * omegaM )

Compute the weights and pole locations on [a, b].

---------------—Transform poles and weights computed on [-1, 1] to [a, b] -------—

Parameters
 n number of poles used in the upper half plane a,b [a, b] is the interval of desired eigenvalues zk location of the poles mulp multiplicity of the poles [out] omegaM multiple LS weights

Definition at line 313 of file ratfilter.c.

References ratf2p2().

Referenced by find_ratf().

Here is the call graph for this function: Here is the caller graph for this function: void set_ratf_def ( ratparams * rat )

Sets default values for ratparams struct.

Definition at line 345 of file ratfilter.c.

Referenced by evsl_find_rat(), and main().

Here is the caller graph for this function: void weights ( int n, complex double * zk, int * mulp, double lambda, complex double * omega )

Compute the LS weight for each multiple pole.

---------------—multiple pole LS rational filter weights-----------—

Parameters
 n number of poles in the upper half plane zk pole locations mulp multiplicity of each pole lambda LS integration weight for [-1, 1] [out] omega LS weight for each pole

Definition at line 169 of file ratfilter.c.

References integg2(), Malloc, pfe2(), ratf2p2(), and ZGESV().

Referenced by find_ratf().

Here is the call graph for this function: Here is the caller graph for this function: 