Macaulay2 » Documentation
Packages » CodingTheory » LinearCode » weight
next | previous | forward | backward | up | index | toc

weight -- Hamming weight of a list

Description

Computes the Hamming weight of a list L, which is the number of its non-zero entries.

i1 : weight({1,0,1,0,1})

o1 = 3
i2 : weight({0,123,48,0,256})

o2 = 3

Menu

Related functions

Ways to use weight:

  • weight(BasicList)

For the programmer

The object weight is a method function.


The source of this document is in /build/reproducible-path/macaulay2-1.25.05+ds/M2/Macaulay2/packages/CodingTheory.m2:3082:0.