Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
victorlei committed Sep 15, 2014
1 parent 84d40ad commit c09fb73
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions smop/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,7 @@ def __str__(self):
return str(np.asarray(self))

def __add__(self,other):
return np.asarray(self)+np.asarray(other)
return np.ndarray.__add__(self,other)
return matlabarray(np.asarray(self)+np.asarray(other))

def __neg__(self):
return matlabarray(np.asarray(self).__neg__())
Expand Down Expand Up @@ -520,7 +519,10 @@ def rand_(*args,**kwargs):
return np.random.rand()
if len(args) == 1:
args += args
return np.random.rand(np.prod(args)).reshape(args,order="F")
try:
return np.random.rand(np.prod(args)).reshape(args,order="F")
except:
pass

def ravel_(a):
return np.asanyarray(a).reshape(-1,1)
Expand Down

0 comments on commit c09fb73

Please sign in to comment.