A high-performance general-purpose compute library

Find the norm of a 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 to find the norm of a matrix. More...
 
AFAPI af_err af_norm (double *out, const af_array in, const af_norm_type type, const double p, const double q)
 C Interface to find the norm of a matrix. More...
 

Detailed Description

Find the norm of a matrix.

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

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 to find the norm of a matrix.

Parameters
[out]outnorm
[in]ininput matrix
[in]typeaf::normType. Default: AF_NORM_VECTOR_1
[in]pvalue of P when type is AF_NORM_VECTOR_P or AF_NORM_MATRIX_L_PQ, else ignored
[in]qvalue of Q when type is AF_NORM_MATRIX_L_PQ, else ignored
Returns
AF_SUCCESS, if function returns successfully, else an af_err code is given

◆ norm()

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

C++ Interface to find the norm of a matrix.

Parameters
[in]ininput matrix
[in]typeaf::normType. Default: AF_NORM_VECTOR_1
[in]pvalue of P when type is AF_NORM_VECTOR_P or AF_NORM_MATRIX_L_PQ, else ignored
[in]qvalue of Q when type is AF_NORM_MATRIX_L_PQ, else ignored
Returns
norm