Jump to content

Deconvolution/2D+: Difference between revisions

J: fill in some details
(Formatted D entry, not improved)
(J: fill in some details)
Line 517:
Actually it is a matter of setting up the linear equations and then solving them.
 
'''SolutionImplementation''': <lang j>deconv3 =: 4 : 0
sz =. x >:@-&$ y NB. shape of z
poi =. ,<"1 ($y) ,"0/&(,@i.) sz NB. pair of indexes
Line 525:
sz $ 1e_8 round ({:"1 %. }:"1) T1
)
round=: [ * <.@%~</lang>
h3 -: g3 deconv3 f3 NB. h3 matches g3 deconv3 f3
 
'''Data''': <lang j>h1=: _8 2 _9 _2 9 _8 _2
f1=: 6 _9 _7 _5
g1=: _48 84 _16 95 125 _70 7 29 54 10
 
h2=: ".;._2]0 :0
_8 1 _7 _2 _9 4
4 5 _5 2 7 _1
_6 _3 _3 _6 9 5
)
 
f2=: ".;._2]0 :0
_5 2 _2 _6 _7
9 7 _6 5 _7
1 _1 9 2 _7
5 9 _9 2 _5
_8 5 _2 8 5
)
 
g2=: ".;._2]0 :0
40 _21 53 42 105 1 87 60 39 _28
_92 _64 19 _167 _71 _47 128 _109 40 _21
58 85 _93 37 101 _14 5 37 _76 _56
_90 _135 60 _125 68 53 223 4 _36 _48
78 16 7 _199 156 _162 29 28 _103 _10
_62 _89 69 _61 66 193 _61 71 _8 _30
48 _6 21 _9 _150 _22 _56 32 85 25
)
 
h3=: ".;._1;._2]0 :0
/ _6 _8 _5 9/ _7 9 _6 _8/ 2 _7 9 8
/ 7 4 4 _6/ 9 9 4 _4/ _3 7 _2 _3
)
 
f3=: ".;._1;._2]0 :0
/ _9 5 _8/ 3 5 1
/ _1 _7 2/ _5 _6 6
/ 8 5 8/_2 _6 _4
)
 
g3=: ".;._2;._1]0 :0
/ 54 42 53 _42 85 _72
45 _170 94 _36 48 73
_39 65 _112 _16 _78 _72
6 _11 _6 62 49 8
/ _57 49 _23 52 _135 66
_23 127 _58 _5 _118 64
87 _16 121 23 _41 _12
_19 29 35 _148 _11 45
/ _55 _147 _146 _31 55 60
_88 _45 _28 46 _26 _144
_12 _107 _34 150 249 66
11 _15 _34 27 _78 _50
/ 56 67 108 4 2 _48
58 67 89 32 32 _8
_42 _31 _103 _30 _23 _8
6 4 _26 _10 26 12
)</lang>
 
'''Tests''': <lang j> h1 -: g1 deconv3 f1
1
h2 -: g2 deconv3 f2
1
h3 -: g3 deconv3 f3 NB. h3-: matcheschecks g3for deconv3matching f3structure and data
1</lang>
 
6,962

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.