norm

AnsVec.norm(nrmtype='nrm2')

Matrix or vector norm.

Parameters

nrmtype (str, optional) –

Mathematical norm to use. One of:

  • 'NRM2': L2 (Euclidean or SRSS) norm (default).

  • 'NRM1': L1 (absolute sum) norm (vectors only).

  • 'NRMINF' Maximum norm.

Returns

nrm (float) – Norm of the matrix or vector(s).

Examples

>>> mm = mapdl.math
>>> dim = 1000
>>> m2 = mm.rand(dim, dim)
>>> nrm = mm.norm( m2)