norm ( k -- x )

Factor handbook » The language » Numbers » Vector operations » Vector arithmetic

Factor handbook » The language » Numbers » Vector operations » Vector arithmetic

Prev: | l1-norm ( k -- x ) |

Next: | l-infinity-norm ( k -- x ) |

Vocabulary

math.vectors

Inputs

Outputs

Generic word contract

Computes the norm (size) of k in 𝑙₂ (L^2) vector space, usually written ∥･∥₂.

Notes

This is generally the "default norm", and when referring to an unqualified norm, so it is an alias for the l2-norm implementation.

Examples

See also

norm-sq, l1-norm, l-infinity-norm, p-norm

Definition

math.vectors

Inputs

k | a sequence |

Outputs

x | a non-negative real number |

Generic word contract

Computes the norm (size) of k in 𝑙₂ (L^2) vector space, usually written ∥･∥₂.

Notes

This is generally the "default norm", and when referring to an unqualified norm, so it is an alias for the l2-norm implementation.

Examples

USING: math.vectors math.functions prettyprint ;
{ 1 2 3 4 } norm 5.4772255 10e-8 ~ .

t

t

See also

norm-sq, l1-norm, l-infinity-norm, p-norm

Definition

This documentation was generated offline from a
`load-all`

image. If you want, you can also
browse the documentation from within the UI developer tools. See
the Factor website
for more information.

Factor 0.100 x86.64 (2240, heads/master-adff5af2b7, Sep 20 2023 21:16:03)