Karim Belabas on Thu, 03 Jun 2010 22:52:34 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: gsqrt on matrices


* Sam Steingold [2010-06-03 21:21]:
> is gsqrt supposed to work on matrices?

Yes, but as for all "transcendental" functions, this only applies the
function componentwise, to all matrix entries. I perÑonly dislike this
semantic because 

0) I see no real use for it for t_MAT arguments (t_VECs are a different
story : the construction is useful there).

1) even then, we have a nice alternative with

  apply(sqrt, [1,2;3,4]);

  apply(x->x^2, [1,2;3,4]);  \\ same in anonymous form

(testing branch only)

2) it prevents us from defining standard useful functions on the set of
square matrices. Such as the one you expected.


But it has been with us since the beginning...

    K.B.
--
Karim Belabas, IMB (UMR 5251)  Tel: (+33) (0)5 40 00 26 17
Universite Bordeaux 1          Fax: (+33) (0)5 40 00 69 50
351, cours de la Liberation    http://www.math.u-bordeaux.fr/~belabas/
F-33405 Talence (France)       http://pari.math.u-bordeaux.fr/  [PARI/GP]
`