legendre transforms: Polishing and bugfixes

vbroadcast didn't work properly for some reason, vload does..
This commit is contained in:
Dag Sverre Seljebotn 2015-04-23 09:57:45 +02:00
parent ea8671c2ec
commit f2fe4f9ca2
6 changed files with 204 additions and 161 deletions

View file

@ -14,7 +14,9 @@ cdef extern from "sharp.h":
def legendre_transform(x, bl, out=None):
if out is None:
out = np.empty_like(x)
if x.dtype == np.float64:
if out.shape[0] == 0:
return out
elif x.dtype == np.float64:
if bl.dtype != np.float64:
bl = bl.astype(np.float64)
return _legendre_transform(x, bl, out=out)