Skip to content

Commit 5bddda4

Browse files
committed
convert ipiv to selection vector
1 parent bdc4418 commit 5bddda4

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

lu.ijs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,11 @@ for_i. i. d do. NB. for each ring
1818
y =. col (<remvec;i)} y NB. store the current column into the array as L; leave U unchanged
1919
y =. (((<remvec;remvec) { y) - col */ (<i;remvec) { y) (<remvec;remvec)} y NB. subtract (current column */ (}.first row)) from lower-right block
2020
end.
21-
pv;y
22-
)
21+
NB. convert ipiv to selection vector
22+
z=. i.#pv
23+
for_i. i.-#pv do.
24+
t=. i{z
25+
z=. t (i{pv)} ((i{pv){z) i}z
26+
end.
27+
z;y
28+
)

manifest.ijs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ DESCRIPTION=: 0 : 0
66
J LU code, called from 128!:10
77
)
88

9-
VERSION=: '1.0.3'
9+
VERSION=: '1.0.4'
1010

1111
FILES=: 0 : 0
1212
lu.ijs

0 commit comments

Comments
 (0)