roundup_lwork#

Functions

f32 sroundup_lwork(
    const INT lwork
);
f32 sroundup_lwork(const INT lwork)#

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

This routine was inspired in the method magma_zmake_lwork from MAGMA. See https://bitbucket.org/icl/magma/src/master/control/magma_zauxiliary.cpp

Parameters

in
lwork

Workspace size.

Returns:

sroundup_lwork >= lwork. sroundup_lwork is guaranteed to have zero decimal part.

Functions

f64 droundup_lwork(
    const INT lwork
);
f64 droundup_lwork(const INT lwork)#

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

This routine was inspired in the method magma_zmake_lwork from MAGMA. See https://bitbucket.org/icl/magma/src/master/control/magma_zauxiliary.cpp

Parameters

in
lwork

Workspace size.

Returns:

droundup_lwork >= lwork. droundup_lwork is guaranteed to have zero decimal part.