20 May
2009
20 May
'09
7:24 p.m.
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.