Macaulay2 » Documentation
Packages » Macaulay2Doc » The Macaulay2 language » Thing » Number » InexactNumber » norm
next | previous | forward | backward | up | index | toc

norm -- l^p norm

Description

By default, the $\ell^\infty$ norm giving the maximum absolute entry is returned.

i1 : printingPrecision = 2

o1 = 2
i2 : R = RR_100

o2 = RR
       100

o2 : RealField
i3 : M = 10*random(R^3,R^10)

o3 = | 2   5.6 1.9 4.1 3.5 2.6 6.1 5.3 .83 .44 |
     | 2   3.7 4.1 6.1 4.7 1.2 9   7.4 .95 1.5 |
     | 7.4 1.5 4.3 3.4 6.9 6   9.5 10  4.8 8   |

                 3          10
o3 : Matrix RR     <-- RR
              100        100
i4 : norm M

o4 = 9.952219758672894287555632834552

o4 : RR (of precision 100)
i5 : norm_(numeric_20 infinity) M

o5 = 9.952225

o5 : RR (of precision 20)
i6 : norm {3/2,4,-5}

o6 = 5

o6 : QQ

For finite $p$, the $\ell^p$ norm $$\|M\|_p = \left(\sum_{i,j} |M_{ij}|^p\right)^{1/p}$$ is returned. For example, when $p = 2$, this is the Frobenius norm.

i7 : M = matrix {{3, 4}, {12, 84}}

o7 = | 3  4  |
     | 12 84 |

              2       2
o7 : Matrix ZZ  <-- ZZ
i8 : norm_2 M

o8 = 85

o8 : RR (of precision 53)

The norm of a polynomial is the norm of the vector of its coefficients.

i9 : RR[x]

o9 = RR  [x]
       53

o9 : PolynomialRing
i10 : (1+x)^5

       5     4      3      2
o10 = x  + 5x  + 10x  + 10x  + 5x + 1

o10 : RR  [x]
        53
i11 : norm oo

o11 = 10

o11 : RR (of precision 53)

Ways to use norm:

  • norm(List)
  • norm(Matrix)
  • norm(MutableMatrix)
  • norm(Number)
  • norm(Number,List)
  • norm(Number,Matrix)
  • norm(Number,MutableMatrix)
  • norm(Number,Number)
  • norm(Number,RingElement)
  • norm(Number,Vector)
  • norm(RingElement)
  • norm(Vector)

For the programmer

The object norm is a method function.


The source of this document is in /build/reproducible-path/macaulay2-1.26.05+ds/M2/Macaulay2/packages/Macaulay2Doc/ov_analytic_functions.m2:589:0.