Skip to content

Commit

Permalink
fix data dimension evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-louvet committed Oct 1, 2020
1 parent 767275f commit d357c47
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion generate_data_dimension.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ def newBettiNumbers(self, *args, **kwargs):
ball[e] = True
betti = [0 for _ in range(self.dimension)]
for i in range(len(centers)):
if ball[i] != 0:
if not ball[i]:
betti[compDim[i]] += 1
else:
betti[0] += 1
Expand Down
16 changes: 5 additions & 11 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,11 @@


def independent(x, S):
import sympy as sp
mat = []
for i in range(len(S[0])):
temp = []
for j in range(len(S)):
temp.append(S[j][i])
temp.append(x[i])
mat.append(temp)
mat = sp.Matrix(mat)
res = mat.columnspace()
return len(res) == len(S) + 1
import numpy as np
mat = S.copy()
mat.append(x)
rank = np.linalg.matrix_rank(mat)
return rank == len(mat[0])


def findPointStructDimension(pointList):
Expand Down

0 comments on commit d357c47

Please sign in to comment.