Exemple #1
0
 def m(self, b):
     return Matrix(self.array * asarray(b))
Exemple #2
0
 def asarray(self, t=None):
     if t is None:
         return self.array
     else:
         return asarray(self.array, t)
Exemple #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
Exemple #4
0
 def __setslice__(self, i, j, value):
     self.array[i:j] = asarray(squeeze(value), self._typecode)
Exemple #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))
Exemple #6
0
 def __imul__(self, other):
     aother = asarray(other)
     self.array = dot(self.array, aother)
     return self
Exemple #7
0
 def asarray(self,t=None):
     if t is None:
         return self.array
     else:
         return asarray(self.array,t)
Exemple #8
0
 def __setitem__(self, index, value):
     value = asarray(value, self._typecode)
     self.array[index] = squeeze(value)
Exemple #9
0
    def __setslice__(self, i, j, value): self.array[i:j] = asarray(squeeze(value),self._typecode)

    def __float__(self):
Exemple #10
0
 def m(self,b):
     return Matrix(self.array * asarray(b))
Exemple #11
0
 def __setitem__(self, index, value):
     value = asarray(value, self._typecode)
     self.array[index] = squeeze(value)
Exemple #12
0
 def __imul__(self,other):
     aother = asarray(other)
     self.array = dot(self.array, aother)
     return self
Exemple #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
Exemple #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))
Exemple #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))
Exemple #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))
Exemple #17
0
import string