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

weight -- Hamming weight of a list

Synopsis

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

Ways to use weight :

For the programmer

The object weight is a method function.

Menu

Related functions