i1 : leadComponent vector{0,0,1,0,1} o1 = 4 |
i2 : leadComponent vector{0,0,1,2,3,4,0} o2 = 5 |
i3 : leadComponent matrix{{0,0,1}, {0,1,0}, {1,0,0}} o3 = {2, 1, 0} o3 : List |
Leading appears to be a bit of a misnomer here, since the index/indices return are the last, not the first, corresponding to nonzero elements.
This command also works with vectors and matrices that contain polynomial ring elements.
i4 : R = ZZ/5[a,b,c]; leadComponent vector{a*b^2,3*b*c^3,0} o5 = 1 |
The object leadComponent is a method function.