Learn R Programming

tropicalSparse (version 0.1.0)

tropicalsparse.storage: Storage Techniques

Description

tropicalsparse.storage function is used to apply coo, csr and csc storage techniques on the sparse matrix in Tropical Algebra.

Usage

tropicalsparse.storage(M, store, algebraType)

Arguments

M

is Matrix

store

is storage technique.

algebraType

is string input that can be minplus or maxplus.

Value

Returns a list result that contains three arrays depends upon the store input.

Details

The function tropicalsparse.storage recieves a matrix as first input, storage technique as second input and the type of Tropical Algebra as third input. All the inputs are compulsory. store can be coo, csr and csc. 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. If store is equal to coo then the function returns a list containing three arrays that are row_Indices_COO, col_Indices_COO and values_COO. If store is equal to csc then the function returns a list containing three arrays that are col_Pointer_CSC, row_Indices_CSC and values_CSC. If store is equal to csr then the function returns a list containing three arrays that are row_Pointer_CSR, col_Indices_CSR and values_CSR. These storage techniques are especially designed for sparse matrices and are very helpful and time saving.

See Also

tropicalsparse.add, tropicalsparse.mv.

Examples

Run this code
# NOT RUN {
a <- matrix(data = c(2, Inf, Inf, 0, Inf, Inf, Inf, 10, Inf),
nrow = 3, ncol = 3, byrow = TRUE)

tropicalsparse.storage(a, 'coo', 'minplus')

# $row_Indices_COO
# [1] 1 2 3

# $col_Indices_COO
# [1] 1 1 2

# $values_COO
# [1]  2  0 10

# }

Run the code above in your browser using DataLab