Skip to content

Commit 276d4d5

Browse files
committed
add separate nVCol index
1 parent 5b7a074 commit 276d4d5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/PDL/MatrixOps.pd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ pp_def("svd",
659659
Pars => 'a(n,m);
660660
[o]u(nUCol=CALC(PDLMIN($SIZE(m),$SIZE(n))),m);
661661
[o]s(nSV=CALC(PDLMIN($SIZE(m),$SIZE(n))));
662-
[o]v(nUCol,n);
662+
[o]v(nVCol=CALC(PDLMIN($SIZE(m),$SIZE(n))),n);
663663
[t]w(wcols=CALC(($SIZE(m) >= $SIZE(n)) ? 0 : $SIZE(m)),n);',
664664
GenericTypes => ['D'],
665665
CHeader => 'void SVD(double *U, double *V, double *Z, int nRow, int nCol);',
@@ -675,7 +675,7 @@ broadcastloop %{
675675
$P(s), PDLMAX($SIZE(n),$SIZE(m)), $SIZE(nUCol));
676676
loop (nSV) %{ $s() = sqrt($s()); %}
677677
if (is_transpose)
678-
loop (n,nUCol) %{ $v() = $w(wcols=>nUCol); %}
678+
loop (n,nVCol) %{ $v() = $w(wcols=>nVCol); %}
679679
loop (m,nUCol) %{ $u() /= $s(nSV=>nUCol); %}
680680
%}
681681
EOF

0 commit comments

Comments
 (0)