Solved by albanD in post #2 
              
              
                Hi, 
You can find the implementation in this file. 
The implementation is not as simple as it could be mainly for performance reasons: it uses inplace operations and re-uses buffers as much as possible to be able to get very good speed even though it is implemented in python. 
But even beyond that, …