row.col.Number: Row/Column Number of a Value

Description Usage Arguments Details Value See Also Examples

Description

row.col.Number method is used to get the row or column number of a specific value in the matrix.

Usage

1
row.col.Number(i, x, arr)

Arguments

i

is an index of array containing non-infinite values of the matrix.

x

is total number of rows or columns of the matrix.

arr

is an array containing row or column pointer of the matrix.

Details

The function row.col.Number recieves three parameters i, x and arr. As mentioned above i is an index of array containing non-infinite values of the matrix. This array can only be obtained in the CSR and CSC storage techniques and has zero sparsity. x is total number of rows in case of CSR or total number of columns in case of CSC of the matrix. arr is an array containing row pointer in case of CSR or column pointer in case of CSC of the matrix. From these inputs row.col.Number finds row or column number of a specific value in the matrix. This function is used especially for CSR and CSC storage techniques.

Value

Returns the row or column number of a specific value if succeded, otherwise NA.

See Also

tropicalsparse.add, tropicalsparse.mul.

Examples

1
2
3
4
5
6
7
a <- matrix(data = c(2, Inf, Inf, 0, Inf, Inf, Inf, 10, Inf),
nrow = 3, ncol = 3, byrow = TRUE)

List = tropicalsparse.storage(a,'csr','minplus')
i = 2
row.col.Number(i, nrow(a), List[[1]])
# [1] 2

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