The best I have is
(, $~ _2 {.!.1 $)
which is longer but sort of pretty anyway. I really feel like I should be able 
to write it as
_2&({.!.1)&.$
but this is nonsense.

Well, I guess you could define an adverb meaning what I want &.$ to mean:
dotoshape=. 1 :', $~ u@:$'

Which makes , equivalent to
*/ dotoshape

Not really that bad of an idea...

Marshall

________________________________________
From: programming-boun...@jsoftware.com [programming-boun...@jsoftware.com] On 
Behalf Of Zsbán Ambrus [amb...@math.bme.hu]
Sent: Monday, September 20, 2010 8:46 AM
To: Programming forum
Subject: Re: [Jprogramming] Orthogonal projection to row space of matrix

On Mon, Sep 20, 2010 at 1:25 PM, Zsbán Ambrus <amb...@math.bme.hu> wrote:
>   ve ([-[:{.[:((],~[-[:+/+/ .*~*(%+/&:*:"1)@]),:^:(2>#...@$))/,) sp

As a subquestion to the above, what's the idiomatic monad which takes
a noun of rank either 1 or 2 and upgrades it to rank 2 by prepending
an axis if necessary.  I use (,:^:(2>#...@$)) above but that's a bit
ugly.  ((i.0 0)&,) is another solution, but there might be something
even simpler.

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