Re: [Numpy-discussion] matrix multiplication A x, x has some zeros

2007-12-14 Thread Alan G Isaac
>> idx=N.ravel(x)!=0 >> A[:,idx]*x[idx] On Fri, 14 Dec 2007, dmitrey apparently wrote: > I expect being vector of length n A and x change > every iter. A is not sparse. Still, whenever x has a lot of zeros, this should have a substantial payoff. That seems the only exploitable information yo

Re: [Numpy-discussion] RAdian <--> degres conversion

2007-12-14 Thread David M. Cooke
On Dec 14, 2007, at 14:33 , Christopher Barker wrote: > HI all, > > Someone on the wxPython list just pointed out that the math module now > includes includes angle-conversion utilities: > degrees.__doc__ > degrees(x) -> converts angle x from radians to degrees radians.__doc__ > radians(

Re: [Numpy-discussion] matrix multiplication A x, x has some zeros

2007-12-14 Thread dmitrey
Thank you for the tip, however, I expect being vector of length n A and x change every iter. A is not sparse. Alan G Isaac wrote: > On Fri, 14 Dec 2007, dmitrey apparently wrote: > >> I guess it doesn't matter, but typical n are 1...1000. >> However, I need to call the operation hundreds or t

[Numpy-discussion] RAdian <--> degres conversion

2007-12-14 Thread Christopher Barker
HI all, Someone on the wxPython list just pointed out that the math module now includes includes angle-conversion utilities: >>> degrees.__doc__ degrees(x) -> converts angle x from radians to degrees >>> radians.__doc__ radians(x) -> converts angle x from degrees to radians Not a big deal, bu

[Numpy-discussion] ANN: SFE-00.35.01

2007-12-14 Thread Robert Cimrman
Let me announce SFE-00.35.01, bringing per term integration - now each term can use its own quadrature points. This is a major change at the heart of the code - some parts may not work as all terms were not migrated yet to the new framework. All test examples work, though, as well as acoustic b

Re: [Numpy-discussion] matrix multiplication A x, x has some zeros

2007-12-14 Thread Bruce Southey
Hi, How sparse are A, x and Ax? You probably will not find any time or operation efficiency unless A and x are relatively sparse. With the small size of n, any efficiency will typically be small in any case. As you indicate that this has to be repeated multiple times, perhaps you should look at y

Re: [Numpy-discussion] Faster array version of ndindex

2007-12-14 Thread Stefan van der Walt
Hi Sebastian N.fromiter only works on 1D arrays. I thought the following may work, but it doesn't: np.fromiter(np.ndindex(10,10,10),N.dtype((int,3))) This kind of loop is probably best implemented in C, although I think Jonathan's version is rather clever. Regards Stéfan On Fri, Dec 14, 2007

Re: [Numpy-discussion] matrix multiplication A x, x has some zeros

2007-12-14 Thread Alan G Isaac
On Fri, 14 Dec 2007, dmitrey apparently wrote: > I guess it doesn't matter, but typical n are 1...1000. > However, I need to call the operation hundreds or thousands times (while > running NLP solver ralg, so 4..5 * nIter times). > Number of zeros can be 0...n-1 Do both A and x change every it

Re: [Numpy-discussion] matrix multiplication A x, x has some zeros

2007-12-14 Thread dmitrey
I guess it doesn't matter, but typical n are 1...1000. However, I need to call the operation hundreds or thousands times (while running NLP solver ralg, so 4..5 * nIter times). Number of zeros can be 0...n-1 Charles R Harris wrote: > How big is n? > > On Dec 14, 2007 1:24 AM, dmitrey <[EMAIL PROT

Re: [Numpy-discussion] matrix multiplication A x, x has some zeros

2007-12-14 Thread Charles R Harris
How big is n? On Dec 14, 2007 1:24 AM, dmitrey <[EMAIL PROTECTED]> wrote: > Hi all, > I have to get Ax, A is n x n matrix, x is vector of length n. > Some coords of x are zeros, so I want to economy time/cputime somehow > w/o connecting sparse module from scipy. > What's the easiest way to do so

Re: [Numpy-discussion] Faster array version of ndindex

2007-12-14 Thread Sebastian Haase
Do you know about N.fromiter() ? -Sebastian Haase On Dec 14, 2007 12:33 AM, Jonathan Taylor <[EMAIL PROTECTED]> wrote: > I was needing an array representation of ndindex since ndindex only > gives an iterator but array(list(ndindex)) takes too long. There is > prob some obvious way to do this I

[Numpy-discussion] matrix multiplication A x, x has some zeros

2007-12-14 Thread dmitrey
Hi all, I have to get Ax, A is n x n matrix, x is vector of length n. Some coords of x are zeros, so I want to economy time/cputime somehow w/o connecting sparse module from scipy. What's the easiest way to do so? Thx, D. ___ Numpy-discussion mailing l