Opened 9 years ago

Closed 9 years ago

#10943 closed defect (fixed)

Domain subdivision bugs in FanMorphism

Reported by: novoselt Owned by: novoselt
Priority: major Milestone: sage-4.7.1
Component: geometry Keywords:
Cc: vbraun Merged in: sage-4.7.1.alpha1
Authors: Andrey Novoseltsev Reviewers: Volker Braun
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by vbraun)

For example:

sage: Sigma = Fan(rays=[(1,1,0), (1,-1,0)], cones=[(0,1)])
sage: Sigma_prime = FaceFan(lattice_polytope.octahedron(3))
sage: FanMorphism(identity_matrix(3), Sigma, Sigma_prime, subdivide=True, verbose=True)
Placing ray images... 0.841 ms
Computing chambers... 0.806 ms
Subdividing cone 1 of 1... 0.172 ms
Checking for missing pieces... 
Traceback (most recent call last):
...
IndexError: list assignment index out of range

The problem is that the source cone intersects four target ones, but there are only two different intersections.

Another issue:

sage: sigma = Cone([(0,1), (3,1)])
sage: Sigma = Fan([sigma])
sage: Sigma_s = Sigma.subdivide([(1,1), (2,1)])
sage: FanMorphism(identity_matrix(2), Sigma, Sigma_s, subdivide=True)
Traceback (most recent call last):
...
ValueError: morphism defined by
[1 0]
[0 1]
does not map
Rational polyhedral fan in 2-d lattice N
into the support of
Rational polyhedral fan in 2-d lattice N!

Here the problem is that one of the "chambers" is in the interior of the domain cone and none of its rays are in the chamber. The fix is to stop being very smart and honestly check intersections with all chambers.

While working on fixes, I have also adjusted verbose printing to make it more informative.

Apply trac_10943_subdivision_bugs_in_fan_morphism.patch only!

Attachments (2)

trac_10943_fan_morphism_non_full_dim_fan.patch (3.2 KB) - added by novoselt 9 years ago.
trac_10943_subdivision_bugs_in_fan_morphism.patch (6.9 KB) - added by novoselt 9 years ago.
Apply this patch only

Download all attachments as: .zip

Change History (8)

Changed 9 years ago by novoselt

comment:1 Changed 9 years ago by novoselt

  • Cc vbraun added
  • Status changed from new to needs_review

OK, I rewrote related code to make it a little more clear, but basically I just added check for repeated intersections.

comment:2 Changed 9 years ago by novoselt

  • Description modified (diff)
  • Owner changed from mhampton to novoselt
  • Summary changed from Fan morphism fails on not full-dimensional fans to Domain subdivision bugs in FanMorphism

Changed 9 years ago by novoselt

Apply this patch only

comment:3 Changed 9 years ago by vbraun

  • Description modified (diff)
  • Reviewers set to Volker Braun
  • Status changed from needs_review to positive_review

Looks good!

comment:4 Changed 9 years ago by vbraun

  • Description modified (diff)

comment:5 Changed 9 years ago by jdemeyer

  • Milestone changed from sage-4.7 to sage-4.7.1

comment:6 Changed 9 years ago by jdemeyer

  • Merged in set to sage-4.7.1.alpha1
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.