A high-performance general-purpose compute library

- Main Page
- Tutorials
- Release Notes
- Examples

Functions
norm
ArrayFire Functions | ArrayFire Functions by Category » Linear Algebra » Matrix operations

## 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.
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.

## 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] | out | norm
  [in] | in | input matrix
  [in] | type | af::normType. Default: AF_NORM_VECTOR_1
  [in] | p | value of P when `type` is AF_NORM_VECTOR_P or AF_NORM_MATRIX_L_PQ, else ignored
  [in] | q | value 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] | in | input matrix
  [in] | type | af::normType. Default: AF_NORM_VECTOR_1
  [in] | p | value of P when `type` is AF_NORM_VECTOR_P or AF_NORM_MATRIX_L_PQ, else ignored
  [in] | q | value of Q when `type` is AF_NORM_MATRIX_L_PQ, else ignored

Returns
  norm