update_finite_infinity_for_uniform: Maximum between finite_infinity and 10 times the max abs...

View source: R/domain.R

update_finite_infinity_for_uniformR Documentation

Maximum between finite_infinity and 10 times the max abs value of finite elements in lefts and rights.

Description

Maximum between finite_infinity and 10 times the max abs value of finite elements in lefts and rights.

Usage

update_finite_infinity_for_uniform(lefts, rights, finite_infinity)

Arguments

lefts

A non-empty vector of numbers (may contain -Inf), the left endpoints of a domain defined as a union of intervals. Must pass check_endpoints(lefts, rights).

rights

A non-empty vector of numbers (may contain Inf), the right endpoints of a domain defined as a union of intervals. Must pass check_endpoints(lefts, rights).

finite_infinity

A finite positive number. Inf will be truncated to finite_infinity if applicable. See details.

Details

Since we assume that lefts[i] <= rights[i] <= lefts[j] for any i < j, the function takes the maximum between finite_infinity and 10 times the absolute values of lefts[1], lefts[length(lefts)], rights[1], and rights[length(rights)], if they are finite.

Value

A double, larger than or equal to finite_infinity.

Examples

# Does not change since 1000 > 12 * 10
update_finite_infinity_for_uniform(c(-10,-5,0,5,9), c(-8,-3,2,7,12), 1000)
# Changed to 12 * 10
update_finite_infinity_for_uniform(c(-10,-5,0,5,9), c(-8,-3,2,7,12), 10)
# Changed to 12 * 10
update_finite_infinity_for_uniform(c(-Inf,-5,0,5,9), c(-8,-3,2,7,12), 10)
# Changed to 9 * 10
update_finite_infinity_for_uniform(c(-Inf,-5,0,5,9), c(-8,-3,2,7,Inf), 10)

genscore documentation built on May 29, 2024, 9 a.m.