After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 680511 - new mdiag and mantidiag functions
new mdiag and mantidiag functions
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: Analytics
git master
Other Linux
: Normal enhancement
: ---
Assigned To: Morten Welinder
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2012-07-24 09:37 UTC by Frédéric Parrenin
Modified: 2012-07-26 17:32 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Frédéric Parrenin 2012-07-24 09:37:47 UTC
It would be helpful to create two new functions:
- mdiag(Vector): create a diagonal matrix with the Vector components as its diagonal
- mantidiag(Vector): same for an antidiagonal matrix (in this case we have to decide if we fill the first row or the first column at first).
Comment 1 Andreas J. Guelzow 2012-07-24 14:22:44 UTC
mdiag(A1:A5) == =munit(5)*array(A1:A5)
Comment 2 Frédéric Parrenin 2012-07-24 14:25:19 UTC
OK, thanks.
This leaves left the anti-diag problem, though.
Comment 3 Andreas J. Guelzow 2012-07-24 17:31:20 UTC
IMHO, rather than a mantidiag with at most very limited usage, functions vflip and hflip that flip an array vertically or horizontally and can be used to construct an mantidiag would be much more useful.
Comment 4 Frédéric Parrenin 2012-07-24 17:55:05 UTC
You are right.
Comment 5 Andreas J. Guelzow 2012-07-26 17:32:03 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.

I have added a FLIP function. Then 

mdiag(A1:A5) == munit(5)*array(A1:A5)

mantidiag(A1:A5) == flip(munit(5)*array(A1:A5))
or
mantidiag(A1:A5) == flip(munit(5)*array(A1:A5), FALSE)

depending on whether the values in A1:A5 should run bottom-left to top-right or top-right to bottom-left.