norms: Row and Column Norms

Description Usage Arguments Value Examples

Description

Compute row and column p-norms.

Usage

1
2
row_norms(x, p = 2)
col_norms(x, p = 2)

Arguments

x

a sparse simple_triplet_matrix, or a dense matrix.

p

a numeric at least one. Using Inf gives the maximum norm.

Value

A vector with the row or column p-norms for the given matrix.

Examples

1
2
3
4
5
x <- matrix(1 : 9, 3L)
## Row lengths:
row_norms(x)
## Column maxima:
col_norms(x, Inf)

slam documentation built on Dec. 26, 2019, 9:07 a.m.

Related to norms in slam...