vidits-kth / py-itpp

Python wrapper library for signal processing and communications research
MIT License
18 stars 10 forks source link

pow and exp functions hang indefinitely #3

Open vidits-kth opened 4 years ago

vidits-kth commented 4 years ago

The pow and exp functions hang indefinitely on execution. Minimum example:

import itpp
a = itpp.vec(10)
b = itpp.math.pow(a, 2) # hangs indefinitely
vidits-kth commented 4 years ago

The root cause seems related to libitpp.so, which internally uses std::pow from the math library.

A possible workaround is to cast the ITPP array as Numpy array, use Numpy operations, and re-cast the array back to ITPP.

Applied to the example above,

import itpp
import numpy as np
a = itpp.vec(10)
b = itpp.numpy_array_to_vec( np.power( np.array( a ), 2) )# runs properly