Skip to content

Commit

Permalink
[tests] test15_vec_ref : test both col/row major
Browse files Browse the repository at this point in the history
[tests] test15_vec_ref : test different row step sizes
  • Loading branch information
ManifoldFR committed Aug 20, 2024
1 parent 1d5e039 commit 73a5d40
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/test_eigen.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,11 +378,15 @@ def test14_single_element():

@needs_numpy_and_eigen
@pytest.mark.parametrize(("n1", "n2"), [(4, 2), (6, 3), (8, 2)])
def test15_vec_ref(n1, n2):
np.set_printoptions(precision=4, linewidth=200)
@pytest.mark.parametrize("rowStep", (1, 2))
@pytest.mark.parametrize("col_major", (False, True))
def test15_vec_ref(n1, n2, rowStep, colMajor):
np.set_printoptions(precision=5, linewidth=200)
np.random.seed(42)
a = np.random.randn(n1, 8)
a = np.asfortranarray(a) # column-major
if colMajor:
a = np.asfortranarray(a) # column-major
a = a[::rowStep, :]
s1 = a[:n2]
s2 = a[n2:]
print("INPUT VALUES AND STRIDES:")
Expand Down

0 comments on commit 73a5d40

Please sign in to comment.