fnorm: Frobenius norm of an array.

View source: R/basic_tensor.R

fnormR Documentation

Frobenius norm of an array.

Description

Calculates the Frobenius norm of an array.

Usage

fnorm(X)

Arguments

X

An array, a matrix, or a vector.

Details

The Frobenius norm of an array is the square root of the sum of its squared elements. This function works for vector and matrix arguments as well.

Value

The square root of the sum of the squared elements of X.

Author(s)

David Gerard.

Examples

X <- c(1:8)
Y <- matrix(1:8, nrow = 2)
Z <- array(1:8, dim = c(2, 2, 2))
fnorm(X)
fnorm(Y)
fnorm(Z)

dcgerard/tensr documentation built on Oct. 4, 2022, 5:58 p.m.