regfans 0.0.2__py3-none-any.whl → 0.0.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- regfans/fan.py +13 -13
- regfans/util.py +6 -7
- {regfans-0.0.2.dist-info → regfans-0.0.3.dist-info}/METADATA +1 -1
- regfans-0.0.3.dist-info/RECORD +10 -0
- regfans-0.0.2.dist-info/RECORD +0 -10
- {regfans-0.0.2.dist-info → regfans-0.0.3.dist-info}/WHEEL +0 -0
- {regfans-0.0.2.dist-info → regfans-0.0.3.dist-info}/licenses/LICENSE +0 -0
- {regfans-0.0.2.dist-info → regfans-0.0.3.dist-info}/top_level.txt +0 -0
regfans/fan.py
CHANGED
|
@@ -1205,7 +1205,7 @@ class Fan:
|
|
|
1205
1205
|
# get the initial triangulation + heights
|
|
1206
1206
|
T_curr = self
|
|
1207
1207
|
sc_curr = T_curr.secondary_cone_hyperplanes(via_circuits=True,
|
|
1208
|
-
verbosity
|
|
1208
|
+
verbosity=-1)
|
|
1209
1209
|
sc_curr = np.array(sc_curr)
|
|
1210
1210
|
|
|
1211
1211
|
if h_init is None:
|
|
@@ -1280,9 +1280,9 @@ class Fan:
|
|
|
1280
1280
|
first_hit_ind, first_hit_dist = util.first_hit(h_curr, h_target, sc_curr)
|
|
1281
1281
|
if first_hit_ind is None:
|
|
1282
1282
|
msg = "first_hit_ind=None... should've been caught earlier... "
|
|
1283
|
-
msg += f"min(H@h_curr)={np.min(
|
|
1284
|
-
msg += f"min(H@h_target)={np.min(
|
|
1285
|
-
msg += f"H={
|
|
1283
|
+
msg += f"min(H@h_curr)={np.min(sc_curr@h_curr)}; "
|
|
1284
|
+
msg += f"min(H@h_target)={np.min(sc_curr@h_target)}...; "
|
|
1285
|
+
msg += f"H={sc_curr.tolist()}, h_curr={h_curr.tolist()}, "
|
|
1286
1286
|
msg += f"h_target={h_target.tolist()}"
|
|
1287
1287
|
raise ValueError(msg)
|
|
1288
1288
|
|
|
@@ -1292,8 +1292,8 @@ class Fan:
|
|
|
1292
1292
|
verbosity=verbosity-1)
|
|
1293
1293
|
except:
|
|
1294
1294
|
print(sc_curr.shape, first_hit_ind)
|
|
1295
|
-
print('curr dists',
|
|
1296
|
-
print('target dists',
|
|
1295
|
+
print('curr dists', sc_curr@h_curr)
|
|
1296
|
+
print('target dists', sc_curr@h_target)
|
|
1297
1297
|
print('h_target',h_target)
|
|
1298
1298
|
raise ValueError()
|
|
1299
1299
|
|
|
@@ -1305,9 +1305,9 @@ class Fan:
|
|
|
1305
1305
|
h_curr = util.lerp(h_curr, h_target, 0.99*first_hit_dist)
|
|
1306
1306
|
|
|
1307
1307
|
# check that we can compute a next step
|
|
1308
|
-
dists =
|
|
1308
|
+
dists = sc_curr@h_tmp
|
|
1309
1309
|
n_i = np.argmin(dists)
|
|
1310
|
-
n =
|
|
1310
|
+
n = sc_curr[n_i]
|
|
1311
1311
|
if np.dot(n, h_tmp)>0:
|
|
1312
1312
|
h_curr = h_tmp
|
|
1313
1313
|
break
|
|
@@ -1318,9 +1318,9 @@ class Fan:
|
|
|
1318
1318
|
h_tmp = util.lerp(h_curr, h_target, 0.99*first_hit_dist)
|
|
1319
1319
|
|
|
1320
1320
|
# check that we can compute a next step
|
|
1321
|
-
dists =
|
|
1321
|
+
dists = sc_curr@h_tmp
|
|
1322
1322
|
n_i = np.argmin(dists)
|
|
1323
|
-
n =
|
|
1323
|
+
n = sc_curr[n_i]
|
|
1324
1324
|
if np.dot(n, h_tmp)>0:
|
|
1325
1325
|
h_curr = h_tmp
|
|
1326
1326
|
break
|
|
@@ -1361,14 +1361,14 @@ class Fan:
|
|
|
1361
1361
|
print("Inputs to first_hit: " + \
|
|
1362
1362
|
f"{h_curr.tolist(), h_target.tolist(), sc_curr}")
|
|
1363
1363
|
|
|
1364
|
-
dists =
|
|
1364
|
+
dists = sc_curr@util.lerp(h_curr, h_target, first_hit_dist)
|
|
1365
1365
|
i = np.argmin(dists)
|
|
1366
1366
|
print(f"dists[argmin] = {dists[i]}")
|
|
1367
|
-
print(f"H[argmin] = {
|
|
1367
|
+
print(f"H[argmin] = {sc_curr[i].tolist()}")
|
|
1368
1368
|
print(f"circ = {circ}")
|
|
1369
1369
|
|
|
1370
1370
|
sc_hyps = {tuple(n) for n in sc_curr}
|
|
1371
|
-
n = tuple(-
|
|
1371
|
+
n = tuple(-sc_curr[i])
|
|
1372
1372
|
print(f"n in sc_curr? = {n in sc_hyps}")
|
|
1373
1373
|
|
|
1374
1374
|
raise ValueError()
|
regfans/util.py
CHANGED
|
@@ -253,15 +253,14 @@ def is_solid(*, R: "ArrayLike"=None, H:"ArrayLike"=None) -> int:
|
|
|
253
253
|
assert (R is None) ^ (H is None)
|
|
254
254
|
|
|
255
255
|
if R is None:
|
|
256
|
-
|
|
256
|
+
# try to find a point in the strict interior
|
|
257
|
+
H = np.array(H)
|
|
258
|
+
return find_interior_point(H=H) is not None
|
|
257
259
|
else:
|
|
260
|
+
# know rays -> sum of rays sould be in strict interior
|
|
258
261
|
R = np.array(R)
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
if len(R) == 0:
|
|
262
|
-
return False
|
|
263
|
-
else:
|
|
264
|
-
return bool(np.linalg.matrix_rank(R.T) == R.shape[1])
|
|
262
|
+
H = np.array(dual_cone(R))
|
|
263
|
+
return np.all(H@R.sum(axis=0) > 0.5)
|
|
265
264
|
|
|
266
265
|
def contains(*,
|
|
267
266
|
p: "ArrayLike",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
regfans/__init__.py,sha256=ySoKB1J2jeUD9oHoPqD2d-utSO-cqd9eI1dq4Q2SMBo,103
|
|
2
|
+
regfans/circuits.py,sha256=5uLH8oQiAKe7UYl7sKvFpxMzNViP9tcLtqA91zbWduk,11244
|
|
3
|
+
regfans/fan.py,sha256=dHLaDy00Qq0tWas6237vxyY88UiIo-4_3R7V7JllpY8,64783
|
|
4
|
+
regfans/util.py,sha256=HdowruB_t37RWosu7XRVHjOdcxgyuxhR1YxdxUY1K94,12933
|
|
5
|
+
regfans/vectorconfig.py,sha256=VUZpyzUjuMy9QCR3SayMwOE7Q-ve5V610kwQTDbl39Q,40932
|
|
6
|
+
regfans-0.0.3.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
7
|
+
regfans-0.0.3.dist-info/METADATA,sha256=roRs3mohUPcBGDq358QHR26BlCO_EiZ-4OPdtEit8Rk,1154
|
|
8
|
+
regfans-0.0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
9
|
+
regfans-0.0.3.dist-info/top_level.txt,sha256=h_8B8JgprCNKyinFEG8XvWOLKDouj_vmktFOf6_7Q0Q,8
|
|
10
|
+
regfans-0.0.3.dist-info/RECORD,,
|
regfans-0.0.2.dist-info/RECORD
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
regfans/__init__.py,sha256=ySoKB1J2jeUD9oHoPqD2d-utSO-cqd9eI1dq4Q2SMBo,103
|
|
2
|
-
regfans/circuits.py,sha256=5uLH8oQiAKe7UYl7sKvFpxMzNViP9tcLtqA91zbWduk,11244
|
|
3
|
-
regfans/fan.py,sha256=F0pSwjM2QTjoI32ItCL7dPmtDBlYUN8b-YKNz4Kc2nY,64720
|
|
4
|
-
regfans/util.py,sha256=0CuUU32NjgnvYE64_oj1mVh0Eq7uOm7c018wCtzzS_w,12823
|
|
5
|
-
regfans/vectorconfig.py,sha256=VUZpyzUjuMy9QCR3SayMwOE7Q-ve5V610kwQTDbl39Q,40932
|
|
6
|
-
regfans-0.0.2.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
7
|
-
regfans-0.0.2.dist-info/METADATA,sha256=133ChifWVVTSF-jeRR6nexm0B-YW-6H0kMFOMf_kWJY,1154
|
|
8
|
-
regfans-0.0.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
9
|
-
regfans-0.0.2.dist-info/top_level.txt,sha256=h_8B8JgprCNKyinFEG8XvWOLKDouj_vmktFOf6_7Q0Q,8
|
|
10
|
-
regfans-0.0.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|