We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 22338ec commit 51e2858Copy full SHA for 51e2858
camb/model.py
@@ -795,10 +795,7 @@ def tensor_power(self, k):
795
return self.primordial_power(k, 2)
796
797
def primordial_power(self, k, ix):
798
- if np.isscalar(k):
799
- karr = np.array([k], dtype=np.float64)
800
- else:
801
- karr = np.array(k, dtype=np.float64)
+ karr = np.ascontiguousarray([k] if np.isscalar(k) else k, dtype=np.float64)
802
n = karr.shape[0]
803
powers = np.empty(n)
804
self.f_PrimordialPower(karr, powers, byref(c_int(n)), byref(c_int(ix)))
0 commit comments