Skip to content

Commit c6c8829

Browse files
philippeitisJoseph Weston
authored andcommitted
Update triangulation.py
Update with black formatted code.
1 parent 412907d commit c6c8829

1 file changed

Lines changed: 19 additions & 5 deletions

File tree

adaptive/learner/triangulation.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,35 @@
44
from math import factorial
55
import scipy.spatial
66

7-
from numpy import square, zeros, subtract, array, ones, dot, asarray, concatenate, average, eye, mean, abs, sqrt
7+
from numpy import (
8+
square,
9+
zeros,
10+
subtract,
11+
array,
12+
ones,
13+
dot,
14+
asarray,
15+
concatenate,
16+
average,
17+
eye,
18+
mean,
19+
abs,
20+
sqrt,
21+
)
822
from numpy import sum as nsum
923
from numpy.linalg import det as ndet
1024
from numpy.linalg import slogdet, solve, matrix_rank, norm
1125

1226

1327
def fast_norm(v):
1428
""" Manually take the vector norm for len 2, 3 vectors. Defaults to a square root of the dot product
15-
for larger vectors.
16-
17-
Note that for large vectors, it is possible for integer overflow to occur.
29+
for larger vectors.
30+
31+
Note that for large vectors, it is possible for integer overflow to occur.
1832
For instance:
1933
vec = [49024, 59454, 12599, -63721, 18517, 27961]
2034
dot(vec, vec) = -1602973744
21-
35+
2236
"""
2337
len_v = len(v)
2438
# notice this method can be even more optimised

0 commit comments

Comments
 (0)