Some hints about  _ 

   h=: 13 :';x ([:<(,"1}.)"1#~(((= {:)~ {:) |.)"1)"1 y'
   A h B
|length error: h
|   A     h B


Try  b.
  
  h b. 0
_ _ _
   
This doesn't help:
   
   h=:    13 :';x ([:<(,"1}.)"1#~(((= {:)~ {:) |.)"1)"1 _ _ _ y'
   h
4 : ';x ([:<(,"1}.)"1#~(((= {:)~ {:) |.)"1)"1 _ _ _ y'
   A h B
|length error: h
|   ;x    ([:<(,"1}.)"1#~(((={:)~{:)|.)"1)"1 _ _ _ y
   
But this does:

   h=:    13 :';x ([:<(,"1}.)"1#~(((= {:)~ {:) |.)"1)"1 _ y'
   h
[: ; ([: < (,"1 }.)"1 #~ (((= {:)~ {:) |.)"1)"1 _
   A h B
0 1 2 0 1 2 0 1
0 1 2 0 1 2 0 1
2 0 1 2 0 1 2 0
2 0 1 2 0 1 2 0
1 2 0 1 2 0 1 2
   
Linda

-----Original Message-----
From: programming-boun...@forums.jsoftware.com
[mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Linda Alvord
Sent: Saturday, October 20, 2012 2:12 AM
To: programm...@jsoftware.com
Subject: Re: [Jprogramming] stitching matrices

Here's a problem that bothers me about this example before I leave it.

 

First establish that  =&{:  and  [:={:  are identical and compare tree and
boxed versions:

 

 

    ]'A B'=:3|L:0(([:<i.)"1)3 5,:5 4

----------T-------┐
│0 1 2 0 1│0 1 2 0│
│2 0 1 2 0│1 2 0 1│
│1 2 0 1 2│2 0 1 2│
│         │0 1 2 0│
│         │1 2 0 1│
L---------+--------

   f=:=&{:

   g=:[:={:

   5!:4 <'f'

      -- =
-- & -+- {:

   5!:4 <'g'

  -- [:
--+- =
  L- {:

   B

0 1 2 0
1 2 0 1
2 0 1 2
0 1 2 0
1 2 0 1

   f B

1 0 0 1
0 1 0 0
0 0 1 0

   g B

1 0 0 1
0 1 0 0
0 0 1 0

 

Now look at two "trees":    

 

   elm=: 13 :'((=&{:)|.)"1 y'

   oak=: 13 :'(([:={:)|.)"1 y'

   5!:4 <'elm'

                -- = 
          -- & -+- {:
      ----+- |.      
-- " -+- 1           

   5!:4 <'oak'

               -- [:
          -----+- = 
      ----+    L- {:
-- " -+   L- |.     
      L- 1          

   5!:2 <'elm'

--------------T-T-┐
│---------T--┐│"│1│
││--T-T--┐│|.││ │ │
│││=│&│{:││  ││ │ │
││L-+-+---│  ││ │ │
│L--------+---│ │ │
L-------------+-+--

   5!:2 <'oak'

---------------T-T-┐
│----------T--┐│"│1│
││---T-T--┐│|.││ │ │
│││[:│=│{:││  ││ │ │
││L--+-+---│  ││ │ │
│L---------+---│ │ │
L--------------+-+--

   B

0 1 2 0
1 2 0 1
2 0 1 2
0 1 2 0
1 2 0 1

   elm B

1 1 1 1 1

   oak B

ran with error:
|domain error: oak
|       oak B
|[-16] c:\users\owner\j701-user\temp\42.ijs

   

I'm not troubled by the fact that these results are different. I am bothered
that their differences do not appear in the tree and boxed version, because
I expect them both to be elm trees!

 

If these versions don't show any differences shouldn't the results agree.  I
think the tree versions must be missing some way to tell them apart.

 

Any thoughts?

 

Linda

 

Linda

 

 

 

-----Original Message-----

From:  <mailto:programming-boun...@forums.jsoftware.com>
programming-boun...@forums.jsoftware.com

[ <mailto: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:  <mailto:programm...@jsoftware.com> programm...@jsoftware.com

Subject: Re: [Jprogramming] stitching matrices

 

On Fri, Oct 19, 2012 at 4:00 AM, Linda Alvord <
<mailto:lindaalv...@verizon.net> 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>
http://www.jsoftware.com/forums.htm

 

----------------------------------------------------------------------

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

----------------------------------------------------------------------
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