Beispiel #1
0
 def m(self, b):
     return Matrix(self.array * asarray(b))
Beispiel #2
0
 def asarray(self, t=None):
     if t is None:
         return self.array
     else:
         return asarray(self.array, t)
Beispiel #3
0
 def __setitem__(self, index, value):
     value = asarray(value, self._typecode)
     if multiply.reduce(value.shape) == 1:
         value = value[0, 0]
     self.array[index] = value
Beispiel #4
0
 def __setslice__(self, i, j, value):
     self.array[i:j] = asarray(squeeze(value), self._typecode)
Beispiel #5
0
 def __rmul__(self, other):
     aother = asarray(other)
     if len(aother.shape) == 0:
         return self._rc(aother*self.array)
     else:
         return self._rc(dot(aother, self.array))
Beispiel #6
0
 def __imul__(self, other):
     aother = asarray(other)
     self.array = dot(self.array, aother)
     return self
Beispiel #7
0
 def asarray(self,t=None):
     if t is None:
         return self.array
     else:
         return asarray(self.array,t)
Beispiel #8
0
 def __setitem__(self, index, value):
     value = asarray(value, self._typecode)
     self.array[index] = squeeze(value)
Beispiel #9
0
    def __setslice__(self, i, j, value): self.array[i:j] = asarray(squeeze(value),self._typecode)

    def __float__(self):
Beispiel #10
0
 def m(self,b):
     return Matrix(self.array * asarray(b))
Beispiel #11
0
 def __setitem__(self, index, value):
     value = asarray(value, self._typecode)
     self.array[index] = squeeze(value)
Beispiel #12
0
 def __imul__(self,other):
     aother = asarray(other)
     self.array = dot(self.array, aother)
     return self
Beispiel #13
0
 def __setitem__(self, index, value):
     value = asarray(value, self._typecode)
     if multiply.reduce(value.shape) == 1:
         value = value[0,0]
     self.array[index] = value
Beispiel #14
0
 def __mul__(self, other):
     aother = asarray(other)
     if len(aother.shape) == 0:
         return self._rc(self.array * aother)
     else:
         return self._rc(dot(self.array, aother))
Beispiel #15
0
 def __mul__(self, other):
     aother = asarray(other)
     if len(aother.shape) == 0:
         return self._rc(self.array*aother)
     else:
         return self._rc(dot(self.array, aother))
Beispiel #16
0
 def __rmul__(self, other):
     aother = asarray(other)
     if len(aother.shape) == 0:
         return self._rc(aother * self.array)
     else:
         return self._rc(dot(aother, self.array))
Beispiel #17
0
import string