# [PYTHON MATRIX-SIG] Standard Numerical Library

Carlos Fonseca Carlos Fonseca <fonseca@gaivota.demon.co.uk>
Sat, 10 Aug 1996 18:46:51 +0100 (BST)

```On Fri, 9 Aug 1996, Jim Hugunin wrote:

> Here are my plans for this library, please comment:
>
> 1) Based on LAPACK and FFTPACK FORTRAN libraries, but only using the
> subset available with the RLab distribution.  This is a very nice
> version of these libraries in C ...
> ... I'd distribute these packages as well for people without the
> "real" libraries on their machines.

Would it still be possible to use the "real" libraries? It would be nice

> 2) Implementing a bare minimum of functionality, in a simple, clean,
> unsophisticated way.
>
> ie. fft( (0,0,1,1) ) will just work.  No need to setup work areas, etc.

Will 1D functions like the fft (and also 2D functions) work transparently
on arbitrary multidimensional arrays, along user-specified axes? This
should be easier to implement efficiently in C than later in Python.

In genetic algorithms it is almost always necessary to evaluate cost
functions at a number of points at a time, which adds one dimension to
array containing the decision variables. In control engineering, these
could easily be matrices. Sometimes, the population is structured, which
adds another dimension. Having multidimensional arrays is a great way of
eliminating for-loops in the Python code and/or unnecessary reshaping of
the arrays prior to the computation.

This also raises the question of which axis/axes these functions should
use by default. I find it counter-intuitive that most functions (but not
all!) default to axis=0 whereas addition, multiplication, etc., match the
last dimensions of arrays of different depths. Personally, I would prefer
axis=-1 by default (but there may be a reason against this), or
axis=(-2,-1) for 2D functions (matrix inversion, etc).

> 3) Implementing the "basic" functions
>
> 1D FFT
> Matrix Inversion
> Matrix Eigenvalues

... and corresponding eigenvectors. I've seen at least one numerical
package which did not return them :-(

> Matrix Determinant
> Any requests?

* (Generalised) Cholesky decomposition of symmetric matrices would be very
useful to anybody dealing with covariance matrices (and I believe it is in

* Least-squares solution of over/under-determined systems of linear
equations a la A\b in Matlab.

I hope the above comments are useful... I am looking forward to trying out
the new release. Thanks!

Carlos Fonseca

=================
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org