Deconvolution/1D: Difference between revisions

m
→‎{{header|REXX}}: simplified the REXX program, used (more) unique variables.
(→‎{{header|REXX}}: added the REXX computer programming language.)
m (→‎{{header|REXX}}: simplified the REXX program, used (more) unique variables.)
Line 1,105:
exit /*stick a fork in it, we're all done. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
deco@: parse arg $1,$2,$R r; b=@.$2.# + 1; a=@.$1.# + 1 /*obtainget thesizes arguments.of array 1&2*/
f#=@.$2r.?#=a - b + 1; g#=@.$1.? + 1 /*get size of arrayreturn 1&2array. */
@.$R.?=g# - f# do n=0 to a-b /*sizedefine of return array. */
do @.$r.n=0@.$1.n to g#-f# /*define RETURN return arrayelement. */
@.$R.n=@.$1.if n<b then L=0 /*define RETURNthe variable elementL.*/
if n<f# then L=0 else L=n - b + 1 /*define the variable L." " " " */
if n>0 then do j=L to else L=n - f# + 1; _=n-j /*define elements > " " " 0. " */
if n>0 then do i=L to @.$r.n=@.$r.n -1; @.$r.j * @.$2._ /*compute " _=n-i /*define" elements" > 0. */
@.$R.n=@.$R.nend - @.$R.i /*j*/ @.$2._ /*compute " " " /* [↑] subtract product.*/
@.$r.n=@.$r.n / @.$2.0 end /*i*/ /*divide [↑]array subtract productelement. */
@.$R.n=@.$R.nend / @.$2.0 /*n*/; /*divide array element. */return
end /*n*/; return
/*──────────────────────────────────────────────────────────────────────────────────────*/
make@: parse arg $,z; @.$.?#=words(z) - 1 /*obtain args; set size.*/
do jk=0 to @.$.?#; @.$.jk=word(z,jk+1) /*define array element. */
end /*jk*/; return return /*array starts at unity.*/
/*──────────────────────────────────────────────────────────────────────────────────────*/
show@: parse arg $,z,_; do js=0 to @.$.? #; _=strip(_ @.$.s) /*obtain the arguments. */
_=strip(_end /*s*/ @.$.j) /*create array[↑] list. build the list. */
say 'array' $": "_; end /*j*/ return /* [↑] buildshow the list.; return*/
say 'array' $": "_; return /*show the list; return*/
/*──────────────────────────────────────────────────────────────────────────────────────*/
test@: parse arg $1,$2; do jt=0 to max(@.$1.?#, @.$2.?#) /*obtain the arguments. */
if @.$1.jt=@.$2.jt then iterate /*create array list. */
say "***error*** arrays" $1 ' and ' $2 "aren't equal."
end /*jt*/; return /* [↑] build the list. */</lang>
{{out|output|text=&nbsp; when using the default internal inputs:}}
<pre>