Skip to content

Commit 3b179e8

Browse files
committed
add keyword-based transform
1 parent 1ac24a0 commit 3b179e8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/stats/test_pca.fypp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,16 @@ contains
6161
call check(error, all(abs(x_trans(:, 2)) < ${k1}$tol), "pca_${k1}$ transform")
6262
if (allocated(error)) return
6363

64+
! Test Inverse Transform (must run before the no-mean transform overwrites x_trans)
65+
call pca_inverse_transform(x_trans, components, mu, x_inv)
66+
call check(error, all(abs(x_inv - x) < ${k1}$tol), "pca_${k1}$ inverse")
67+
if (allocated(error)) return
68+
6469
! Test Transform without x_mean (keyword-based call)
6570
call pca_transform(x, components, x_transformed=x_trans)
6671
call check(error, size(x_trans, 1) == 3 .and. size(x_trans, 2) == 2, "pca_${k1}$ transform_no_mean shape")
6772
if (allocated(error)) return
6873

69-
! Test Inverse Transform
70-
call pca_inverse_transform(x_trans, components, mu, x_inv)
71-
call check(error, all(abs(x_inv - x) < ${k1}$tol), "pca_${k1}$ inverse")
72-
if (allocated(error)) return
73-
7474
! Test EIG method
7575
call pca(x, components, s, method="eig", err=err)
7676
call check(error, err%ok(), "pca_${k1}$ eig err")

0 commit comments

Comments
 (0)