[sage-combinat-devel] Re: fast vector partitions algorithm

2020-02-22 Thread Denis Sunko


On Thursday, February 20, 2020 at 2:13:23 PM UTC+1, Denis Sunko wrote:
>
>
>
> On Thursday, February 20, 2020 at 2:46:37 AM UTC+1, Travis Scrimshaw wrote:
>>
>>
>>
>>> there is nothing wrong with pushing a non-working branch somewhere.
>>> This way it's very easy to see what's going wrong there.
>>> (I guess it's something to do with importing things)
>>>
>>
>> Also linking it to the ticket by filling out the branch field there.
>>
>> Best,
>> Travis
>>
>
> Did all that, thanks to everyone for the quick replies.
>
> Looking forward to comments on the code,
>
> Denis
>
>
Code has progressed very much, thanks to the help I got on the ticket. Now 
something funny is happening with the patchbots, can anyone have a quick 
look and maybe comment?

Thanks in advance,

Denis

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-combinat-devel/722b6e55-714f-4056-99b7-90c6c35856b4%40googlegroups.com.


[sage-combinat-devel] Re: fast vector partitions algorithm

2020-02-20 Thread Denis Sunko


On Thursday, February 20, 2020 at 2:46:37 AM UTC+1, Travis Scrimshaw wrote:
>
>
>
>> there is nothing wrong with pushing a non-working branch somewhere.
>> This way it's very easy to see what's going wrong there.
>> (I guess it's something to do with importing things)
>>
>
> Also linking it to the ticket by filling out the branch field there.
>
> Best,
> Travis
>

Did all that, thanks to everyone for the quick replies.

Looking forward to comments on the code,

Denis


 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-combinat-devel/006f9bb2-2c60-48c5-b6b1-92c8dddcc3a4%40googlegroups.com.


[sage-combinat-devel] Re: fast vector partitions algorithm

2020-02-19 Thread Denis Sunko

I have opened a trac ticket <https://trac.sagemath.org/ticket/29221> now. 
Unfortunately something weird is happening with my local git branch. I have 
copied a file fast_vector_partitions.py with all the source code (it works 
in ordinary Python with 'import fast_vector_partitions') and recompiled 
Sage under this branch, which I call fast_vector_partitions (the head is 
local, no connection to the trac server yet). 

Problem: after rebuilding Sage under this branch I cannot use the functions 
in the file under the sage prompt - the function name is "undefined". I did 
both ./sage -br and make, several times.

I can see that something happened in the build because the file has 
migrated from src/sage (where I put it) to src/build and local/lib, and a 
.pyc file has appeared:

$ find . -name "*fast_vector*"
./src/build/lib.linux-x86_64-3.7/sage/combinat/fast_vector_partitions.py
./src/sage/combinat/fast_vector_partitions.py
./local/lib/python3.7/site-packages/sage/combinat/fast_vector_partitions.py
./local/lib/python3.7/site-packages/sage/combinat/__pycache__/fast_vector_partitions.cpython-37.pyc
./.git/logs/refs/heads/fast_vector_partitions
./.git/refs/heads/fast_vector_partitions

I hesitate to connect this branch with the trac server before figuring out 
what is going on. In any case I think I should try the build locally first.

Can anyone please help?

Thanks,

Denis

On Monday, February 10, 2020 at 12:34:40 PM UTC+1, Denis Sunko wrote:

> I have translated the Haskell code for vector partitions 
> ...
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-combinat-devel/26c8ac8e-f505-496f-921c-0935be237f41%40googlegroups.com.


[sage-combinat-devel] Re: fast vector partitions algorithm

2020-02-13 Thread Denis Sunko
Thanks to everybody for the friendly replies.

I could paste the code right here, is that the proper way to do it? How is 
the license transferred to Sage?

I have a trac account because I once contributed a small bugfix 
 but nothing happened with it, so 
it seems like i don't understand how the system works.

I read some of the developer's guide but it all seemed rather intimidating, 
especially for a small change. I have been programming as part of research, 
but only my own code, never collaborative projects.

I will repost to sage-devel. Any further advice is welcome.

Denis

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-combinat-devel/bf4ee717-661b-49fb-b036-f70eb80ef14f%40googlegroups.com.


[sage-combinat-devel] fast vector partitions algorithm

2020-02-10 Thread Denis Sunko
I have translated the Haskell code for vector partitions by M. C. Err, The 
Computer Journal, Vol. 31, 1988, 283-284, into Python (2 or 3, stand-alone 
file with 60 lines total).

The code works significantly faster than the Sage implementation:

┌┐
│ SageMath version 9.0, Release Date: 2020-01-01 │
│ Using Python 3.7.3. Type "help()" for help.│
└┘
sage: import vpartitions
sage: %time myvparts=vpartitions.vPartitionso([6,6,6])
CPU times: user 9.13 s, sys: 89.8 ms, total: 9.22 s
Wall time: 9.22 s
sage: %time sagevparts=list(VectorPartitions([6,6,6]))
CPU times: user 2min 10s, sys: 177 ms, total: 2min 10s
Wall time: 2min 10s
sage: myvparts[::-1]==sagevparts
True

If someone would take over the job of contributing this code to Sage, I 
would be glad to help. There are a few caveats:

1) the code is recursive;
2) there is no "min" option like in the Sage implementation.

I do not know how difficult (or necessary) it would be to address these 
points.

Of course, anyone can take it up straight from Err's paper instead, I won't 
be jealous:)

Cheers,

Denis

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-combinat-devel/5997b88f-50fb-4bc3-a5a7-b6accfa9e190%40googlegroups.com.


Re: [sage-devel] Re: memory management issue: deleted variables not released

2017-08-09 Thread Denis Sunko
Hi all,

the problem went away when I switched from 32-bit debian jessie to 64-bit
stretch. One would suspect a bug in some of the system libraries, because
the version of Sage is the same (and compiled locally from source).
Obviously the motivation to find it went down somewhat.

I thank everyone for their friendly input,

Denis


On Wed, Sep 28, 2016 at 3:34 PM, Denis  wrote:

>
>
> Bill: your comment about normal/expected behavior covers my initial post,
> but not the fact that the same code works in 7.0 and crashes in 7.3.
>
> So the question is, might someone with developer's tools catch this
> problem quickly even with my vanilla code - it's just 277 lines total, plus
> the function invocation. I can't whittle it down easily because the
> interdependencies are pretty tight. The main problem is that I do not get a
> stack trace, the sage process simply exits, with the message "Fatal: memory
> exhausted" on one machine, and completely silently on the other. Actually I
> think that is a system message, i.e. Sage always crashes silently.
>
> Of course, if someone can suggest some way at least to figure out which
> was the last function invoked, that would help.
>
> Denis
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "sage-devel" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/sage-devel/jCjc_Spo20o/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] cd man crashes building ncurses

2015-02-04 Thread Denis Sunko

I have recently built 6.4.1 from sources on three different computers. One 
of the compilations crashed while building the ncurses package. I was able 
to trace this to a cd man command issued during the build process. What 
happened was that my cdpath on that machine pointed to a directory which 
had a subdirectory named man. Setting CDPATH='' cured the issue, proving 
that the cd man was being trumped by my cdpath. Evidently one would have 
to replace it with something fixed relative to the build tree, at least cd 
./man I think. I hope somebody more adept with Sage development than me 
can take it from here. Note that it is not clear whether any package 
compiled after ncurses has a similar problem.

Denis

-- 
You received this message because you are subscribed to the Google Groups 
sage-devel group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.