From 742c35546bad2647adae4af882b0798de6c1ac8f Mon Sep 17 00:00:00 2001 From: Christoph Conrads Date: Thu, 21 Mar 2024 17:51:58 +0100 Subject: [PATCH 1/3] C/ZHEEVR: add remark about safe parameter choice The remark was only found in the real-valued implementations. --- SRC/cheevr.f | 1 + SRC/zheevr.f | 1 + 2 files changed, 2 insertions(+) diff --git a/SRC/cheevr.f b/SRC/cheevr.f index 162c8cd87e..da8ec2b367 100644 --- a/SRC/cheevr.f +++ b/SRC/cheevr.f @@ -242,6 +242,7 @@ *> Note: the user must ensure that at least max(1,M) columns are *> supplied in the array Z; if RANGE = 'V', the exact value of M *> is not known in advance and an upper bound must be used. +*> Supplying N columns is always safe. *> \endverbatim *> *> \param[in] LDZ diff --git a/SRC/zheevr.f b/SRC/zheevr.f index 94ad90f166..2ffe3f1723 100644 --- a/SRC/zheevr.f +++ b/SRC/zheevr.f @@ -242,6 +242,7 @@ *> Note: the user must ensure that at least max(1,M) columns are *> supplied in the array Z; if RANGE = 'V', the exact value of M *> is not known in advance and an upper bound must be used. +*> Supplying N columns is always safe. *> \endverbatim *> *> \param[in] LDZ From 88f15c26311939fcb11cef269fecb2f72f821985 Mon Sep 17 00:00:00 2001 From: Christoph Conrads Date: Thu, 21 Mar 2024 17:53:49 +0100 Subject: [PATCH 2/3] xSY/HEEVR: clarify use of multiple algorithms fixes #997 --- SRC/cheevr.f | 19 ++++++++++++++++--- SRC/dsyevr.f | 19 ++++++++++++++++--- SRC/ssyevr.f | 19 ++++++++++++++++--- SRC/zheevr.f | 19 ++++++++++++++++--- 4 files changed, 64 insertions(+), 12 deletions(-) diff --git a/SRC/cheevr.f b/SRC/cheevr.f index da8ec2b367..795e32e981 100644 --- a/SRC/cheevr.f +++ b/SRC/cheevr.f @@ -41,9 +41,16 @@ *> \verbatim *> *> CHEEVR computes selected eigenvalues and, optionally, eigenvectors -*> of a complex Hermitian matrix A. Eigenvalues and eigenvectors can -*> be selected by specifying either a range of values or a range of -*> indices for the desired eigenvalues. +*> of a real symmetric matrix A. Eigenvalues and eigenvectors can be +*> selected by specifying either a range of values or a range of indices +*> for the desired eigenvalues. Invocations with different choices for +*> these parameters may result in the computation of slightly different +*> eigenvalues and/or eigenvectors for the same matrix. The reason for +*> this behavior is that there exists a variety of algorithms (each +*> performing best for a particular set of options) with CHEEVR +*> attempting to select the best based on the various parameters. In all +*> cases, the computed values are accurate within the limits of finite +*> precision arithmetic. *> *> CHEEVR first reduces the matrix A to tridiagonal form T with a call *> to CHETRD. Then, whenever possible, CHEEVR calls CSTEMR to compute @@ -107,6 +114,9 @@ *> JOBZ is CHARACTER*1 *> = 'N': Compute eigenvalues only; *> = 'V': Compute eigenvalues and eigenvectors. +*> +*> This parameter influences the choice of the algorithm and +*> may alter the computed values. *> \endverbatim *> *> \param[in] RANGE @@ -118,6 +128,9 @@ *> = 'I': the IL-th through IU-th eigenvalues will be found. *> For RANGE = 'V' or 'I' and IU - IL < N - 1, SSTEBZ and *> CSTEIN are called +*> +*> This parameter influences the choice of the algorithm and +*> may alter the computed values. *> \endverbatim *> *> \param[in] UPLO diff --git a/SRC/dsyevr.f b/SRC/dsyevr.f index 72dd32d99b..99eb60ec85 100644 --- a/SRC/dsyevr.f +++ b/SRC/dsyevr.f @@ -39,9 +39,16 @@ *> \verbatim *> *> DSYEVR computes selected eigenvalues and, optionally, eigenvectors -*> of a real symmetric matrix A. Eigenvalues and eigenvectors can be -*> selected by specifying either a range of values or a range of -*> indices for the desired eigenvalues. +*> of a real symmetric matrix A. Eigenvalues and eigenvectors can be +*> selected by specifying either a range of values or a range of indices +*> for the desired eigenvalues. Invocations with different choices for +*> these parameters may result in the computation of slightly different +*> eigenvalues and/or eigenvectors for the same matrix. The reason for +*> this behavior is that there exists a variety of algorithms (each +*> performing best for a particular set of options) with DSYEVR +*> attempting to select the best based on the various parameters. In all +*> cases, the computed values are accurate within the limits of finite +*> precision arithmetic. *> *> DSYEVR first reduces the matrix A to tridiagonal form T with a call *> to DSYTRD. Then, whenever possible, DSYEVR calls DSTEMR to compute @@ -105,6 +112,9 @@ *> JOBZ is CHARACTER*1 *> = 'N': Compute eigenvalues only; *> = 'V': Compute eigenvalues and eigenvectors. +*> +*> This parameter influences the choice of the algorithm and +*> may alter the computed values. *> \endverbatim *> *> \param[in] RANGE @@ -116,6 +126,9 @@ *> = 'I': the IL-th through IU-th eigenvalues will be found. *> For RANGE = 'V' or 'I' and IU - IL < N - 1, DSTEBZ and *> DSTEIN are called +*> +*> This parameter influences the choice of the algorithm and +*> may alter the computed values. *> \endverbatim *> *> \param[in] UPLO diff --git a/SRC/ssyevr.f b/SRC/ssyevr.f index 8fedb4ca28..f12095649f 100644 --- a/SRC/ssyevr.f +++ b/SRC/ssyevr.f @@ -39,9 +39,16 @@ *> \verbatim *> *> SSYEVR computes selected eigenvalues and, optionally, eigenvectors -*> of a real symmetric matrix A. Eigenvalues and eigenvectors can be -*> selected by specifying either a range of values or a range of -*> indices for the desired eigenvalues. +*> of a real symmetric matrix A. Eigenvalues and eigenvectors can be +*> selected by specifying either a range of values or a range of indices +*> for the desired eigenvalues. Invocations with different choices for +*> these parameters may result in the computation of slightly different +*> eigenvalues and/or eigenvectors for the same matrix. The reason for +*> this behavior is that there exists a variety of algorithms (each +*> performing best for a particular set of options) with SSYEVR +*> attempting to select the best based on the various parameters. In all +*> cases, the computed values are accurate within the limits of finite +*> precision arithmetic. *> *> SSYEVR first reduces the matrix A to tridiagonal form T with a call *> to SSYTRD. Then, whenever possible, SSYEVR calls SSTEMR to compute @@ -105,6 +112,9 @@ *> JOBZ is CHARACTER*1 *> = 'N': Compute eigenvalues only; *> = 'V': Compute eigenvalues and eigenvectors. +*> +*> This parameter influences the choice of the algorithm and +*> may alter the computed values. *> \endverbatim *> *> \param[in] RANGE @@ -116,6 +126,9 @@ *> = 'I': the IL-th through IU-th eigenvalues will be found. *> For RANGE = 'V' or 'I' and IU - IL < N - 1, SSTEBZ and *> SSTEIN are called +*> +*> This parameter influences the choice of the algorithm and +*> may alter the computed values. *> \endverbatim *> *> \param[in] UPLO diff --git a/SRC/zheevr.f b/SRC/zheevr.f index 2ffe3f1723..e4114b9681 100644 --- a/SRC/zheevr.f +++ b/SRC/zheevr.f @@ -41,9 +41,16 @@ *> \verbatim *> *> ZHEEVR computes selected eigenvalues and, optionally, eigenvectors -*> of a complex Hermitian matrix A. Eigenvalues and eigenvectors can -*> be selected by specifying either a range of values or a range of -*> indices for the desired eigenvalues. +*> of a real symmetric matrix A. Eigenvalues and eigenvectors can be +*> selected by specifying either a range of values or a range of indices +*> for the desired eigenvalues. Invocations with different choices for +*> these parameters may result in the computation of slightly different +*> eigenvalues and/or eigenvectors for the same matrix. The reason for +*> this behavior is that there exists a variety of algorithms (each +*> performing best for a particular set of options) with ZHEEVR +*> attempting to select the best based on the various parameters. In all +*> cases, the computed values are accurate within the limits of finite +*> precision arithmetic. *> *> ZHEEVR first reduces the matrix A to tridiagonal form T with a call *> to ZHETRD. Then, whenever possible, ZHEEVR calls ZSTEMR to compute @@ -107,6 +114,9 @@ *> JOBZ is CHARACTER*1 *> = 'N': Compute eigenvalues only; *> = 'V': Compute eigenvalues and eigenvectors. +*> +*> This parameter influences the choice of the algorithm and +*> may alter the computed values. *> \endverbatim *> *> \param[in] RANGE @@ -118,6 +128,9 @@ *> = 'I': the IL-th through IU-th eigenvalues will be found. *> For RANGE = 'V' or 'I' and IU - IL < N - 1, DSTEBZ and *> ZSTEIN are called +*> +*> This parameter influences the choice of the algorithm and +*> may alter the computed values. *> \endverbatim *> *> \param[in] UPLO From e79eae6c4e4d620efb95f739a3bcab5a9329cc26 Mon Sep 17 00:00:00 2001 From: Christoph Conrads Date: Thu, 21 Mar 2024 18:32:02 +0100 Subject: [PATCH 3/3] xHEEVR: fix a copy-and-paste error Thanks to @langou for proof-reading. --- SRC/cheevr.f | 2 +- SRC/zheevr.f | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SRC/cheevr.f b/SRC/cheevr.f index 795e32e981..13a0011653 100644 --- a/SRC/cheevr.f +++ b/SRC/cheevr.f @@ -41,7 +41,7 @@ *> \verbatim *> *> CHEEVR computes selected eigenvalues and, optionally, eigenvectors -*> of a real symmetric matrix A. Eigenvalues and eigenvectors can be +*> of a complex Hermitian matrix A. Eigenvalues and eigenvectors can be *> selected by specifying either a range of values or a range of indices *> for the desired eigenvalues. Invocations with different choices for *> these parameters may result in the computation of slightly different diff --git a/SRC/zheevr.f b/SRC/zheevr.f index e4114b9681..56761a5249 100644 --- a/SRC/zheevr.f +++ b/SRC/zheevr.f @@ -41,7 +41,7 @@ *> \verbatim *> *> ZHEEVR computes selected eigenvalues and, optionally, eigenvectors -*> of a real symmetric matrix A. Eigenvalues and eigenvectors can be +*> of a complex Hermitian matrix A. Eigenvalues and eigenvectors can be *> selected by specifying either a range of values or a range of indices *> for the desired eigenvalues. Invocations with different choices for *> these parameters may result in the computation of slightly different