next | previous | forward | backward | up | top | index | toc | Macaulay2 website
Divisor :: getPrimeCount

getPrimeCount -- get the number of height-one primes in the support of the divisor

Synopsis

Description

This function returns the number of height one prime ideals corresponding to the components of a BasicDivisor. Note that if you don't call cleanSupport, this can return primes with coefficient equal to zero.

i1 : R = QQ[x,y,u,v]/ideal(x*y-u*v);
i2 : D = divisor(x)

o2 = Div(v, x) + Div(u, x)

o2 : WeilDivisor on R
i3 : getPrimeCount(D)

o3 = 2
i4 : E = divisor(x*u)

o4 = Div(v, x) + Div(u, y) + 2*Div(u, x)

o4 : WeilDivisor on R
i5 : getPrimeCount(E)

o5 = 3
i6 : F = divisor({0}, {ideal(x,u)})

o6 = 0*Div(x, u)

o6 : WeilDivisor on R
i7 : getPrimeCount(F)

o7 = 1
i8 : getPrimeCount(cleanSupport F)

o8 = 0
i9 : getPrimeCount(1*F)

o9 = 0

This is equivalent to #primes.

See also

Ways to use getPrimeCount :

For the programmer

The object getPrimeCount is a method function.