Joe Riel

9660 Reputation

23 Badges

20 years, 5 days

MaplePrimes Activity


These are replies submitted by Joe Riel

The logical expressions cond1 and cond2 and `and`(cond1,cond2) are not completely equivalent.  The difference is that all the operands of `and` are always evaluated. For example,

f := proc() print(hello); false end proc:
f() and f();
                                                      hello

                                                      false
`and`(f(),f());
                                                      hello

                                                      hello

                                                      false



A minor correction to a useful post.  ?subsindets and the associated ?evalindets are not builtins.  Studying how they work is a useful exercise for improving ones Maple prowess (suitable for fairly advanced Maple users).

A minor correction to a useful post.  ?subsindets and the associated ?evalindets are not builtins.  Studying how they work is a useful exercise for improving ones Maple prowess (suitable for fairly advanced Maple users).

It would be helpful if you either uploaded the worksheet (green arrow) or inserted the Maple code as text so it can be copied and pasted.

@Markiyan Hirnyk Alas, there has been a problem with the Application Center server such that the newest version of Iterator (2.3.0) has not yet been uploaded.  I understand that it is in the queue.  I'll post a notification when I hear anything.  You need 2.3.0 to use this code.

@Markiyan Hirnyk Alas, there has been a problem with the Application Center server such that the newest version of Iterator (2.3.0) has not yet been uploaded.  I understand that it is in the queue.  I'll post a notification when I hear anything.  You need 2.3.0 to use this code.

Could you check what version of Maple you are running.  Execute version(); and post the results.  Thanks

Are you running it with a different version of Maple/MapleSim then the one it ran on? 

@Carl Love The real problem with the Iterator approach is that I didn't provide a means for compiling transformers (transformers are procedures that transform the output of the base iterator to a form the user prefers).  Doing so isn't hard, but will need some work to make it user-friendly.  I whipped up a change just to see that it is doable and gives reasonable performance; with that in place I can produce all the factorizations of 12! in under 30 seconds, which doesn't seem bad for a non-dedicated method (the dedicated procedure here takes 40 seconds, but doesn't use any compilation).

@Carl Love This is a cleaner presentation, thanks.  The method used by Iterator:-MultiPartition is different. With 72^4 as input, both routines take about the same time.  With 12! as input, Factoring is significantly better (40 secs vs 3.5 minutes) when output is produced. If my routine just loops through the factorizations (say counting their number, 2,787,810), it only takes 11 seconds.  I knew the production of output would be a problem.

@Markiyan Hirnyk Probably I would have been better just to omit those details. On a linux system, that is where the files will go.  On a Windows system I'm never quite sure where Maple thinks the home directory is.  You can find out by executing, in Maple, the command kernelopts(homedir); the result is equivalent to the $HOME in the path. Ignore step 6, it came from another package I wrote and is not applicable to Iterator; I'll remove it from the README.

@Markiyan Hirnyk Apologies.  I had thought the 'transformer' option was part of the original release; apparently it was not, or it was only for internal use.  It has since been added to almost all the exports, along with a slightly more powerful 'maketransformer' option.  I'll see if I can get the updates uploaded today.

@Markiyan Hirnyk Apologies.  I had thought the 'transformer' option was part of the original release; apparently it was not, or it was only for internal use.  It has since been added to almost all the exports, along with a slightly more powerful 'maketransformer' option.  I'll see if I can get the updates uploaded today.

@Markiyan Hirnyk It should not matter where the installer is unpacked (unzipped). Actually, you probably do not want to put it in the main Maple library directory.  Two reasons for that: (1) it usually is not a good idea to put foreign stuff in that directory; (2) the mla that is included with the package is not a normal Maple mla, rather it is an installer mla that contains both the actual mla (Iterator.mla) and the help database (Iterator.hdb).  If you follow the directions in the included README file (you can access that file after unzipping the zip file) both those files will be installed onto your machine. 

 

@Markiyan Hirnyk Yes, the 'accept' option was one of the features I added and have not yet submitted. It permits assigning a predicate (that is, a procedure that returns true or false) to qualify the output.  At the moment you can do the following

with(Iterator):

VecToStr := proc(V)
local i;
    cat("",seq('(i,"+*/-"[V[i]+1])',i=1..8),"9=100")
end proc:

iter := MixedRadixTuples([4$8]
                          , 'transformer' = VecToStr  # Assign VecToStr as before
                        ):

for s in iter do
    if evalb(parse(s)) then
        printf("%s\n", s);
    end if;
end do:
First 54 55 56 57 58 59 60 Last Page 56 of 195