Wow!  That keep me busy for a week.  Thanks.

Linda

-----Original Message-----
From: programming-boun...@forums.jsoftware.com
[mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Raul Miller
Sent: Friday, October 19, 2012 9:30 AM
To: programm...@jsoftware.com
Subject: Re: [Jprogramming] stitching matrices

On Fri, Oct 19, 2012 at 4:00 AM, Linda Alvord <lindaalv...@verizon.net>
wrote:
>    G B
> 1 1 1 1 1
>    H B
> ran with error:
> |domain error: H
> |       H B
> |[-30] c:\users\owner\j701-user\temp\37.ijs
>
> G WORKS!  H DOESN'T!
>
> How can I write the function  H  without & and get 1 1 1 1  ?

Here's G B
   ((=&{:)|.)"1 $~&5 4 i.3
1 1 1 1 1

Here, I rephrase G by eliminating the &
   (({:@[ = {:@])|.)"1 $~&5 4 i.3
1 1 1 1 1

Note that I am testing the result at each step, here, to make sure I've not
made any bad assumptions (for example, hypothetically speaking some
intermediate results in these kinds of transformations might need some
explicit treatment of rank).

Here, I further rephrase G by also eliminating both of the @ conjunctions
   ((([: {: [) = ([: {: ]))|.)"1 $~&5 4 i.3
1 1 1 1 1

Here, I simplify slightly by using a hook
   (((([: {: [) = ]) {:)|.)"1 $~&5 4 i.3
1 1 1 1 1

Here, I simplify again by using a cross hook
   (((= {:)~ {:) |.)"1 $~&5 4 i.3
1 1 1 1 1

Good enough?

Thanks,

--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to