From 6b3eb20e7c805149aabfd4ec82cb202d3084e533 Mon Sep 17 00:00:00 2001 From: Ed J Date: Fri, 20 Dec 2024 07:58:54 +0000 Subject: [PATCH] preserve input type in _to_diagonal - https://github.com/PDLPorters/pdl/issues/511 --- lib/PDL/IO/Touchstone.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/PDL/IO/Touchstone.pm b/lib/PDL/IO/Touchstone.pm index 3f8d2ec..74a39a1 100644 --- a/lib/PDL/IO/Touchstone.pm +++ b/lib/PDL/IO/Touchstone.pm @@ -1308,7 +1308,7 @@ sub _to_diagonal if (!@dims || (@dims == 1 && $dims[0] == 1)) { - $ret = zeroes($n_ports,$n_ports); + $ret = zeroes($v->type,$n_ports,$n_ports); $ret->diagonal(0,1) .= $v; } elsif (@dims == 1 && $dims[0] == $n_ports)