viff

changeset 588:7c14124ca29e

Removed trailing whitespace.
author Martin Geisler <mg@daimi.au.dk>
date Thu, 20 Mar 2008 00:02:34 +0100
parents bc6db28e18d0
children b1397f54a28c
files viff/matrix.py
diffstat 1 files changed, 10 insertions(+), 10 deletions(-) [+]
line diff
     1.1 --- a/viff/matrix.py	Wed Mar 19 23:29:38 2008 +0100
     1.2 +++ b/viff/matrix.py	Thu Mar 20 00:02:34 2008 +0100
     1.3 @@ -66,7 +66,7 @@
     1.4          """Allows matrix entry assignment using C{[,]}.
     1.5  
     1.6          The assignment works as follows:
     1.7 -        
     1.8 +
     1.9          >>> M = Matrix(2, 2)
    1.10          >>> M[0, 1] = 42
    1.11          >>> print M
    1.12 @@ -83,7 +83,7 @@
    1.13          """Allows matrix entry access using C{[, ]}.
    1.14  
    1.15          The access works as follows:
    1.16 -        
    1.17 +
    1.18          >>> M = Matrix([[1, 2], [3, 4]])
    1.19          >>> print M[1,1]
    1.20          4
    1.21 @@ -121,7 +121,7 @@
    1.22                  for j in range(0, self.n):
    1.23                      result[i, j] = self[i, j] + other
    1.24              return result
    1.25 -        
    1.26 +
    1.27          result = Matrix(self.m, self.n)
    1.28          for i in range(0, self.m):
    1.29              for j in range(0, self.n):
    1.30 @@ -143,7 +143,7 @@
    1.31              for j in range(0, self.n):
    1.32                  result[i, j] = other + self[i, j]
    1.33          return result
    1.34 -        
    1.35 +
    1.36      def __mul__(self, other):
    1.37          """Matrix multiplication.
    1.38  
    1.39 @@ -171,7 +171,7 @@
    1.40          @param other: The matrix or element to multiply with this one.
    1.41          @return: The product.
    1.42          """
    1.43 -        
    1.44 +
    1.45          if not isinstance(other, Matrix):
    1.46              result = Matrix(self.m, self.n)
    1.47              for i in range(0, self.m):
    1.48 @@ -183,7 +183,7 @@
    1.49          if self.n != other.m:
    1.50              raise ValueError('Matrix dimensions do not match for '
    1.51                               'multiplication')
    1.52 -            
    1.53 +
    1.54          result = Matrix(self.m, other.n)
    1.55          for i in range(0, self.m):
    1.56              for j in range(0, other.n):
    1.57 @@ -249,15 +249,15 @@
    1.58  
    1.59      def determinant(mat):
    1.60          """Calculates the determinant of a matrix.
    1.61 -        
    1.62 +
    1.63          @param mat: A square matrix.
    1.64          @return: The determinant of the matrix.
    1.65          """
    1.66          if mat.m == 1:
    1.67              return mat[0, 0]
    1.68          if mat.m == 2:
    1.69 -            return mat[0, 0] * mat[1,1] - mat[1, 0] * mat[0, 1]
    1.70 -        
    1.71 +            return mat[0, 0] * mat[1, 1] - mat[1, 0] * mat[0, 1]
    1.72 +
    1.73          sum = 0
    1.74          for k in range(mat.m):
    1.75              sub = Matrix(mat.m-1, mat.n-1)
    1.76 @@ -269,7 +269,7 @@
    1.77                      sub[i-1, j-1] = mat[i, j]
    1.78              sum += mat[k, 0] * (-1)**k * sub.determinant()
    1.79          return sum
    1.80 -                        
    1.81 +
    1.82  def hyper(n, field):
    1.83      """Makes a hyper-invertible square matrix.
    1.84