Last chance! 50% off unlimited learning
Sale ends in
Implementation of R's norm()
function for shaq objects.
# S4 method for shaq,ANY
norm(x, type = c("O", "I", "F", "M", "2"))
A shaq
The type of norm: one, infinity, frobenius, max-modulus, and spectral.
A number (length 1 regular vector).
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.
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.
library(kazaam)
x = ranshaq(runif, 10, 3)
nm = norm(x)
comm.print(nm)
finalize()
Run the code above in your browser using DataLab