SCALAPACK 2.2.2
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ pdlaiectb_()

void pdlaiectb_ ( double *  sigma,
Int n,
double *  d,
Int count 
)

Definition at line 85 of file pdlaiect.c.

86{
87/*
88*
89* Purpose
90* =======
91*
92* pdlaiectb computes the number of negative eigenvalues of (A- SIGMA I).
93* This implementation of the Sturm Sequence loop exploits IEEE Arithmetic
94* and has no conditionals in the innermost loop. To extract the signbit,
95* this routine assumes that the double precision word is stored in
96* "Big Endian" word order, i.e, the signbit is assumed to be bit 32.
97*
98* Note that all arguments are call-by-reference so that this routine
99* can be directly called from Fortran code.
100*
101* This is a ScaLAPACK internal subroutine and arguments are not
102* checked for unreasonable values.
103*
104* Arguments
105* =========
106*
107* SIGMA (input) DOUBLE PRECISION
108* The shift. pdlaiectb finds the number of eigenvalues
109* less than equal to SIGMA.
110*
111* N (input) INTEGER
112* The order of the tridiagonal matrix T. N >= 1.
113*
114* D (input) DOUBLE PRECISION array, dimension (2*N - 1)
115* Contains the diagonals and the squares of the off-diagonal
116* elements of the tridiagonal matrix T. These elements are
117* assumed to be interleaved in memory for better cache
118* performance. The diagonal entries of T are in the entries
119* D(1),D(3),...,D(2*N-1), while the squares of the off-diagonal
120* entries are D(2),D(4),...,D(2*N-2). To avoid overflow, the
121* matrix must be scaled so that its largest entry is no greater
122* than overflow**(1/2) * underflow**(1/4) in absolute value,
123* and for greatest accuracy, it should not be much smaller
124* than that.
125*
126* COUNT (output) INTEGER
127* The count of the number of eigenvalues of T less than or
128* equal to SIGMA.
129*
130* =====================================================================
131*
132* .. Local Scalars ..
133*/
134 double lsigma, tmp, *pd, *pe2;
135 Int i;
136/* ..
137* .. Executable Statements ..
138*/
139
140 lsigma = *sigma;
141 pd = d; pe2 = d+1;
142 tmp = *pd - lsigma; pd += 2;
143 *count = (*((Int *)&tmp) >> 31) & 1;
144 for(i = 1;i < *n;i++){
145 tmp = *pd - *pe2/tmp - lsigma;
146 pd += 2; pe2 += 2;
147 *count += ((*((Int *)&tmp)) >> 31) & 1;
148 }
149}
#define Int
Definition Bconfig.h:22