Skip to content

Commit 10f927e

Browse files
committed
more error message
1 parent 8148d7c commit 10f927e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/regfans/fan.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,6 +1249,11 @@ def flip_linear(self,
12491249
# main loop
12501250
status = 1
12511251
while True:
1252+
if not all(sc_curr @ h_curr) > 0:
1253+
msg = f"Min dist of h_curr to hyperplanes = {min(sc_curr @ h_curr)}\n"
1254+
msg += "=> h_curr not in interior of sc_curr..."
1255+
raise Exception(msg)
1256+
12521257
# stop at a fan respecting the point configuration
12531258
if stop_at_pct:
12541259
is_pct = all(sc_curr @ np.ones(T_curr.size) >= 0)
@@ -1279,6 +1284,15 @@ def flip_linear(self,
12791284
# find the first wall that we hit
12801285
first_hit_ind, first_hit_dist = util.first_hit(h_curr, h_target, sc_curr)
12811286
if first_hit_ind is None:
1287+
ftmp = self.vc.triangulate(heights=h_target)
1288+
print(ftmp, T_curr)
1289+
print(ftmp == T_curr)
1290+
print(np.min(sc_curr@h_curr))
1291+
print(np.min(sc_curr@h_target))
1292+
print(np.min(ftmp.secondary_cone_hyperplanes()@h_curr))
1293+
print(np.min(ftmp.secondary_cone_hyperplanes()@h_target))
1294+
print("????")
1295+
12821296
msg = "first_hit_ind=None... should've been caught earlier... "
12831297
msg += f"min(H@h_curr)={np.min(sc_curr@h_curr)}; "
12841298
msg += f"min(H@h_target)={np.min(sc_curr@h_target)}...; "

0 commit comments

Comments
 (0)