norm {kazaam} | R Documentation |
norm
Description
Implementation of R's norm()
function for shaq objects.
Usage
## S4 method for signature '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. |
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.
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.
Examples
## Not run:
library(kazaam)
x = ranshaq(runif, 10, 3)
nm = norm(x)
comm.print(nm)
finalize()
## End(Not run)