Loading...
Searching...
No Matches
nrm2: Vector 2 norm
Dense LA » MAGMA BLAS and Auxiliary » Level 1: vectors operations, O(n) work

\(||x||_2\) More...

## Functions

float | magma_cblas_scnrm2 (magma_int_t n, const magmaFloatComplex *x, magma_int_t incx)
| Returns 2-norm of vector x.
double | magma_cblas_dnrm2 (magma_int_t n, const double *x, magma_int_t incx)
| Returns 2-norm of vector x.
float | magma_cblas_snrm2 (magma_int_t n, const float *x, magma_int_t incx)
| Returns 2-norm of vector x.
double | magma_cblas_dznrm2 (magma_int_t n, const magmaDoubleComplex *x, magma_int_t incx)
| Returns 2-norm of vector x.
float | magma_scnrm2 (magma_int_t n, magmaFloatComplex_const_ptr dx, magma_int_t incx, magma_queue_t queue)
double | magma_dnrm2 (magma_int_t n, magmaDouble_const_ptr dx, magma_int_t incx, magma_queue_t queue)
float | magma_snrm2 (magma_int_t n, magmaFloat_const_ptr dx, magma_int_t incx, magma_queue_t queue)
double | magma_dznrm2 (magma_int_t n, magmaDoubleComplex_const_ptr dx, magma_int_t incx, magma_queue_t queue)

## Detailed Description

\(||x||_2\)

## Function Documentation

## magma_cblas_scnrm2()

float magma_cblas_scnrm2 | ( | magma_int_t | n,
|  | const magmaFloatComplex * | x,
|  | magma_int_t | incx )

Returns 2-norm of vector x.

Avoids unnecesary over/underflow.

To avoid dependence on CBLAS and incompatability issues between BLAS libraries, MAGMA uses its own implementation, following BLAS reference.

Parameters

  [in] | n | Number of elements in vector x. n >= 0.
  [in] | x | COMPLEX array on CPU host. The n element vector x of dimension (1 + (n-1)*incx).
  [in] | incx | Stride between consecutive elements of x. incx > 0.

## magma_cblas_dnrm2()

double magma_cblas_dnrm2 | ( | magma_int_t | n,
|  | const double * | x,
|  | magma_int_t | incx )

Returns 2-norm of vector x.

Avoids unnecesary over/underflow.

To avoid dependence on CBLAS and incompatability issues between BLAS libraries, MAGMA uses its own implementation, following BLAS reference.

Parameters

  [in] | n | Number of elements in vector x. n >= 0.
  [in] | x | DOUBLE PRECISION array on CPU host. The n element vector x of dimension (1 + (n-1)*incx).
  [in] | incx | Stride between consecutive elements of x. incx > 0.

## magma_cblas_snrm2()

float magma_cblas_snrm2 | ( | magma_int_t | n,
|  | const float * | x,
|  | magma_int_t | incx )

Returns 2-norm of vector x.

Avoids unnecesary over/underflow.

To avoid dependence on CBLAS and incompatability issues between BLAS libraries, MAGMA uses its own implementation, following BLAS reference.

Parameters

  [in] | n | Number of elements in vector x. n >= 0.
  [in] | x | REAL array on CPU host. The n element vector x of dimension (1 + (n-1)*incx).
  [in] | incx | Stride between consecutive elements of x. incx > 0.

## magma_cblas_dznrm2()

double magma_cblas_dznrm2 | ( | magma_int_t | n,
|  | const magmaDoubleComplex * | x,
|  | magma_int_t | incx )

Returns 2-norm of vector x.

Avoids unnecesary over/underflow.

To avoid dependence on CBLAS and incompatability issues between BLAS libraries, MAGMA uses its own implementation, following BLAS reference.

Parameters

  [in] | n | Number of elements in vector x. n >= 0.
  [in] | x | COMPLEX_16 array on CPU host. The n element vector x of dimension (1 + (n-1)*incx).
  [in] | incx | Stride between consecutive elements of x. incx > 0.

## magma_scnrm2()

float magma_scnrm2 | ( | magma_int_t | n,
|  | magmaFloatComplex_const_ptr | dx,
|  | magma_int_t | incx,
|  | magma_queue_t | queue )

Returns
  2-norm of vector x; \( \text{sqrt}( x^H x ) \). Avoids unnecesary over/underflow.

Parameters

  [in] | n | Number of elements in vector x and y. n >= 0.
  [in] | dx | COMPLEX array on GPU device. The n element vector x of dimension (1 + (n-1)*incx).
  [in] | incx | Stride between consecutive elements of dx. incx > 0.
  [in] | queue | magma_queue_t Queue to execute in.

## magma_dnrm2()

double magma_dnrm2 | ( | magma_int_t | n,
|  | magmaDouble_const_ptr | dx,
|  | magma_int_t | incx,
|  | magma_queue_t | queue )

Returns
  2-norm of vector x; \( \text{sqrt}( x^H x ) \). Avoids unnecesary over/underflow.

Parameters

  [in] | n | Number of elements in vector x and y. n >= 0.
  [in] | dx | DOUBLE PRECISION array on GPU device. The n element vector x of dimension (1 + (n-1)*incx).
  [in] | incx | Stride between consecutive elements of dx. incx > 0.
  [in] | queue | magma_queue_t Queue to execute in.

## magma_snrm2()

float magma_snrm2 | ( | magma_int_t | n,
|  | magmaFloat_const_ptr | dx,
|  | magma_int_t | incx,
|  | magma_queue_t | queue )

Returns
  2-norm of vector x; \( \text{sqrt}( x^H x ) \). Avoids unnecesary over/underflow.

Parameters

  [in] | n | Number of elements in vector x and y. n >= 0.
  [in] | dx | REAL array on GPU device. The n element vector x of dimension (1 + (n-1)*incx).
  [in] | incx | Stride between consecutive elements of dx. incx > 0.
  [in] | queue | magma_queue_t Queue to execute in.

## magma_dznrm2()

double magma_dznrm2 | ( | magma_int_t | n,
|  | magmaDoubleComplex_const_ptr | dx,
|  | magma_int_t | incx,
|  | magma_queue_t | queue )

Returns
  2-norm of vector x; \( \text{sqrt}( x^H x ) \). Avoids unnecesary over/underflow.

Parameters

  [in] | n | Number of elements in vector x and y. n >= 0.
  [in] | dx | COMPLEX_16 array on GPU device. The n element vector x of dimension (1 + (n-1)*incx).
  [in] | incx | Stride between consecutive elements of dx. incx > 0.
  [in] | queue | magma_queue_t Queue to execute in.