Damien Robert on Fri, 07 Sep 2012 14:01:48 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

matdet regression


This comes from the Sage Mailing List:
https://groups.google.com/forum/?fromgroups=#!topic/sage-devel/uneXpZnRs-U

  G = graphs.OddGraph(4)
  M=G.kirchhoff_matrix()
  M.subdivide(1,1)
  M2 = M.subdivision(1,1)
  time M2._det_pari(1) #classical Gaussian elimination
  -> 0sec
  time M2._det_pari(0) #Gauss-Bareiss
  -> 8 minutes

Interestingly enough, when I try it on Sage 4.7 both versions are
instantaneous. It is only starting with Sage 4.8 that the regression happens.

The matrix is the following one:
m2=[\
 4,1,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0;\
-1,4,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0;\
 0,0,4,0,0,0,1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0;\
 0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1;\
 0,0,0,0,4,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,0,0;\
 0,0,0,0,0,4,0,0,0,0,0,0,0,1,0,1,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0;\
 0,0,1,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1;\
-1,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,1;\
-1,0,0,0,0,0,0,0,4,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0;\
 0,1,0,0,1,0,0,0,0,4,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,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