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

Vectors
Life is a mystery to be lived.
Not a problem to be solved.
Søren Kierkegaard.
< Add | Subtract | Multiply >
  • [; \underline{u}=\underline{v}-\underline{w};]
  • [; u[i]=v[i]-w[i], \quad i \in R(n);]
Python Listing: Vector.3.py.
    #Binary: u=v-w
    def __sub__(v,w):
        u=Vector(v)
        for i in range(len(v)):
            u[i]-=w[i]
        
        return u

    #Unary: u-=v. Superflous?
    def __isub__(v,w):
        return v-w
< Add | Subtract | Multiply >
Messages:
0 secs.