roundup_lwork(3)

πŸ’– NAME πŸ’–

okay so this is roundup_lwork(3) from the Library Functions Manual β€” yes bestie, the Library Functions Manual, and we're about to get into the whole integer-to-float rounding situation. πŸŽ€

  • roundup_lwork β€” roundup_lwork: fix rounding integer to float. That's the whole assignment, no cap. ✨

✨ SYNOPSIS ✨

🫢 Functions

  • double precision function droundup_lwork (lwork) β€” this is the DROUNDUP_LWORK one. πŸ’–
  • real function sroundup_lwork (lwork) β€” and this is the SROUNDUP_LWORK one. πŸ¦‹

🌈 Detailed Description 🌈

The original page leaves this section pretty lowkey β€” it's just the Detailed Description stop before we hit Function Documentation. Mysterious main character energy, honestly. πŸ“


πŸ’… Function Documentation πŸ’…

πŸ’œ double precision function droundup_lwork (integer lwork) πŸ’œ

DROUNDUP_LWORK is the name of the game here. πŸ’–

✨ Purpose ✨

okay so DROUNDUP_LWORK deals with a subtle bug with returning LWORK as a Float. The way it handles it: 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. That's the tea. πŸ«–

Example time, bestie:

float( 9007199254740993            ) == 9007199254740992
float( 9007199254740993 ) * (1.+eps) == 9007199254740994

Returns: DROUNDUP_LWORK πŸ’…

  • DROUNDUP_LWORK >= LWORK.
  • DROUNDUP_LWORK is guaranteed to have zero decimal part.

🫢 Parameters

  • LWORK β€” Workspace size. πŸŽ€

🌸 Author

Weslley Pereira, University of Colorado Denver, USA. πŸ‘‘

πŸ¦‹ Further Details

This routine was inspired in the method magma_zmake_lwork from MAGMA. The source even points you at \see https://bitbucket.org/icl/magma/src/master/control/magma_zauxiliary.cpp. πŸ”₯

πŸ“Œ Definition

Definition at line 58 of file droundup_lwork.f. ✨


πŸ’™ real function sroundup_lwork (integer lwork) πŸ’™

SROUNDUP_LWORK is the other icon of this page. πŸ’™

✨ Purpose ✨

okay so 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. Same energy, different precision. ⭐

Example:

float( 16777217            ) == 16777216
float( 16777217 ) * (1.+eps) == 16777218

Returns: SROUNDUP_LWORK 🫢

  • SROUNDUP_LWORK >= LWORK.
  • SROUNDUP_LWORK is guaranteed to have zero decimal part.

🫢 Parameters

  • LWORK β€” Workspace size. 🌸

🌸 Author

Weslley Pereira, University of Colorado Denver, USA. πŸ‘‘

πŸ¦‹ Further Details

This routine was inspired in the method magma_zmake_lwork from MAGMA. The source even points you at \see https://bitbucket.org/icl/magma/src/master/control/magma_zauxiliary.cpp. πŸ”₯

πŸ“Œ Definition

Definition at line 58 of file sroundup_lwork.f. ✨


πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for LAPACK from the source code. πŸ€–πŸ’–


Cute sign-off: this is LAPACK, Version 3.12.0, and the page is roundup_lwork(3) β€” the date slot is literally blank in the original, so no invented dates, bestie. Byeee! πŸ’…βœ¨

πŸ“¦ where this page comes from