Skip to content

Commit

Permalink
more resilient secondary cone
Browse files Browse the repository at this point in the history
star_origin doesn't always seem to be 0 if not 4d
  • Loading branch information
natemacfadden committed Dec 13, 2023
1 parent 5c2ebc9 commit 4626dd6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cytools/triangulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1618,9 +1618,10 @@ def secondary_cone(self,

if self.is_star():
# star triangulations all share 0th point, the origin
simps = [set(s) for s in self._simplices[:,1:]]
star_origin = self.points_to_indices([0]*self.dim())
simps = [set(s)-{star_origin} for s in self._simplices]
dim = self.dim()-1
m[:,-1] = pts_ext[0]
m[:,-1] = pts_ext[star_origin]
else:
simps = [set(s) for s in self._simplices]
dim = self.dim()
Expand Down Expand Up @@ -1656,14 +1657,14 @@ def secondary_cone(self,
for i,pt in enumerate(diff_pts): full_v[pt] = v[i]
for i,pt in enumerate(comm_pts): full_v[pt] = v[i+2]
if self.is_star():
full_v[0] = v[-1]
full_v[star_origin] = v[-1]

null_vecs.add(tuple(full_v))

for i,pt in enumerate(diff_pts): full_v[pt] = 0
for i,pt in enumerate(comm_pts): full_v[pt] = 0
if self.is_star():
full_v[0] = v[-1]
full_v[star_origin] = v[-1]

self._secondary_cone[args_id] = Cone(hyperplanes=list(null_vecs),\
check=False)
Expand Down

0 comments on commit 4626dd6

Please sign in to comment.