On Sat, Oct 17, 2009 at 9:13 AM, Loïc BERTHE wrote:
> Hi,
>
> I would like to create my own class of record array to deal with units.
>
> Here is the code I used, inspired from
>
> http://docs.scipy.org/doc/numpy-1.3.x/user/basics.subclassing.html#slightly-more-realistic-example-attribute-added
On Sat, Oct 17, 2009 at 8:00 PM, wrote:
> On Sat, Oct 17, 2009 at 7:46 PM, Charles R Harris
> wrote:
>>
>>
>> On Sat, Oct 17, 2009 at 5:27 PM, wrote:
>>>
>>> On Sat, Oct 17, 2009 at 2:02 PM, Charles R Harris
>>> wrote:
>>> >
>>> >
>>> > On Sat, Oct 17, 2009 at 11:54 AM, wrote:
>>> >>
>>> >> O
On Sat, Oct 17, 2009 at 7:46 PM, Charles R Harris
wrote:
>
>
> On Sat, Oct 17, 2009 at 5:27 PM, wrote:
>>
>> On Sat, Oct 17, 2009 at 2:02 PM, Charles R Harris
>> wrote:
>> >
>> >
>> > On Sat, Oct 17, 2009 at 11:54 AM, wrote:
>> >>
>> >> On Sat, Oct 17, 2009 at 1:20 PM, Charles R Harris
>> >> w
On Sat, Oct 17, 2009 at 5:27 PM, wrote:
> On Sat, Oct 17, 2009 at 2:02 PM, Charles R Harris
> wrote:
> >
> >
> > On Sat, Oct 17, 2009 at 11:54 AM, wrote:
> >>
> >> On Sat, Oct 17, 2009 at 1:20 PM, Charles R Harris
> >> wrote:
> >> >
> >> >
> >> > On Sat, Oct 17, 2009 at 9:36 AM, per freem
> w
On Sat, Oct 17, 2009 at 2:02 PM, Charles R Harris
wrote:
>
>
> On Sat, Oct 17, 2009 at 11:54 AM, wrote:
>>
>> On Sat, Oct 17, 2009 at 1:20 PM, Charles R Harris
>> wrote:
>> >
>> >
>> > On Sat, Oct 17, 2009 at 9:36 AM, per freem wrote:
>> >>
>> >> hi all,
>> >>
>> >> in my code, i use the functi
On Sat, Oct 17, 2009 at 6:49 AM, Darren Dale wrote:
> numpy's functions, especially ufuncs, have had some ability to support
> subclasses through the ndarray.__array_wrap__ method, which provides
> masked arrays or quantities (for example) with an opportunity to set
> the class and metadata of th
Hi again, I apologize, the mistake was entirely my own. Sqrt's do the
right thing
Adam
On Sat, Oct 17, 2009 at 12:17 PM, Adam Ginsburg
wrote:
> My code is actually wrong but I still have the problem I've
> identified that sqrt is leading to precision errors. Sorry about the
> earlier m
On Sat, Oct 17, 2009 at 12:59 PM, Charles R Harris <
charlesr.har...@gmail.com> wrote:
>
>
> On Sat, Oct 17, 2009 at 12:40 PM, Neal Becker wrote:
>
>> Somewhat offtopic, but is there a generalization of the logsumexp shortcut
>> to more than 2 variables?
>>
>> IIRC, it's this for 2 variables:
>>
On Sat, Oct 17, 2009 at 12:40 PM, Neal Becker wrote:
> Somewhat offtopic, but is there a generalization of the logsumexp shortcut
> to more than 2 variables?
>
> IIRC, it's this for 2 variables:
> log (exp (a) + exp (b)) = max (a,b) + log (1 + exp (-abs (a-b)))
>
>
logaddexp.reduce will apply it
Somewhat offtopic, but is there a generalization of the logsumexp shortcut
to more than 2 variables?
IIRC, it's this for 2 variables:
log (exp (a) + exp (b)) = max (a,b) + log (1 + exp (-abs (a-b)))
___
NumPy-Discussion mailing list
NumPy-Discussion@sc
2009/10/17 Adam Ginsburg :
> My code is actually wrong but I still have the problem I've
> identified that sqrt is leading to precision errors. Sorry about the
> earlier mistake.
I think you'll find that numpy's sqrt is as good as it gets for double
precision. You can try using numpy's float9
On Sat, Oct 17, 2009 at 12:08 PM, Adam Ginsburg
wrote:
> Hi folks,
> I'm trying to write a ray-tracing code for which high precision is
> required. I also "need" to use square roots. However, math.sqrt and
> numpy.sqrt seem to only use single-precision floats. Is there a
> simple way to make
The default precision is double unless yue specify otherwise (float32 or long
double (float128 or float96))
You can see this from:
f(fsolve(f,1.01))
# 1.7763568394002505e-15
The last line should be:
>>> fsolve(f,1.01) - float64(1.034324523462345)
8.8817841970012523e-16
Nadav
-הודעה מ
Adam Ginsburg wrote:
> Hi folks,
>I'm trying to write a ray-tracing code for which high precision is
> required. I also "need" to use square roots. However, math.sqrt and
> numpy.sqrt seem to only use single-precision floats. Is there a
> simple way to make sqrt use higher precision? Altern
My code is actually wrong but I still have the problem I've
identified that sqrt is leading to precision errors. Sorry about the
earlier mistake.
Adam
On Sat, Oct 17, 2009 at 12:08 PM, Adam Ginsburg
wrote:
>
> sqrt(float64(1.034324523462345))
> # 1.0170174646791199
> f=lambda x: x**2-float6
Hi folks,
I'm trying to write a ray-tracing code for which high precision is
required. I also "need" to use square roots. However, math.sqrt and
numpy.sqrt seem to only use single-precision floats. Is there a
simple way to make sqrt use higher precision? Alternately, am I
simply being obtuse
On Sat, Oct 17, 2009 at 11:54 AM, wrote:
> On Sat, Oct 17, 2009 at 1:20 PM, Charles R Harris
> wrote:
> >
> >
> > On Sat, Oct 17, 2009 at 9:36 AM, per freem wrote:
> >>
> >> hi all,
> >>
> >> in my code, i use the function 'logsumexp' from scipy.maxentropy a
> >> lot. as far as i can tell, this
On Sat, Oct 17, 2009 at 1:20 PM, Charles R Harris
wrote:
>
>
> On Sat, Oct 17, 2009 at 9:36 AM, per freem wrote:
>>
>> hi all,
>>
>> in my code, i use the function 'logsumexp' from scipy.maxentropy a
>> lot. as far as i can tell, this function has no vectorized version
>> that works on an m-x-n m
On Sat, Oct 17, 2009 at 9:36 AM, per freem wrote:
> hi all,
>
> in my code, i use the function 'logsumexp' from scipy.maxentropy a
> lot. as far as i can tell, this function has no vectorized version
> that works on an m-x-n matrix. i might be doing something wrong here,
> but i found that this f
On Sat, Oct 17, 2009 at 8:36 AM, per freem wrote:
> hi all,
>
> in my code, i use the function 'logsumexp' from scipy.maxentropy a
> lot. as far as i can tell, this function has no vectorized version
> that works on an m-x-n matrix. i might be doing something wrong here,
> but i found that this fu
hi all,
in my code, i use the function 'logsumexp' from scipy.maxentropy a
lot. as far as i can tell, this function has no vectorized version
that works on an m-x-n matrix. i might be doing something wrong here,
but i found that this function can run extremely slowly if used as
follows: i have an
Hi,
I would like to create my own class of record array to deal with units.
Here is the code I used, inspired from
http://docs.scipy.org/doc/numpy-1.3.x/user/basics.subclassing.html#slightly-more-realistic-example-attribute-added-to-existing-array
:
[code]
from numpy import *
class BlocArra
numpy's functions, especially ufuncs, have had some ability to support
subclasses through the ndarray.__array_wrap__ method, which provides
masked arrays or quantities (for example) with an opportunity to set
the class and metadata of the output array at the end of an operation.
An example is
q1 =
A Friday 16 October 2009 18:05:05 Sturla Molden escrigué:
> Francesc Alted skrev:
> > The response is clear: avoid memcpy() if you can. It is true that
> > memcpy() performance has improved quite a lot in latest gcc (it has been
> > quite good in Win versions since many years ago), but working wit
24 matches
Mail list logo