LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ droundup_lwork()

double precision function droundup_lwork ( integer lwork)

DROUNDUP_LWORK

Purpose:
!>
!> DROUNDUP_LWORK deals with a subtle bug with returning LWORK as a Float.
!> This routine guarantees it is rounded up instead of down by
!> multiplying LWORK by 1+eps when it is necessary, where eps is the relative machine precision.
!> E.g.,
!>
!>        float( 9007199254740993            ) == 9007199254740992
!>        float( 9007199254740993 ) * (1.+eps) == 9007199254740994
!>
!> \return DROUNDUP_LWORK
!> \verbatim
!>         DROUNDUP_LWORK >= LWORK.
!>         DROUNDUP_LWORK is guaranteed to have zero decimal part.
!> 
Parameters
[in]LWORKWorkspace size.
Author
Weslley Pereira, University of Colorado Denver, USA
Further Details:
!>  This routine was inspired in the method `magma_zmake_lwork` from MAGMA.
!>  \see https://bitbucket.org/icl/magma/src/master/control/magma_zauxiliary.cpp
!> 

Definition at line 58 of file droundup_lwork.f.

59*
60* -- LAPACK auxiliary routine --
61* -- LAPACK is a software package provided by Univ. of Tennessee, --
62* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
63*
64* .. Scalar Arguments ..
65 INTEGER LWORK
66* ..
67*
68* =====================================================================
69* ..
70* .. Intrinsic Functions ..
71 INTRINSIC epsilon, dble, int
72* ..
73* .. Executable Statements ..
74* ..
75 droundup_lwork = dble( lwork )
76*
77 IF( int( droundup_lwork ) .LT. lwork ) THEN
78* Force round up of LWORK
80 $ ( 1.0d+0 + epsilon(0.0d+0) )
81 ENDIF
82*
83 RETURN
84*
85* End of DROUNDUP_LWORK
86*
double precision function droundup_lwork(lwork)
DROUNDUP_LWORK
Here is the call graph for this function:
Here is the caller graph for this function: