LAPACK 3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
sroundup_lwork.f
Go to the documentation of this file.
1*> \brief \b SROUNDUP_LWORK
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8* Definition:
9* ===========
10*
11* REAL FUNCTION SROUNDUP_LWORK( LWORK )
12*
13* .. Scalar Arguments ..
14* INTEGER LWORK
15* ..
16*
17*
18*> \par Purpose:
19* =============
20*>
21*> \verbatim
22*>
23*> SROUNDUP_LWORK deals with a subtle bug with returning LWORK as a Float.
24*> This routine guarantees it is rounded up instead of down by
25*> multiplying LWORK by 1+eps when it is necessary, where eps is the relative machine precision.
26*> E.g.,
27*>
28*> float( 16777217 ) == 16777216
29*> float( 16777217 ) * (1.+eps) == 16777218
30*>
31*> \return SROUNDUP_LWORK
32*> \verbatim
33*> SROUNDUP_LWORK >= LWORK.
34*> SROUNDUP_LWORK is guaranteed to have zero decimal part.
35*> \endverbatim
36*
37* Arguments:
38* ==========
39*
40*> \param[in] LWORK Workspace size.
41*
42* Authors:
43* ========
44*
45*> \author Weslley Pereira, University of Colorado Denver, USA
46*
47*> \ingroup roundup_lwork
48*
49*> \par Further Details:
50* =====================
51*>
52*> \verbatim
53*> This routine was inspired in the method `magma_zmake_lwork` from MAGMA.
54*> \see https://bitbucket.org/icl/magma/src/master/control/magma_zauxiliary.cpp
55*> \endverbatim
56*
57* =====================================================================
58 REAL function sroundup_lwork( lwork )
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, real, int
72* ..
73* .. Executable Statements ..
74* ..
75 sroundup_lwork = real( lwork )
76*
77 IF( int( sroundup_lwork ) .LT. lwork ) THEN
78* Force round up of LWORK
79 sroundup_lwork = sroundup_lwork * ( 1.0e+0 + epsilon(0.0e+0) )
80 ENDIF
81*
82 RETURN
83*
84* End of SROUNDUP_LWORK
85*
86 END
real function sroundup_lwork(lwork)
SROUNDUP_LWORK