Skip to content

Commit

Permalink
Fixed error in eigenvector calculation when full=True.
Browse files Browse the repository at this point in the history
  • Loading branch information
Skielex committed Sep 22, 2020
1 parent 50cff7a commit 25e71dc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -4,7 +4,7 @@
long_description = fh.read()

setup(name="structure-tensor",
version="0.1.0",
version="0.1.1",
author="Niels Jeppesen",
author_email="niejep@dtu.dk",
description="Fast and simple to use 2D and 3D structure tensor implementation for Python.",
Expand Down
2 changes: 1 addition & 1 deletion structure_tensor/cp/st3dcp.py
Expand Up @@ -248,7 +248,7 @@ def eig_special_3d(S, full=False):
# Normalizing -- depends on number of vectors.
if full:
# vec is [x1 x2 x3, y1 y2 y3, z1 z2 z3]
l = np.sum(np.square(vec), axis=0, out=vec_tmp)
l = np.sum(np.square(vec), axis=0, out=vec_tmp)[:, np.newaxis]
vec = np.swapaxes(vec, 0, 1)
else:
# vec is [x1 y1 z1] = v1
Expand Down
2 changes: 1 addition & 1 deletion structure_tensor/st3d.py
Expand Up @@ -245,7 +245,7 @@ def eig_special_3d(S, full=False):
# Normalizing -- depends on number of vectors.
if full:
# vec is [x1 x2 x3, y1 y2 y3, z1 z2 z3]
l = np.einsum('ijk,ijk->jk', vec, vec, out=vec_tmp)
l = np.einsum('ijk,ijk->jk', vec, vec, out=vec_tmp)[:, np.newaxis]
vec = np.swapaxes(vec, 0, 1)
else:
# vec is [x1 y1 z1] = v1
Expand Down

0 comments on commit 25e71dc

Please sign in to comment.