Looks like Lippu's solution may not generalize:

   ]hermy=. (([: <: [: +: 0 ?@$~ ,~) j. [: <: [: +: 0 ?@$~ ,~) 3
_0.771524j0.930188 _0.801744j0.329038 _0.650518j_0.830576
 0.892523j_0.58658 0.0113443j0.681753   0.552033j0.183426
_0.385276j0.260412 _0.475036j0.982381 0.0801071j_0.557168

   ishermitian (+>/~@i.@#"_*|:@:+) hermy         NB. From Lippu
0
   ishermitian ((% 1 + =@i.@#)@:++@|:) hermy     NB. From Raul
1



On Tue, Jan 15, 2013 at 1:31 PM, km <k...@math.uh.edu> wrote:

> This is very neat, Raul.  Thanks.
>
> Kip Murray
>
> Sent from my iPad
>
>
> On Jan 15, 2013, at 7:12 AM, Raul Miller <rauldmil...@gmail.com> wrote:
>
> > It's easy because isHermitian is so close to what you need for hft.
> > In other words, hft=: -:@+ |: almost works, but it should only reduce
> > the diagonal by half, not the rest of it.  hft=: (% 1 + =@i.@#)@:+
> > +@|:  is more complicated but structurally similar.
> >
> > FYI,
> >
> > --
> > Raul
> >
> > On Tue, Jan 15, 2013 at 8:05 AM, Aai <agroeneveld...@gmail.com> wrote:
> >> Why is it easy? From the point of view of a mathematician perhaps. I
> just
> >> experimented towards the desired result.
> >>
> >>   ishermitian ((]+[*~:) +@|:) A
> >> 1
> >>   ishermitian (+ +@|: * >/~@i.@#) A
> >> 1
> >>
> >>
> >>
> >> On 15-01-13 11:25, km wrote:
> >>>
> >>> This is an easy one.  A Hermitian matrix matches its conjugate
> transpose.
> >>> Write a verb hft that creates a Hermitian matrix from a triangular one
> that
> >>> has a real diagonal.
> >>>
> >>>     ishermitian =: -: +@|:
> >>>     ]A =: 2 2 $ 1 2j3 0 4
> >>>  1 2j3
> >>>  0   4
> >>>     ]B =: hft A
> >>>     1 2j3
> >>>  2j_3   4
> >>>     ishermitian A
> >>>  0
> >>>     ishermitian B
> >>>  1
> >>>
> >>> Kip Murray
> >>>
> >>> Sent from my iPad
> >>> ----------------------------------------------------------------------
> >>> For information about J forums seehttp://www.jsoftware.com/forums.htm
> >>
> >>
> >> --
> >> Met vriendelijke groet,
> >> @@i = Arie Groeneveld
> >>
> >>
> >> ----------------------------------------------------------------------
> >> For information about J forums see 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
>



-- 
Devon McCormick, CFA
^me^ at acm.
org is my
preferred e-mail
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to