| 1 | initial version |
Another option:
sage: V = QQ^10
sage: d = 0
sage: while dim(V) > 0:
....: for x in V: # iterate through all elements of V
....: if x: # until you find a nonzero element
....: break
....: d += 1
....: V = V / V.span([x])
....:
sage: d
3
| 2 | No.2 Revision |
Another option:
sage: V = QQ^10
sage: d = 0
sage: while dim(V) > 0:
....: for x in V: # iterate through all elements of V
....: if x: # until you find a nonzero element
....: break
....: d += 1
....: V = V / V.span([x])
....:
sage: d
3
10
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.