Skip to main content

Timeline for Compile function dynamically

Current License: CC BY-SA 4.0

12 events
when toggle format what by license comment
Feb 16, 2022 at 19:24 comment added Domenico Modica Yes I had that question already saved, eventually I'll do that way and maybe write the program directly in C... But due to some graph symmetries, many times I can shrink my "searchspace" by some factorial factors. And, on a first thought, this would mean adding some branching on top of the extra code for of the i-th permutation. A problem that now I've avoided generating directly the shrunk list. Maybe for big $n$ I'll divide the space in batches, but for now it's a miracle if I solve $n=10$ in less than a day of computation! :D
Feb 16, 2022 at 18:48 comment added Henrik Schumacher Have also a look at this: https://stackoverflow.com/questions/7918806/finding-n-th-permutation-without-computing-others Generating the permutations one at the time might save you shoving around a lot of memory.
Feb 16, 2022 at 18:45 comment added Domenico Modica You're right on your second point, I had give up on making a CompilationTarget -> "C" for each graph I had, because looking at the improvement it seemed it wasn't worth the extra time of compilation. Now this meta-function is clearly faster than one specific non- CompilationTarget -> "C" function and at keeps pace with a specific CompilationTarget -> "C" one, thanks
Feb 16, 2022 at 18:37 history edited Henrik Schumacher CC BY-SA 4.0
deleted 4 characters in body
Feb 16, 2022 at 18:33 vote accept Domenico Modica
Feb 16, 2022 at 18:28 comment added Henrik Schumacher And no, Compile`GetElement is undocumented. You have to look around on this site to find more details about it.
Feb 16, 2022 at 18:27 history edited Henrik Schumacher CC BY-SA 4.0
added 9 characters in body
Feb 16, 2022 at 18:23 comment added Henrik Schumacher Compiling an array is certainly more expensive than passing the array as an argument...
Feb 16, 2022 at 18:22 history edited Henrik Schumacher CC BY-SA 4.0
added 9 characters in body
Feb 16, 2022 at 18:20 comment added Domenico Modica Thanks! Where I could have found documentations of Compile`GetElement? By the way I recompile the function many times because I use it in a brute force search where I map it on a Permutation@Range@n list (So the function is listable and parallelizable)... Passing to the function this many time a constant displacement and a constant graph wouldn't be detrimental to speed? (Also I don't know how to make this general version listable)
Feb 16, 2022 at 17:56 history edited Henrik Schumacher CC BY-SA 4.0
added 573 characters in body
Feb 16, 2022 at 17:49 history answered Henrik Schumacher CC BY-SA 4.0