Monday, 25 May 2015

On galleries and the beginning of summer

After the community bonding period and before starting today the coding period, I will briefly list the transformation that has undergone my initial proposal: from just implementing new algorithms and then add them to GNU Octave, to various modifications of GNU Octave itself so that Higham's toolboxes run smoothly and in the end add the new algorithms. Sticking to what I said before, I expect to be doing the modifications (e.g. new bugs, patches, toolboxes) most of the first half of the coding period. From there we aim to go as far as we can about matrix functions, I will do so. These changes are noted in the new time line.
During the community bonding period I have been setting up, you might have seen me at freenode. I have been becoming more and more acquainted with GNU Octave, and found out that the gallery function was broken, with unassigned variables and missing auxiliary functions. This function will prove useful to test matrix functions, because the eigenvalue decomposition strategy (if $A=VDV^{-1}$  then $f\left(A\right) = V f\left( D \right) V^{-1}$) yields a big error using the ill conditioned matrices gallery provides. Another example are the useful positive definite matrices that have a computable principal p-th root. gallery is indeed interesting for anyone looking for a matrix with a special characteristic to test an edge case of a function.
Besides, I also have had the chance to see a plethora of Matlab-style short circuit operators, looping with infinite ranges, and even weird undocumented functions like superiorfloat (it returns either "single" or "double" strings depending on the input). What let CarnĂ« to point me to Undocumented Matlab blog, where they document its unsupported hidden underbelly. More quirks (and their solutions) on the next post. 
A final thank goes to The Project in general and my mentors (CarnĂ« and Mario) in particular for this opportunity. I hope everyone pleasantly codes their summer away!

Wednesday, 6 May 2015

GSoC 2015 - Matrix Functions in GNU Octave

A brief intro

First of all, let me introduce myself: I am Antonio Pino Robles—an Electronic Engineering student from the Basque Country—and I will be improving matrix functions in GNU Octave this summer, following Google Summer of Code program.
The idea behind this is quite simple: given a square matrix $M\in \mathbb{C}^{n \times n}$ and a function $f$, GNU Octave will compute $f\left(M\right)$. You may think of them as an extension to scalar functions, i.e. starting from $f:\mathbb{C}\rightarrow \mathbb{C}$ compute $f:\mathbb{C}^{n \times n}\rightarrow \mathbb{C}^{n \times n}$. Their implementation is quite different, though. (Check Golub and van Loan's book[0] and the Short Course by Higham and Lin[1] for further info.)
Let me note that matrix functions are already part of octave: expm, logmsqrtm in octave itself and funm,  trigonometric and hyperbolic matrix functions in the Linear-Algebra Octave-Forge package. There are also GPLed toolboxes by Nicholas J. Higham, namely the mctoolbox[2] and the mftoolbox[3]; furthermore, GPLed software from the NAMF group—led by N. J. Higham at The University of Manchester—is available as well.
Hence, on a first part octave will be modified in order to run the toolboxes—as they are—smoothly , and then the existing implementations will be improved by means of updating their algorithms.
Finally, for a more detailed description of the project please refer to my octave-wiki page:

Agur bero bat!

[0] G.H. Golub and C.F. Van Loan. Matrix Computations, 4th Edition. The Johns Hopkins University Press, Baltimore, USA, 2013.
[1] Nicholas J. Higham and Lin Lijing, Matrix Functions: A Short Course, preprint, (2013).
[2] N. J. Higham. The Matrix Computation Toolbox.
[3] N. J. Higham. The Matrix Function Toolbox.