applyToCoefficients applies the function h to the coefficients of the divisor of D1. Specifying the CoeffType=>ZZ, CoeffType=>QQ, CoeffType=>RR, will force the output divisor to be of a certain form (WeilDivisor, QWeilDivisor, RWeilDivisor respectively), otherwise the class of the output D is the same as the class of the input D1 (WeilDivisor, QWeilDivisor, RWeilDivisor, BasicDivisor). If Unsafe is set to false (the default is true), then the function will check to make sure the output is really a valid divisor.
i1 : R = QQ[x, y, z]; |
i2 : D = divisor(x*y^2/z) o2 = -Div(z) + 2*Div(y) + Div(x) o2 : WeilDivisor on R |
i3 : applyToCoefficients(D, u->5*u) o3 = -5*Div(z) + 10*Div(y) + 5*Div(x) o3 : WeilDivisor on R |