示例#1
0
    def Assign(self, *args):
        """
        Assign(DenseMatrix self, double const v)
        Assign(DenseMatrix self, DenseMatrix m)
        Assign(DenseMatrix self, PyObject * numpymat)
        """

        from numpy import ndarray, ascontiguousarray
        keep_link = False
        if len(args) == 1 and isinstance(args[0], ndarray):
                if args[0].dtype != 'float64':
                     raise ValueError('Must be float64 array:' + args[0].dtype + ' was given')
                elif args[0].ndim != 2:
                    raise ValueError('Ndim must be two') 
                elif args[0].shape[1] != _densemat.DenseMatrix_Size(self):
                    raise ValueError('Length does not match')
                else:
          	    args = (ascontiguousarray(args[0]),)


        val = _densemat.DenseMatrix_Assign(self, *args)

        return self


        return val
示例#2
0
 def Assign(self, *args):
     return _densemat.DenseMatrix_Assign(self, *args)
示例#3
0
    def Assign(self, *args):
        val = _densemat.DenseMatrix_Assign(self, *args)

        return self

        return val