SmtC: Show me the Code
Ole Peter Smith
Instituto de Matemática e Estatística
Universidade Federal de Goiás
http://www.olesmith.com.br

Matrices
O dia que bosta valesse ouro.
Os pobres todos nascerão sem c*.
Grafitti.
< Área de Desenho | Construtor | Print >

Construtor de Matrices

Python Listing: ../../Code/Matrix.py.
    def __init__(self,A,j=None):
        ## Matrix creator: allocates and/or initializes
        if (A):
            if (A.__class__.__name__=='int'):
                #Just allocate
                if (not j): j=A
                for i in range(A):
                     
            elif (A.__class__.__name__ in [ 'Matrix' ] ):
                #Copy content!
                for i in range( len(A) ):
                    self.append(Vector([]))
                    for j in range( len(A[i]) ):
                        self[i].append( 1.0*A[i][j] )
            else:
                print "Matrix.init: Invalid first argument type",A,"'"+A.__class__.__name__+"'"
                exit()
                
< Área de Desenho | Construtor | Print >
Messages:
0 secs.