next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
Macaulay2Doc :: VirtualTally

VirtualTally

Description

The only difference between this class and Tally is that this class allows negative numbers.
i1 : x = tally {a,b,b,c,c,c}

o1 = Tally{a => 1}
           b => 2
           c => 3

o1 : Tally
i2 : y = tally {a,a,a,b,b,c}

o2 = Tally{a => 3}
           b => 2
           c => 1

o2 : Tally
i3 : x' = new VirtualTally from x

o3 = VirtualTally{a => 1}
                  b => 2
                  c => 3

o3 : VirtualTally
i4 : y' = new VirtualTally from y

o4 = VirtualTally{a => 3}
                  b => 2
                  c => 1

o4 : VirtualTally
i5 : x-y

o5 = Tally{c => 2}

o5 : Tally
i6 : x'-y'

o6 = VirtualTally{a => -2}
                  c => 2

o6 : VirtualTally

See also

Types of virtual tally :

Functions and methods returning a virtual tally :

Methods that use a virtual tally :

For the programmer

The object VirtualTally is a type, with ancestor classes HashTable < Thing.