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

◆ pslaiect_()

void pslaiect_ ( float *  sigma,
Int n,
float *  d,
Int count 
)

Definition at line 80 of file pslaiect.c.

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