27;Jens Axel Søgaard'; 'Vincent St-Amour'; 'Eric Dobson';
> 'Racket Users List'
> Subject: RE: [racket] FW: q about code for partitions
>
> Your example exposed two different bugs in `future`. I've pushed
> repairs.
>
> Thanks!
>
>
sage-
> > From: Matthew Flatt [mailto:mfl...@cs.utah.edu]
> > Sent: jueves, 17 de julio de 2014 13:48
> > To: Jos Koot
> > Cc: 'Jens Axel Søgaard'; 'Vincent St-Amour'; 'Eric Dobson';
> > 'Racket Users List'
> > Subj
incent St-Amour'; 'Eric Dobson';
> 'Racket Users List'
> Subject: RE: [racket] FW: q about code for partitions
>
> I'll work on this. Thanks!
>
> At Thu, 17 Jul 2014 13:41:28 +0200, "Jos Koot" wrote:
> > Strange: I do not get a segfault
; > [mailto:jensaxelsoega...@gmail.com] On Behalf Of Jens Axel Søgaard
> > Sent: jueves, 17 de julio de 2014 13:12
> > To: Jos Koot
> > Cc: Vincent St-Amour; Eric Dobson; Matthew Flatt; Racket Users List
> > Subject: Re: [racket] FW: q about code for partitions
t
> Cc: Vincent St-Amour; Eric Dobson; Matthew Flatt; Racket Users List
> Subject: Re: [racket] FW: q about code for partitions
>
> What you describe seems more like a bug in partitions than a
> documentation bug.
> Do you have a small example that provoke a segfault?
>
>
os Koot
> >> wrote:
> >> > > Great work, Jens. I am glad my approach as been adopted
> >> (and much improved
> >> > > without deviating from the original idea of simpler
> >> recurrence). When can we
> >> > > expect i
Message-
>> From: Vincent St-Amour [mailto:stamo...@ccs.neu.edu]
>> Sent: domingo, 29 de junio de 2014 22:52
>> To: Eric Dobson
>> Cc: Jos Koot; Matthew Flatt; Jens Axel Søgaard; Racket Users List
>> Subject: Re: [racket] FW: q about code for partitions
>>
&g
Jos
> -Original Message-
> From: Vincent St-Amour [mailto:stamo...@ccs.neu.edu]
> Sent: domingo, 29 de junio de 2014 22:52
> To: Eric Dobson
> Cc: Jos Koot; Matthew Flatt; Jens Axel Søgaard; Racket Users List
> Subject: Re: [racket] FW: q about code for partitions
>
>
Thanks, Jos
> >
> >> -Original Message-
> >> From: jensaxelsoega...@gmail.com
> >> [mailto:jensaxelsoega...@gmail.com] On Behalf Of Jens Axel Søgaard
> >> Sent: domingo, 29 de junio de 2014 12:48
> >> To: Matthew Flatt
> >> Cc: Jos Koot; Racket
: domingo, 29 de junio de 2014 12:48
>> To: Matthew Flatt
>> Cc: Jos Koot; Racket Users List
>> Subject: Re: [racket] FW: q about code for partitions
>>
>> I have made a new vector version using zero? instead of exact-zero?.
>>
>> To give users a chance t
axelsoega...@gmail.com] On Behalf Of Jens Axel Søgaard
> Sent: domingo, 29 de junio de 2014 12:48
> To: Matthew Flatt
> Cc: Jos Koot; Racket Users List
> Subject: Re: [racket] FW: q about code for partitions
>
> I have made a new vector version using zero? instead of exact-zero?.
>
Given that partitions2.rkt is written in TR, it shouldn't have to go
through a contract boundary to use `exact-zero?` (which is also written
in TR). The contract profiler does not observe any time spent in
contracts, which supports that hypothesis.
How did you discover that `exact-zero?` was wrapp
This seems like a good test case for Vincent's tools. They may have
been able to tell us that the time was spent contract checking.
Robby
On Sun, Jun 29, 2014 at 5:48 AM, Jens Axel Søgaard
wrote:
> I have made a new vector version using zero? instead of exact-zero?.
>
> To give users a chance t
I have made a new vector version using zero? instead of exact-zero?.
To give users a chance to remove the cache after doing partitions calculations,
I have added set-partitions-cache.
Code:
https://github.com/soegaard/racket/blob/patch-14/pkgs/math-pkgs/math-lib/math/private/number-theory/
2014-06-29 8:47 GMT+02:00 Matthew Flatt :
> It looks like "partitions2.rkt" ends up calling a contract-wrapped
> variant of `exact-zero?`.
That explains why Eric saw an improvement, when the used #f instead of
0 as the not-cached-yet value.
/Jens Axel
Racket Users list:
h
t
> Subject: Re: [racket] FW: q about code for partitions
>
> It looks like "partitions2.rkt" ends up calling a contract-wrapped
> variant of `exact-zero?`. If I change `ref!` to
>
> (define (ref! n thnk)
>(let ([v (vector-ref cache n)])
>
It looks like "partitions2.rkt" ends up calling a contract-wrapped
variant of `exact-zero?`. If I change `ref!` to
(define (ref! n thnk)
(let ([v (vector-ref cache n)])
(if (zero? v)
(let ([new-v (thnk)])
(vector-set! cache n new-v)
new-v)
v)))
the
and fast (in that order). Therefore
>> complicating the code much for a slight gain of speed may be the wrong thing
>> to do. MHO
>>
>> Jos
>>
>>
>>> -Original Message-
>>> From: jensaxelsoega...@gmail.com
>>> [mailto:jensaxelsoega...
> to do. MHO
>
> Jos
>
>
>> -Original Message-
>> From: jensaxelsoega...@gmail.com
>> [mailto:jensaxelsoega...@gmail.com] On Behalf Of Jens Axel Søgaard
>> Sent: sábado, 28 de junio de 2014 16:51
>> To: Neil Toronto
>> Cc: Jos Koot; Racket Use
> -Original Message-
> From: jensaxelsoega...@gmail.com
> [mailto:jensaxelsoega...@gmail.com] On Behalf Of Jens Axel Søgaard
> Sent: sábado, 28 de junio de 2014 16:51
> To: Neil Toronto
> Cc: Jos Koot; Racket Users List
> Subject: Re: [racket] FW: q about code for partitions
rry I can't help you on this. Maybe experts of the team can shed light?
>>
>> Best wishes, Jos
>>
>>
>>
>>> -Original Message-
>>> From: jensaxelsoega...@gmail.com
>>> [mailto:jensaxelsoega...@gmail.com] On Behalf Of Jens Axel Søgaard
>
m
>> [mailto:jensaxelsoega...@gmail.com] On Behalf Of Jens Axel Søgaard
>> Sent: sábado, 28 de junio de 2014 12:07
>> To: Jos Koot
>> Cc: Neil Toronto; Racket Users List
>> Subject: Re: [racket] FW: q about code for partitions
>>
>> Hi,
>>
>> I h
nio de 2014 12:07
> To: Jos Koot
> Cc: Neil Toronto; Racket Users List
> Subject: Re: [racket] FW: q about code for partitions
>
> Hi,
>
> I have converted your code to Typed Racket and made two versions.
> The first version use a hash as cache and the second version
> us
Hi,
I have converted your code to Typed Racket and made two versions.
The first version use a hash as cache and the second version us a vector.
Timings show that the vector version is 1.5 to 2 times slower than the
hash version.
I don't understand this. Is there anything that can be done to impr
Sorry, forgot to post the following to the users list.
Hi,
count partitions, much faster and exact.
You may want to put the hash or part of it within function p such as to
avoid spllling much memory.
Jos
#lang racket
(require math/number-theory)
(define p-hash (make-hash '((0 . 1
(define (
25 matches
Mail list logo