Learn R Programming

tropicalSparse (version 0.1.0)

check.infinityV: Check Infinity in Vector

Description

check.infinityV checks infinite value in a vector based on algebraType input.

Usage

check.infinityV(V, algebraType)

Arguments

V

is vector.

algebraType

is string input that can be minplus or maxplus.

Value

Returns nothing but generates an error if specific conditions met.

Details

The input of this function is a vector and type of tropical algebra. A vector may contain infinite values that can be positive or negative. Both the positive and negative infinite values works differently on each algebra type. Due to the difference between minplus and maxplus tropical algebra, it is important to manage them so they can work in their own bounderies. In minplus -Inf cannot be used while in maxplus Inf cannot be used. So the main purpose of this funnction is to check such possibilities that can cause errors. If this function finds a -Inf in the vector and the type of algebra is minplus then the function generates an error. Similarly, if the function finds a Inf in the vector and the type of algebra is maxplus then the function also generates an error.

See Also

check.infinityM

Examples

Run this code
# NOT RUN {
a <- c(2, Inf, Inf, 0, Inf, Inf, Inf, 10, Inf)
check.infinityV(a, 'minplus')

# }

Run the code above in your browser using DataLab