tropicalsparse.storage: Storage Techniques

Description Usage Arguments Details Value See Also Examples

Description

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

Usage

1
tropicalsparse.storage(M, store, algebraType)

Arguments

M

is Matrix

store

is storage technique.

algebraType

is string input that can be minplus or maxplus.

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.

Value

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

See Also

tropicalsparse.add, tropicalsparse.mv.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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

tropicalSparse documentation built on May 1, 2019, 8:02 p.m.