[Numpy-discussion] binary shift for ndarray

dmitrey dmitrey.kroshko@scipy....
Wed May 20 14:24:57 CDT 2009

hi all,

suppose I have A that is numpy ndarray of floats, with shape n x n.

I want to obtain dot(A, b), b is vector of length n and norm(b)=1, but
instead of exact multiplication I want to approximate b as a vector
[+/- 2^m0, ± 2^m1, ± 2^m2 ,,, ± 2^m_n], m_i are integers, and then
invoke left_shift(vector_m) for rows of A.

So, what is the simplest way to do it, without cycles of course? Or it
cannot be implemented w/o cycles with current numpy version?

Thank you in advance, D.

More information about the Numpy-discussion mailing list