示例#1
0
文件: Matrix.py 项目: KarolNi/VROOM-
 def m(self, b):
     return Matrix(self.array * asarray(b))
示例#2
0
文件: Matrix.py 项目: KarolNi/VROOM-
 def asarray(self, t=None):
     if t is None:
         return self.array
     else:
         return asarray(self.array, t)
示例#3
0
文件: Matrix.py 项目: KarolNi/VROOM-
 def __setitem__(self, index, value):
     value = asarray(value, self._typecode)
     if multiply.reduce(value.shape) == 1:
         value = value[0, 0]
     self.array[index] = value
示例#4
0
文件: Matrix.py 项目: KarolNi/VROOM-
 def __setslice__(self, i, j, value):
     self.array[i:j] = asarray(squeeze(value), self._typecode)
示例#5
0
文件: Matrix.py 项目: IanReid/ABFGP
 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))
示例#6
0
文件: Matrix.py 项目: KarolNi/VROOM-
 def __imul__(self, other):
     aother = asarray(other)
     self.array = dot(self.array, aother)
     return self
示例#7
0
文件: Matrix.py 项目: IanReid/ABFGP
 def asarray(self,t=None):
     if t is None:
         return self.array
     else:
         return asarray(self.array,t)
示例#8
0
文件: Matrix.py 项目: dongqing7/ABFGP
 def __setitem__(self, index, value):
     value = asarray(value, self._typecode)
     self.array[index] = squeeze(value)
示例#9
0
文件: Matrix.py 项目: IanReid/ABFGP
    def __setslice__(self, i, j, value): self.array[i:j] = asarray(squeeze(value),self._typecode)

    def __float__(self):
示例#10
0
文件: Matrix.py 项目: IanReid/ABFGP
 def m(self,b):
     return Matrix(self.array * asarray(b))
示例#11
0
文件: Matrix.py 项目: IanReid/ABFGP
 def __setitem__(self, index, value):
     value = asarray(value, self._typecode)
     self.array[index] = squeeze(value)
示例#12
0
文件: Matrix.py 项目: IanReid/ABFGP
 def __imul__(self,other):
     aother = asarray(other)
     self.array = dot(self.array, aother)
     return self
示例#13
0
文件: Matrix.py 项目: fxia22/ASM_xf
 def __setitem__(self, index, value):
     value = asarray(value, self._typecode)
     if multiply.reduce(value.shape) == 1:
         value = value[0,0]
     self.array[index] = value
示例#14
0
文件: Matrix.py 项目: KarolNi/VROOM-
 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))
示例#15
0
文件: Matrix.py 项目: IanReid/ABFGP
 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))
示例#16
0
文件: Matrix.py 项目: KarolNi/VROOM-
 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))
示例#17
0
import string