A high-performance general-purpose compute library

Find the norm of the input matrix. More...

Functions

AFAPI double norm (const array &in, const normType type=AF_NORM_EUCLID, const double p=1, const double q=1)
 C++ Interface for norm of a matrix.
 
AFAPI af_err af_norm (double *out, const af_array in, const af_norm_type type, const double p, const double q)
 C Interface for norm of a matrix.
 

Detailed Description

Find the norm of the input matrix.

This function can return the norm using various metrics based on the type paramter.

Note
AF_NORM_MATRIX_2 is currently not supported.

Function Documentation

◆ af_norm()

AFAPI af_err af_norm ( double *  out,
const af_array  in,
const af_norm_type  type,
const double  p,
const double  q 
)

C Interface for norm of a matrix.

Parameters
[out]outwill contain the norm of in
[in]inis the input matrix
[in]typespecifies the af::normType. Default: AF_NORM_VECTOR_1
[in]pspecifies the value of P when type is one of AF_NORM_VECTOR_P, AF_NORM_MATRIX_L_PQ is used. It is ignored for other values of type
[in]qspecifies the value of Q when type is AF_NORM_MATRIX_L_PQ. This parameter is ignored if type is anything else

◆ norm()

AFAPI double norm ( const array in,
const normType  type = AF_NORM_EUCLID,
const double  p = 1,
const double  q = 1 
)

C++ Interface for norm of a matrix.

Parameters
[in]inis the input matrix
[in]typespecifies the af::normType. Default: AF_NORM_VECTOR_1
[in]pspecifies the value of P when type is one of AF_NORM_VECTOR_P, AF_NORM_MATRIX_L_PQ is used. It is ignored for other values of type
[in]qspecifies the value of Q when type is AF_NORM_MATRIX_L_PQ. This parameter is ignored if type is anything else
Returns
the norm of inbased on type