[SciPy-user] NumPy matrix-vector calculation

Dinesh B Vadhia dineshbvadhia@hotmail....
Tue Oct 2 11:18:42 CDT 2007


Hello!  I am an experienced software engineer but relatively new to Python, NumPy and SciPy.  I'll say up front that I've have scanned all the pertinent documentation including the paid-for NumPy book but not found an answer to our problem(s):

We have an MxN (M not equal to N) integer matrix A.  The data for A is read-in from a file on persistant storage and the data is immutable (ie. does not change and cannot be changed).

The vector x is a vector of size Nx1.  The data elements of x are calculated during the program execution.

We then perform a matrix-vector calculation ie. y = Ax, where the resulting y is a Mx1 vector.

Both x and y are then discarded and a new x and y are calculated and this continues until program execution stops but at all times the matrix A remains the same until ...

Under certain circumstances, we may have to increase the size of M to M+R leaving N alone ie. append R rows to the end of matrix A.  We would want to do this while the program is executing.

Here are the questions:

- What NumPy array structure do we use for A - an array or matrix (and why)?
- If A is a matrix data structure then do the x and y vectors have to be matrix structures too or can you mix the data structures?
- If A is a matrix or an array structure, can we append rows during program execution and if so, how do we do this?

Any help towards these questions will be gratefully appreciated.  Thank-you 

Dinesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/scipy-user/attachments/20071002/6f1cbb61/attachment.html 


More information about the SciPy-user mailing list