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

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