T Wow, that woke me up this morning. All I did was replace u@v with
-:@*:
u=: -:
v=: *:
Y=:_2 + 0.5 * i.9
f=: 13 :'(] ; [:|:u@v d._2 _1 0 1 2 )y'
g=: 13 :'(] ; [:|:-:@*: d._2 _1 0 1 2) y'
(f Y)-:g Y
1
5!:4 <'f'
-- ]
+- ;
--+ -- [:
│ +- |:
L---+ -- u
│ -- @ ---------+- v
L- d. -+- _2 _1 0 1 2
5!:4 <'g'
-- ]
+- ;
│ -- [:
│ +- |:
--+ │ -- 0 0 0 0 1r24
│ │ -- & -+- p.
│ │ +- ,
│ │ │ -- 0 0 0 1r6
L---+ ----+ -- & ----------+- p.
│ │ │ +- ,
│ │ │ │ -- -:
│ │ L-----+ -- @ -------+- *:
│ │ │ +- ,
L- " -+ L--------------+ -- [
│ │ +- ,
│ L-----------+ -- 1
│ L- " -+- 0
L- 0
f
] ; [: |: u@v d._2 _1 0 1 2
g
] ; [: |: (0 0 0 0 1r24&p. , 0 0 0 1r6&p. , -:@*: , [ , 1"0)"0
Can you write and explicit version that will produce the tacit version of g
?
Linda
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Linda Alvord
Sent: Monday, January 14, 2013 3:30 AM
To: [email protected]
Subject: Re: [Jprogramming] atop continues to puzzle me
Maybe a function and it's derivative would be helpful, too. Linda
-----Original Message-----
From: <mailto:[email protected]>
[email protected]
[ <mailto:[email protected]>
mailto:[email protected]] On Behalf Of Linda Alvord
Sent: Monday, January 14, 2013 3:11 AM
To: <mailto:[email protected]> [email protected]
Subject: Re: [Jprogramming] atop continues to puzzle me
Jose, Here's a simper version. Using the aspect ratio helps make the
derivative more obvious. I use Chrome and I don't know how this will look
elsewhere.
Load 'plot'
u=: -:
v=: *:
Y=:_2 + 0.5 * i.9
f=: 13 :'(] ; [:|:u@v d._2 _1 0 1 2 )y'
f
plot f Y
'aspect 1'plot f Y
Linda
-----Original Message-----
From: <mailto:[email protected]>
[email protected]
[ <mailto:[email protected]>
mailto:[email protected]] On Behalf Of Linda Alvord
Sent: Sunday, January 13, 2013 9:21 PM
To: <mailto:[email protected]> [email protected]
Subject: Re: [Jprogramming] atop continues to puzzle me
load'plot'
u=: -:
v=: *:
Y=: _2 + 0.01 * i.401
f=: 13 :'(] ; [:|:u@v d._2 _1 0 1 2 )y'
f
] ; [: |: u@v d._2 _1 0 1 2
plot f Y
If this is in a jijs and then run, it will shw the graph you expect bu t
it will provide a long J error message in a separate window. I don't know
how to prevent it.
Also, maybe when u@v can be replaced by ([:u v)"v that will work also.
Linda
-----Original Message-----
From: <mailto:[email protected]>
[email protected]
[ <mailto:[email protected]>
mailto:[email protected]] On Behalf Of Jose Mario
Quintana
Sent: Sunday, January 13, 2013 5:17 PM
To: <mailto:[email protected]> [email protected]
Subject: Re: [Jprogramming] atop continues to puzzle me
To Raul:
> I have no idea what "works reasonably well" means.
That is a very subjective statement, apparently one can make use of
(@) and (@:) within the scope of (d.) but, of course, that depends on one's
point of view.
> But consider also:
>
> AT=: 2 :0
> u@v"v
> )
>
> +:AT*: d. 1
> 0 4x&p."0 0 0
> +:@*: d. 1
> 0 4x&p.
This also happens for (at) and I was trying to point it out this difference
in my first message:
"
> Rather works almost exactly?
>
> ('*'"_) @ ((+: @ *:) (d.1)) (0 1 2)
> *
> ('*'"_) @ ((+: at *:) (d.1)) (0 1 2)
> ***
>
> ((+: @ *:) (d.1)) b.0
> _ _ _
> ((+: at *:) (d.1)) b.0
> 0 0 0
"
However, (d.) also treats differently (at) and (AT)! (See below.)
>
> In both cases the rank of the left argument of d. is the same. So what
> we see here is that the rank of the result of d. depends on something
> other than the rank of its arguments. Have you found any documentation
> that describes the rank of the results of the d.
> conjunction?
No, hence the words "seems arbitrary" in
> and (@:) works reasonably well, although the rank change from 0 to _
> seems arbitrary, but it stumbles for (at) and ([:),
To Linda:
> Jose, I'm working on your plot program and I found a ray of hope...
Raul's (AT), unlike (at), does the job of plotting the functions:
plot @: (] ; |: @: ((u AT v) d. _2 _1 0 1 2)) Y
although in a different fashion, at least for the fixed version according to
the interpreter:
plot @: (] ; |: @: ((u AT v)f. d. _2 _1 0 1 2)) Y
plot @: (] ; |: @: ((u @ v)f. d. _2 _1 0 1 2)) Y
(u AT v)f. d. _2 _1 0 1 2
(0 0 0 0 1r24&p."0 0 0 , 0 0 0 1r6&p."0 0 0 , -:@*:"0 0 0 , ["0 0 0 ,
1"0"0 0 0)"0
(u @ v)f. d. _2 _1 0 1 2
(0 0 0 0 1r24&p. , 0 0 0 1r6&p. , -:@*: , [ , 1"0)"0
Although so far it has not been confirmed, there is plenty of evidence that
(d.) attracted some bugs; Raul's (at) and ([:) do not work well in this
context but they should have worked.
It seems to me that you would like to use (2 : '([: u v)"v') instead of (@)
because the former is more clear to you. But I would like to second Henri's
advice, if you understand (2 : '([: u v)"v') then you understand (@). Why
would you like then to use a long hand, so to speak, instead of a short hand
(besides, as this thread shows, (@) is more reliable)? Similar comments,
but to lesser extent, apply to ([:) vs. (@:).
________________________________________________________________________
On Sun, Jan 13, 2013 at 12:06 PM, Raul Miller <
<mailto:[email protected]> [email protected]> wrote:
> On Sun, Jan 13, 2013 at 10:26 AM, Linda Alvord
> < <mailto:[email protected]> [email protected]>
wrote:
>> It seems to need d."0 but I can't seem to figure how to do it.
>
> You can use "0 on the result of d. For example:
>
> (d. 1) (" 0)
>
> I do not think you should have to do this, but it works.
>
> --
> 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>
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>
http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm