# Vector Norm (G Dataflow)

Computes the norm of a vector.

## vector

The input vector.

This input accepts a 1D array of double-precision, floating point numbers or 1D array of complex double-precision, floating point numbers.

If this input is an empty array, this node returns NaN.

## norm type

Type of norm this node computes.

If norm type is User Defined, this node uses user defined norm as the norm type.

Name Value Description
1-norm 0 Uses 1-norm.
2-norm 1 Uses 2-norm.
Inf-norm 2 Uses infinity-norm.
-Inf-norm 3 Uses -infinity-norm.
User Defined 4 Uses the user defined norm as the norm type.

Algorithms for Calculating the Norm

This node calculates the norm according to the following equations.

Norm type Algorithm
1-norm $‖x‖=|{x}_{0}|+|{x}_{1}|+...+|{x}_{n-1}|$
2-norm $‖x‖=\sqrt{\left({|{x}_{0}|}^{2}+{|{x}_{1}|}^{2}+...+{|{x}_{n-1}|}^{2}\right)}$
Inf-norm $‖x‖={\mathrm{max}}_{i}\left(|{x}_{i}|\right)$
-Inf-norm $‖x‖={\mathrm{min}}_{i}\left(|{x}_{i}|\right)$
User Defined $‖x‖={\left({|{x}_{0}|}^{y}+{|{x}_{1}|}^{y}+\dots +{|{x}_{n-1}|}^{y}\right)}^{\frac{1}{y}}$

where

• x is the input vector
• y is the input user defined norm
• ||x|| is the norm

Default: 2-norm

## user defined norm

Norm type that you specify.

If norm type is User Defined, this node uses user defined norm as the norm type.

This input must be nonzero.

Default: -1

## error in

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Default: No error

## norm

The norm of the input vector.

## error out

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported

Web Server: Not supported in VIs that run in a web application