next up previous contents
Next: Do we need a Up: Design and implementation issues Previous: Design and implementation issues   Contents

Vectors as matrices

There are very good reasons that vectors should be treated as 1 x n and $n\times1$ matrices:

The array type in NumPy behaves more like a diagonal matrix than ordinary vectors. Therefore we implement vectors as matrices instead.

However, it might be worthwhile to implement a Vector subclass for efficiency reasons. I do not know how to let Matrix(a) sometimes return a Vector depending on a.shape.



Huaiyu Zhu
2002-03-23