Fix workspace size handling in {s,d,c,z}{sy,sp,he,hp}gvd:
1. Workspace readback: remove redundant REAL()/DBLE() casts on INTEGER
and same-type operands in the post-CHEEVD/ZHEEVD/etc. MAX expressions.
The old pattern INT(MAX(REAL(int_var), REAL(fp_var))) needlessly
round-tripped integers through floating-point; for IWORK (already
INTEGER) the conversion was entirely spurious and risks precision
loss when 5*N+3 exceeds the 23-bit (single) or 52-bit (double)
significand.
2. WORK(1) writes: use SROUNDUP_LWORK/DROUNDUP_LWORK in dspgvd, dsygvd,
zhegvd, zhpgvd where the optimal workspace size was previously stored
via bare assignment (WORK(1) = LOPT), losing the ceiling guarantee
that ROUNDUP_LWORK provides.
3. RWORK(1) writes: replace REAL(LROPT) with SROUNDUP_LWORK (chegvd,
chpgvd) or DROUNDUP_LWORK (zhegvd, zhpgvd). The zhegvd/zhpgvd case
was a latent bug: RWORK is DOUBLE PRECISION but REAL() truncated to
single precision before storing.
4. Add DROUNDUP_LWORK declarations (type + EXTERNAL) to the four
double-precision / complex-16 routines that lacked them. Remove
now-unused REAL/DBLE from INTRINSIC lists where applicable.
This is really old school, but a lot of times we have users sending us
copy pasting of codes, and that is the only way to know the version of
the code.
This is mostly a long term maintenance improvement.
Many coding styles require elimination of trailing whitespace, and
many editors and source code management configurations automatically
gobble up whitespace. When these tools gobble up whitespace, it
complicates reviewing the meaningful code changes.
By removing whitespace on one patch, it makes future
code reviews much easier.
=SCRIPT====================================================================
if which tempfile &>/dev/null; then
TEMPMAKER=tempfile
elif which mktemp &>/dev/null; then
TEMPMAKER=mktemp
else
echo "Cannot find tempfile program." 2>&1
exit 1
fi
MYTEMP=$($TEMPMAKER)
trap 'rm -f $MYTEMP' SIGINT SIGTERM
stripit() {
echo "stripping $1"
sed 's/[ \t]*$//' "$1" > $MYTEMP
cp $MYTEMP "$1"
}
if [ $# -gt 0 ]; then
while [ "$1" != "" ]; do
stripit $1
shift
done
else
while read -t 2; do
stripit $REPLY
done
fi
rm $MYTEMP
=================================================
From Christopher:
I noticed the following errors in the documentation and attached
patches for all of them:
- Sometimes the function name in the docstring \brief does not match the
actual function name (ex: xSYGV*).
- According to the documentation, xLAHRD is obsolete but not deprecated.
- The parameter N in xLA(R)SCL2 is not the number of columns of D.
Also, I updated the Doxyfile (doxygen -u DOCS/Doxyfile) and removed
the missing DOT_FONTNAME to get rid of the Doxygen warnings.
Use \par instead of \details for section.
add a Contributors Section and a Reference Section.
Remove (some) verbatim section when not needed.
Those changes have been done by hand so I am not sure I manage to catch them all.