35 #ifndef TEMPLATE_LAPACK_STEMR_HEADER 36 #define TEMPLATE_LAPACK_STEMR_HEADER 40 d__, Treal *e,
const Treal *vl,
const Treal *vu,
const integer *il,
46 integer z_dim1, z_offset, i__1, i__2;
79 integer inderr, iindwk, indgrs, offset;
81 integer iinspl, ifirst, indwrk, liwmin, nzcmin;
315 z_offset = 1 + z_dim1;
327 lquery = *lwork == -1 || *liwork == -1;
359 }
else if (! (alleig || valeig || indeig)) {
363 }
else if (valeig && *n > 0 && wu <= wl) {
365 }
else if (indeig && (iil < 1 || iil > *n)) {
367 }
else if (indeig && (iiu < iil || iiu > *n)) {
369 }
else if (*ldz < 1 || ( wantz && *ldz < *n ) ) {
371 }
else if (*lwork < lwmin && ! lquery) {
373 }
else if (*liwork < liwmin && ! lquery) {
381 smlnum = safmin / eps;
382 bignum = 1. / smlnum;
389 work[1] = (Treal) lwmin;
392 if (wantz && alleig) {
394 }
else if (wantz && valeig) {
397 }
else if (wantz && indeig) {
398 nzcmin = iiu - iil + 1;
403 if (zquery && *info == 0) {
404 z__[z_dim1 + 1] = (Treal) nzcmin;
405 }
else if (*nzc < nzcmin && ! zquery) {
415 }
else if (lquery || zquery) {
427 if (alleig || indeig) {
431 if (wl < d__[1] && wu >= d__[1]) {
436 if (wantz && ! zquery) {
437 z__[z_dim1 + 1] = 1.;
447 }
else if (wantz && ! zquery) {
450 if (alleig || ( valeig && r2 > wl && r2 <= wu ) || ( indeig && iil == 1 ) ) {
453 if (wantz && ! zquery) {
454 z__[*m * z_dim1 + 1] = -sn;
455 z__[*m * z_dim1 + 2] = cs;
459 isuppz[(*m << 1) - 1] = 1;
460 isuppz[(*m << 1) - 1] = 2;
462 isuppz[(*m << 1) - 1] = 1;
463 isuppz[(*m << 1) - 1] = 1;
466 isuppz[(*m << 1) - 1] = 2;
471 if (alleig || ( valeig && r1 > wl && r1 <= wu ) || ( indeig && iiu == 2 ) ) {
474 if (wantz && ! zquery) {
475 z__[*m * z_dim1 + 1] = cs;
476 z__[*m * z_dim1 + 2] = sn;
480 isuppz[(*m << 1) - 1] = 1;
481 isuppz[(*m << 1) - 1] = 2;
483 isuppz[(*m << 1) - 1] = 1;
484 isuppz[(*m << 1) - 1] = 1;
487 isuppz[(*m << 1) - 1] = 2;
496 inderr = (*n << 1) + 1;
498 indd = (*n << 2) + 1;
504 iindw = (*n << 1) + 1;
515 if (tnrm > 0. && tnrm < rmin) {
517 }
else if (tnrm > rmax) {
563 for (j = 1; j <= i__1; ++j) {
566 work[inde2 + j - 1] = d__1 * d__1;
585 rtol1, &rtol2, &thresh, &nsplit, &iwork[iinspl], m, &w[1], &work[
586 inderr], &work[indgp], &iwork[iindbl], &iwork[iindw], &work[
587 indgrs], &pivmin, &work[indwrk], &iwork[iindwk], &iinfo);
601 c__1, m, &c_b18, &rtol1, &rtol2, &w[1], &work[inderr], &work[
602 indgp], &iwork[iindbl], &iwork[iindw], &work[indgrs], &z__[
603 z_offset], ldz, &isuppz[1], &work[indwrk], &iwork[iindwk], &
616 for (j = 1; j <= i__1; ++j) {
617 itmp = iwork[iindbl + j - 1];
618 w[j] += e[iwork[iinspl + itmp - 1]];
628 i__1 = iwork[iindbl + *m - 1];
629 for (jblk = 1; jblk <= i__1; ++jblk) {
630 iend = iwork[iinspl + jblk - 1];
631 in = iend - ibegin + 1;
636 if (iwork[iindbl + wend] == jblk) {
645 offset = iwork[iindw + wbegin - 1] - 1;
646 ifirst = iwork[iindw + wbegin - 1];
647 ilast = iwork[iindw + wend - 1];
650 &ifirst, &ilast, &rtol2, &offset, &w[wbegin], &work[
651 inderr + wbegin - 1], &work[indwrk], &iwork[iindwk], &
652 pivmin, &tnrm, &iinfo);
679 for (j = 1; j <= i__1; ++j) {
683 for (jj = j + 1; jj <= i__2; ++jj) {
696 itmp = isuppz[(i__ << 1) - 1];
697 isuppz[(i__ << 1) - 1] = isuppz[(j << 1) - 1];
698 isuppz[(j << 1) - 1] = itmp;
699 itmp = isuppz[i__ * 2];
700 isuppz[i__ * 2] = isuppz[j * 2];
701 isuppz[j * 2] = itmp;
710 work[1] = (Treal) lwmin;
int template_blas_scal(const integer *n, const Treal *da, Treal *dx, const integer *incx)
Definition: template_blas_scal.h:41
#define absMACRO(x)
Definition: template_blas_common.h:45
int template_lapack_laev2(Treal *a, Treal *b, Treal *c__, Treal *rt1, Treal *rt2, Treal *cs1, Treal *sn1)
Definition: template_lapack_laev2.h:40
int integer
Definition: template_blas_common.h:38
int template_lapack_larre(const char *range, const integer *n, Treal *vl, Treal *vu, integer *il, integer *iu, Treal *d__, Treal *e, Treal *e2, Treal *rtol1, Treal *rtol2, Treal *spltol, integer *nsplit, integer *isplit, integer *m, Treal *w, Treal *werr, Treal *wgap, integer *iblock, integer *indexw, Treal *gers, Treal *pivmin, Treal *work, integer *iwork, integer *info)
Definition: template_lapack_larre.h:44
int template_lapack_larrc(const char *jobt, const integer *n, const Treal *vl, const Treal *vu, Treal *d__, Treal *e, Treal *pivmin, integer *eigcnt, integer *lcnt, integer *rcnt, integer *info)
Definition: template_lapack_larrc.h:39
#define maxMACRO(a, b)
Definition: template_blas_common.h:43
int template_lapack_larrr(const integer *n, Treal *d__, Treal *e, integer *info)
Definition: template_lapack_larrr.h:39
int template_lapack_lasrt(const char *id, const integer *n, Treal *d__, integer *info)
Definition: template_lapack_lasrt.h:40
#define minMACRO(a, b)
Definition: template_blas_common.h:44
int template_lapack_larrv(const integer *n, Treal *vl, Treal *vu, Treal *d__, Treal *l, Treal *pivmin, integer *isplit, integer *m, integer *dol, integer *dou, Treal *minrgp, Treal *rtol1, Treal *rtol2, Treal *w, Treal *werr, Treal *wgap, integer *iblock, integer *indexw, Treal *gers, Treal *z__, const integer *ldz, integer *isuppz, Treal *work, integer *iwork, integer *info)
Definition: template_lapack_larrv.h:43
int template_blas_erbla(const char *srname, integer *info)
Definition: template_blas_common.cc:144
int template_blas_swap(const integer *n, Treal *dx, const integer *incx, Treal *dy, const integer *incy)
Definition: template_blas_swap.h:40
Treal template_lapack_lamch(const char *cmach, Treal dummyReal)
Definition: template_lapack_lamch.h:199
bool logical
Definition: template_blas_common.h:39
int template_blas_copy(const integer *n, const Treal *dx, const integer *incx, Treal *dy, const integer *incy)
Definition: template_blas_copy.h:40
int template_lapack_larrj(integer *n, Treal *d__, Treal *e2, integer *ifirst, integer *ilast, Treal *rtol, integer *offset, Treal *w, Treal *werr, Treal *work, integer *iwork, Treal *pivmin, Treal *spdiam, integer *info)
Definition: template_lapack_larrj.h:39
#define FALSE_
Definition: template_lapack_common.h:41
int template_lapack_stemr(const char *jobz, const char *range, const integer *n, Treal *d__, Treal *e, const Treal *vl, const Treal *vu, const integer *il, const integer *iu, integer *m, Treal *w, Treal *z__, const integer *ldz, const integer *nzc, integer *isuppz, logical *tryrac, Treal *work, integer *lwork, integer *iwork, integer *liwork, integer *info)
Definition: template_lapack_stemr.h:39
int template_lapack_lae2(const Treal *a, const Treal *b, const Treal *c__, Treal *rt1, Treal *rt2)
Definition: template_lapack_lae2.h:40
Treal template_lapack_lanst(const char *norm, const integer *n, const Treal *d__, const Treal *e)
Definition: template_lapack_lanst.h:40
Treal template_blas_sqrt(Treal x)
logical template_blas_lsame(const char *ca, const char *cb)
Definition: template_blas_common.cc:44