From f1794c3de4c738cb06161cdca61353198656da0a Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Thu, 21 Nov 2024 10:07:58 -0500 Subject: added rudimental tests for xpxp_to_xxpp and xxpp_to_xpxp functions --- xpxp_to_xxpp.m | 11 +++++++++++ xxpp_to_xpxp.m | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/xpxp_to_xxpp.m b/xpxp_to_xxpp.m index fc732e2..6191070 100644 --- a/xpxp_to_xxpp.m +++ b/xpxp_to_xxpp.m @@ -30,3 +30,14 @@ function S_permuted = xpxp_to_xxpp(S) end end +%!test +%! [X, Y]=meshgrid (1:4, 1:4); +%! Mxpxp=xxpp_to_xpxp(X); +%! assert(any(any(X != Mxpxp))); +%! Mxxpp=xpxp_to_xxpp(Mxpxp); +%! assert(X, Mxxpp) +%! Mxpxp=xxpp_to_xpxp(Y); +%! assert(any(any(Y != Mxpxp))); +%! Mxxpp=xpxp_to_xxpp(Mxpxp); +%! assert(Y, Mxxpp) + diff --git a/xxpp_to_xpxp.m b/xxpp_to_xpxp.m index d6efbe9..f77e954 100644 --- a/xxpp_to_xpxp.m +++ b/xxpp_to_xpxp.m @@ -28,3 +28,14 @@ function S_permuted = xxpp_to_xpxp(S) end end +%!test +%! [X, Y]=meshgrid (1:4, 1:4); +%! Mxpxp=xxpp_to_xpxp(X); +%! assert(any(any(X != Mxpxp))); +%! Mxxpp=xpxp_to_xxpp(Mxpxp); +%! assert(X, Mxxpp) +%! Mxpxp=xxpp_to_xpxp(Y); +%! assert(any(any(Y != Mxpxp))); +%! Mxxpp=xpxp_to_xxpp(Mxpxp); +%! assert(Y, Mxxpp) + -- cgit v1.2.3