-
Notifications
You must be signed in to change notification settings - Fork 430
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
199 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
*> \brief \b DROUNDUP_LWORK | ||
* | ||
* =========== DOCUMENTATION =========== | ||
* | ||
* Online html documentation available at | ||
* http://www.netlib.org/lapack/explore-html/ | ||
* | ||
* Definition: | ||
* =========== | ||
* | ||
* DOUBLE PRECISION FUNCTION DROUNDUP_LWORK( LWORK ) | ||
* | ||
* .. Scalar Arguments .. | ||
* INTEGER LWORK | ||
* .. | ||
* | ||
* | ||
*> \par Purpose: | ||
* ============= | ||
*> | ||
*> \verbatim | ||
*> | ||
*> 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. | ||
*> \endverbatim | ||
* | ||
* Arguments: | ||
* ========== | ||
* | ||
*> \param[in] LWORK Workspace size. | ||
* | ||
* Authors: | ||
* ======== | ||
* | ||
*> \author Weslley Pereira, University of Colorado Denver, USA | ||
* | ||
*> \ingroup auxOTHERauxiliary | ||
* | ||
*> \par Further Details: | ||
* ===================== | ||
*> | ||
*> \verbatim | ||
*> This routine was inspired in the method `magma_zmake_lwork` from MAGMA. | ||
*> \see https://bitbucket.org/icl/magma/src/master/control/magma_zauxiliary.cpp | ||
*> \endverbatim | ||
* | ||
* ===================================================================== | ||
DOUBLE PRECISION FUNCTION DROUNDUP_LWORK( LWORK ) | ||
* | ||
* -- LAPACK auxiliary routine -- | ||
* -- LAPACK is a software package provided by Univ. of Tennessee, -- | ||
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- | ||
* | ||
* .. Scalar Arguments .. | ||
INTEGER LWORK | ||
* .. | ||
* | ||
* ===================================================================== | ||
* .. | ||
* .. Intrinsic Functions .. | ||
INTRINSIC EPSILON, DBLE, INT | ||
* .. | ||
* .. Executable Statements .. | ||
* .. | ||
DROUNDUP_LWORK = DBLE( LWORK ) | ||
* | ||
IF( INT( DROUNDUP_LWORK ) .LT. LWORK ) THEN | ||
* Force round up of LWORK | ||
DROUNDUP_LWORK = DROUNDUP_LWORK * ( 1.0D+0 + EPSILON(0.0D+0) ) | ||
ENDIF | ||
* | ||
RETURN | ||
* | ||
* End of DROUNDUP_LWORK | ||
* | ||
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
*> \brief \b SROUNDUP_LWORK | ||
* | ||
* =========== DOCUMENTATION =========== | ||
* | ||
* Online html documentation available at | ||
* http://www.netlib.org/lapack/explore-html/ | ||
* | ||
* Definition: | ||
* =========== | ||
* | ||
* REAL FUNCTION SROUNDUP_LWORK( LWORK ) | ||
* | ||
* .. Scalar Arguments .. | ||
* INTEGER LWORK | ||
* .. | ||
* | ||
* | ||
*> \par Purpose: | ||
* ============= | ||
*> | ||
*> \verbatim | ||
*> | ||
*> SROUNDUP_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( 16777217 ) == 16777216 | ||
*> float( 16777217 ) * (1.+eps) == 16777218 | ||
*> | ||
*> \return SROUNDUP_LWORK | ||
*> \verbatim | ||
*> SROUNDUP_LWORK >= LWORK. | ||
*> SROUNDUP_LWORK is guaranteed to have zero decimal part. | ||
*> \endverbatim | ||
* | ||
* Arguments: | ||
* ========== | ||
* | ||
*> \param[in] LWORK Workspace size. | ||
* | ||
* Authors: | ||
* ======== | ||
* | ||
*> \author Weslley Pereira, University of Colorado Denver, USA | ||
* | ||
*> \ingroup auxOTHERauxiliary | ||
* | ||
*> \par Further Details: | ||
* ===================== | ||
*> | ||
*> \verbatim | ||
*> This routine was inspired in the method `magma_zmake_lwork` from MAGMA. | ||
*> \see https://bitbucket.org/icl/magma/src/master/control/magma_zauxiliary.cpp | ||
*> \endverbatim | ||
* | ||
* ===================================================================== | ||
REAL FUNCTION SROUNDUP_LWORK( LWORK ) | ||
* | ||
* -- LAPACK auxiliary routine -- | ||
* -- LAPACK is a software package provided by Univ. of Tennessee, -- | ||
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- | ||
* | ||
* .. Scalar Arguments .. | ||
INTEGER LWORK | ||
* .. | ||
* | ||
* ===================================================================== | ||
* .. | ||
* .. Intrinsic Functions .. | ||
INTRINSIC EPSILON, REAL, INT | ||
* .. | ||
* .. Executable Statements .. | ||
* .. | ||
SROUNDUP_LWORK = REAL( LWORK ) | ||
* | ||
IF( INT( SROUNDUP_LWORK ) .LT. LWORK ) THEN | ||
* Force round up of LWORK | ||
SROUNDUP_LWORK = SROUNDUP_LWORK * ( 1.0E+0 + EPSILON(0.0E+0) ) | ||
ENDIF | ||
* | ||
RETURN | ||
* | ||
* End of SROUNDUP_LWORK | ||
* | ||
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters