kazaam (version 0.1-0)

norm: norm

Description

Implementation of R's norm() function for shaq objects.

Usage

# S4 method for shaq,ANY
norm(x, type = c("O", "I", "F", "M", "2"))

Arguments

x

A shaq

type

The type of norm: one, infinity, frobenius, max-modulus, and spectral.

Value

A number (length 1 regular vector).

Communication

If type == "O" then the communication consists of an allreduce, quadratic on the number of columns.

If type == "I" then the communication conists of an allgather.

If type == "F" then the communication is an allreduce, quadratic on the number of columns.

If type == "M" then the communication consists of an allgather.

If type == "2" then the communication consists of the same as that of an svd() call: an allreduce, quadratic on the number of columns.

Details

If type == "O" then the norm is calculated as the maximum of the column sums.

If type == "I" then the norm is calculated as the maximum absolute value of the row sums.

If type == "F" then the norm is calculated as the square root of the sum of the square of the values of the matrix.

If type == "M" then the norm is calculated as the max of the absolute value of the values of the matrix.

If type == "2" then the norm is calculated as the largest singular value.

Examples

Run this code

library(kazaam)
x = ranshaq(runif, 10, 3)

nm = norm(x)
comm.print(nm)

finalize()


Run the code above in your browser using DataLab