Thanks, Noel. I'll look it over.<br><br>I'm also more inclined toward using a uniform representation for arrays of arbitrary dimensionality - as you did. <br><br>I would use numpy's idea of 'broadcasting' to unify the shape of the arrays to solve some of the latter problems:<br>
<br><div style="margin-left: 40px;">"... the first rule of broadcasting is that if all input arrays do not have the same number of dimensions, then a '1' will be repeatedly pre-pended to the shapes of the smaller arrays until all the arrays have the same number of dimensions. The second rule of broadcasting ensures that arrays with a size of 1 along a particular dimension act as if they had the size of the array with the largest shape along that dimension. The value of the array element is assumed to be the same along the dimension for the "broadcasted" array. After the application of the broadcasting rules, the sizes of the arrays must match." ... from the Guide to NumPy<br>
<br></div>Doug<br><br><div class="gmail_quote">On Sun, Mar 2, 2008 at 5:47 AM, Noel Welsh <<a href="mailto:noelwelsh@gmail.com">noelwelsh@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Sun, Mar 2, 2008 at 3:32 AM, Doug Williams<br>
<<a href="mailto:m.douglas.williams@gmail.com">m.douglas.williams@gmail.com</a>> wrote:<br>
> Any ideas, etc would be welcome. One thing I don't currently have in the<br>
> science collection - and which is critical to the basic structure - is a<br>
> good matrix representation/manipulation module. I've implemented some for<br>
> specific analyses I am doing, but they are very inefficient and not nearly<br>
> as convenient as what numpy provides for Python. If anyone can point me to<br>
> some good implementations, or provide some ideas, it would be appreciated.<br>
<br>
</div>Attached is what I have been using for my projects. It builds on Will<br>
Farr's plt-linalg package (which builds on BLAS and LAPACK) and<br>
provides more functions and compact notation. Vectors and matrices<br>
are distinct types in this package, and there is no support for arrays<br>
with dimension greater than 2.<br>
<br>
My first version of this library used a uniform representation for<br>
arrays of arbitrary dimension. I found this less convenient for my<br>
task than specialising to vectors and matrices. The key problem in<br>
designing such a library is deciding how to satisfy users who want a<br>
general compact container type (i.e. arrays of arbitrary dimension)<br>
and users who want a linear algebra package. For example, do the<br>
linear algebra operators work with vectors? If so, how are row and<br>
column vectors distinguished?<br>
<br>
HTH,<br>
<font color="#888888">Noel<br>
</font></blockquote></div><br>