counter: Count non-infinit values

Description Usage Arguments Details Value Examples

Description

counter is used to get total number of non-infinit values in a matrix.

Usage

1

Arguments

M

is a matrix.

Details

The input of this function is a matrix. This function returns the total number of non-infinite values in the given matrix. In order to work properly, M must be a matrix otherwise this method generates an error.

Value

Returns total number of non-infinit values.

Examples

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

counter(a)

# [1] 3

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