On Jan 7, 2008, at 19:57, Travis E. Oliphant wrote:
> Alternatively, the generic scalar operations should probably not be so
> "inclusive" and should allow the other object a chance to perform the
> operation more often (by returning NotImplemented).
That would be great. In fact, this has been (a
Bruce Sherwood wrote:
> Okay, I've implemented the scheme below that was proposed by Scott
> Daniels on the VPython mailing list, and it solves my problem. It's also
> much faster than using numpy directly: even with the "def "and "if"
> overhead: sqrt(scalar) is over 3 times faster than the num
Robert Kern wrote:
> Bruce Sherwood wrote:
>> There is also the question of
>> whether it would pay for numpy to make what is probably an exceedingly
>> fast check and do much faster calculations of sqrt(scalar) and other
>> such mathematical functions.
>
> There is no question that it would pa
Bruce Sherwood wrote:
> There is also the question of
> whether it would pay for numpy to make what is probably an exceedingly
> fast check and do much faster calculations of sqrt(scalar) and other
> such mathematical functions.
There is no question that it would pay. It takes time and effort t
Okay, I've implemented the scheme below that was proposed by Scott
Daniels on the VPython mailing list, and it solves my problem. It's also
much faster than using numpy directly: even with the "def "and "if"
overhead: sqrt(scalar) is over 3 times faster than the numpy sqrt, and
sqrt(array) is v
I found by timing measurements that a faster scheme with less penalty
for the case of sqrt(array) looks like this:
def sqrt(x):
if type(x) is float: return mathsqrt(x)
return numpysqrt(x)
Bruce Sherwood wrote:
> Roman Yakovenko wrote:
>> On Dec 29, 2007 7:47 AM, Bruce Sherwood <[EMAIL
Roman Yakovenko wrote:
> On Dec 29, 2007 7:47 AM, Bruce Sherwood <[EMAIL PROTECTED]> wrote:
>
>> I realized belatedly that I should upgrade from Boost 1.33 to 1.34.
>> Alas, that didn't cure my problem.
>>
> Can you post small and complete example of what you are trying to achieve?
>
I d
I realized belatedly that I should upgrade from Boost 1.33 to 1.34.
Alas, that didn't cure my problem.
Bruce Sherwood
Bruce Sherwood wrote:
> I should have added: This structure worked with the older version of
> VPython which used Numeric, but it doesn't work in the beta version
> which uses
Hi Bruce,
I have to add that I don't know the answer to your question either, but I do
know that it is solvable and that once the list experts return,
enlightenment will soon follow. My confidence comes from knowing the Python
internals for how left and right multiplication are performed. As lon
I should have added: This structure worked with the older version of
VPython which used Numeric, but it doesn't work in the beta version
which uses numpy. Since I don't know enough about either numpy or Boost,
I'm left guessing which subsystem is the source of my difficulties, and
clueless abou
Thanks for the comment, which limits the range of possible solutions.
The VPython vector class is implemented in C++, not in Python. I made up
the simple test in my previous note to try out the solution that had
been offered and which you have usefully ruled out. Here is the relevant
part of th
Bruce Sherwood wrote:
> Thanks for the suggestion. It hadn't occurred to me to try to override
> numpy as you suggest. However, when I try the code shown below as the
> start of a test of this scheme, I get the following error:
>
> Traceback (most recent call last):
> File "C:\Documents and Se
Thanks for the suggestion. It hadn't occurred to me to try to override
numpy as you suggest. However, when I try the code shown below as the
start of a test of this scheme, I get the following error:
Traceback (most recent call last):
File "C:\Documents and Settings\Bruce\My
Documents\0VPytho
13 matches
Mail list logo