SAGE = $(shell which sage)
check:
- PYTHONPATH="." $(SAGE) -t --timeout=0 --long --exitfirst mjo/
+ PYTHONPATH="." $(SAGE) -t --timeout=0 --memlimit=0 --long --exitfirst mjo/
clean:
find ./ -type f -name '*.pyc' -delete
find ./ -type d -name '__pycache__' -delete
# The theory says that only the first "r" coefficients are
# nonzero, and they actually live in the original polynomial
- # ring and not the fraction field. We negate them because
- # in the actual characteristic polynomial, they get moved
- # to the other side where x^r lives.
- return -A_rref.solve_right(E*b).change_ring(R)[:r]
+ # ring and not the fraction field. We negate them because in
+ # the actual characteristic polynomial, they get moved to the
+ # other side where x^r lives. We don't bother to trim A_rref
+ # down to a square matrix and solve the resulting system,
+ # because the upper-left r-by-r portion of A_rref is
+ # guaranteed to be the identity matrix, so e.g.
+ #
+ # A_rref.solve_right(Y)
+ #
+ # would just be returning Y.
+ return (-E*b)[:r].change_ring(R)
@cached_method
def rank(self):
sage: set_random_seed() # long time
sage: J = random_eja() # long time
- sage: caches = J.rank() # long time
+ sage: cached = J.rank() # long time
sage: J.rank.clear_cache() # long time
sage: J.rank() == cached # long time
True