Learn R Programming

tropicalSparse (version 0.1.0)

tropicalsparse.axpyi: tropicalsparse.axpyi()

Description

tropicalsparse.axpyi function multiplies the vector x by the constant alpha and adds the result to the vector y.

Usage

tropicalsparse.axpyi(y, alpha, x, algebraType)

Arguments

y

is a vector.

alpha

is a constant.

x

is a vector.

algebraType

is string input that can be minplus or maxplus.

Value

Returns a vector.

Details

The input of the function tropicalsparse.axpyi is two vectors, a constant and type of Tropical Algebra. algebraType is used to specify type of Tropical Algebra. This can be minplus or maxplus. For more details about algebraType, see detail section of check.infinityM or check.infinityV. All inputs of this method are compulsory. The operation is expressed as: y = y + alpha * x where x and y must be a vector while alpha must be a constant.

See Also

tropicalsparse.doti

Examples

Run this code
# NOT RUN {
a <- c(2, Inf, 5, 0, Inf, Inf, Inf, 10, Inf)
b <- c(0, 5, Inf, Inf, 12, 2, Inf, Inf, 3)
alpha <- 5

tropicalsparse.axpyi(a, alpha, b, 'minplus')

# [1]   2  10   5   0  17   7 Inf  10   8

# }

Run the code above in your browser using DataLab