Skip to content

Commit b185675

Browse files
author
Auggie Marignier
committed
make dot products a bit more readable
1 parent 1a81b64 commit b185675

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/test/python/test_axisym_adjoints.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from functools import partial
22

3-
from pys2let import
43
import numpy as np
54
from pytest import approx, fixture, mark
65

@@ -71,4 +70,9 @@ def test_axisym_adjoint(
7170
y = wav2px(y_wav, y_scal, B, L, J_min)
7271
x_wav, x_scal = px2wav(x, B, L, J_min)
7372

74-
assert y_wav.conj().T @ x_wav + y_scal.conj() @ x_scal == approx(y.conj().T @ x)
73+
# y'Ax
74+
yAx = y_wav.conj().T @ x_wav + y_scal.conj() @ x_scal
75+
# (A'y)'x
76+
Ayx = approx(y.conj().T @ x)
77+
78+
assert yAx == Ayx

src/test/python/test_directional_harmonic.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,9 @@ def test_axisym_adjoint(
5858
y = wav2px(y_wav, y_scal, B, L, J_min)
5959
x_wav, x_scal = px2wav(x, B, L, J_min)
6060

61-
assert y_wav.conj().T @ x_wav + y_scal.conj() @ x_scal == approx(y.conj().T @ x)
61+
# y'Ax
62+
yAx = y_wav.conj().T @ x_wav + y_scal.conj() @ x_scal
63+
# (A'y)'x
64+
Ayx = approx(y.conj().T @ x)
65+
66+
assert yAx == Ayx

0 commit comments

Comments
 (0)