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
Somos todos Condenados à Liberdade
Jean Paul Sartre
< Vetores | Matrices Básicas | Operações Algébricas >

Matrices Básicas

  • Matriz Zero:
    Python Listing: ../Matrix.py.
    def Matrix_Zero(m,n=0):
        if (n==0): n=m
        
        O=[]
        for i in range(m):
            O.append([])
            for j in range(n):
                O[i].append(0.0)
    
        return O
    
    
  • Identidade:
    Python Listing: ../Matrix.py.
    def Matrix_Identity(n):
        I=Matrix_Zero(n)
        for i in range(n):
            I[i][i]=1.0
    
        return I
    
    
  • Matriz de Vandermonte:
    Python Listing: ../Matrix.py.
    def Matrix_Vandermonte(v):
        V=[]
        for i in range( len(v) ):
            V.append([])
            
            fact=1.0
            for j in range( len(v) ):
                V[i].append(fact)
                fact*=v[i]
    
        return V
    
    
    
    
< Vetores | Matrices Básicas | Operações Algébricas >
Messages:
0 secs.