[Tutor] Matrix class problems

Prahlad Vaidyanathan slime@vsnl.net
Mon, 1 Jul 2002 22:02:14 +0530


Hi,

    Firstly, Thanks to everyone for clearing my question on what repr()
does. since the matrix class, in my case, actually represents a list of
lists, I have just done this :

"""
    def __repr__ (self) :
        return repr(self.matrix)
"""

on mon, 01 jul 2002 christopher smith spewed into the ether:
[-- snippity --]
> try defining the __rmul__ method which is called whenever an 

    Thanks ! I discovered that *just* after I sent my mail yesterday.
I also discovered a whole bunch of other operators, some of which I
never knew existed ( __inverse__() for one :-)

[-- snippity --]
> >ps. for those of you who study maths, i have been racking my brains as
> >to how to get the determinant of a matrix, and have been unsuccessful.
> >
> >how do i find the minor matrix ? aaaarggghhh !!
> 
> when i was on that rack my kind math teacher reminded me 
> that by reducing the matrix to an upper diagonal form through the 
> swapping, multiplying, and adding rows together the determinant is 
> found as the product of the diagonal.

    Hmm ... this is something I realise I need to make finding the rank
of the matrix easier as well. Will have to look into it.

> You can find such algorithms in Gauss elimination routines.

    OK, I will look for algorithms.

    Meanwhile, for those who might be interested, I have put up my
initial stab at this module here :

    http://www.symonds.net/~prahladv/files/matrix.py

    There is a whole lot on the TODO list of the class yet ...

pv.
-- 
Prahlad Vaidyanathan  <http://www.symonds.net/~prahladv/>

Before marriage the three little words are "I love you," after marriage
they are "Let's eat out."