Joe Riel

9660 Reputation

23 Badges

20 years, 3 days

MaplePrimes Activity


These are replies submitted by Joe Riel

@acer Directly related to this is that no evaluation may occur. Consider the case where the function is actually a number.

cnt:=0: inc := proc() global cnt; cnt := cnt+1; end proc:
(1,sqrt(2))(inc());
                     (1,sqrt(2))
cnt;
                       0

@Preben Alsholm The change would have probably occured around Maple 6, which was when the relevant code in evalapply was moved into the kernel.  

@Carl Love Am thinking that the distribution of arguments has to occur before evaluation, otherwise declaring an argument as uneval would not work properly when used in a "sequential" application.

@acer That's the crux of the matter.  It seems as though the argument(s) would be evaluated once, then distributed to the "functions" a and b.  Apparently they are distributed first, then evaluated.

At one time, arguments applied to non-functions (here an expression sequence) were handled by evalapply, which would allow some poking around. While evalapply still exists, most of its functionality is now in the kernel.

@brian bovril The library location appears fine (I was thinking maybe you had previously installed the version of Iterator that is in the Maple Application Center repository).   I doubt it's the compiler, you can check by passing compile=false to alphametic (it is quite slow without the compiler, took about 5 minutes or so here).

@brian bovril That's a confusing error. There is nothing I can see in the current version of Iterator that would cause that. Run the following to see where Maple is pulling Iterator from

LibraryTools:-FindLibrary(Iterator);

I was aware of issue 2 but chose to ignore it.  Didn't think of issue 1.  On the one hand it's not too bad (I rationalize) in that any characters appearing in the result are essentially free, i.e. they can be assigned any available digits.  However, there might not be any, or enough.  A fix is to replace the line

vars := indets(ex,symbol);

with

vars := map(convert, map(var -> seq(convert(var,string)), vars), symbol);

It extracts all characters as symbols. The new line is a bit busy for my taste, probably will split into two assignments unless there is a nicer way. Hmm. Here's a shorter version.

vars := map2(cat,``,{seq(cat("",op(vars)))});

@wswain The Maple help page file (execute ?file from the Maple prompt to open it) discusses the various versions of files. The .lib and .ind file formats are old (ancient Maple) and you are unlikely to encounter them in practice.  The lib file contained the code, the ind was an index into the lib file.  The newer mla format (mla stands for Maple Library Archive) merges the index with the code.

A toolbox is really just a standardized way to access a Maple archive from the file structure.  That is, user toolboxes get installed as subdirectories under kernelopts(homedir)/maple/toolbox.  Maple's kernel knows to look for them in that location and will automatically update libname appropriately.  Maple supplied toolboxes are installed under kernelopts(mapledir)/toolbox. The standardized location makes it easier for users to install their own archives, as a toolbox.  Before toolboxes, a Maple initialization script had to be created and/or updated so that it would reassign libname to include a path to the new mla.  That can still be done, but I find it simpler to use the toolbox approach.

I don't know whether there is detailed documentation on the toolbox layout, maybe in the programmer's guide which I haven't perused for a while.

@Carl Love While the use of parse is probably clearer, you should also be able to insert the empty-name (``) as the first element in the call to cat; that will create a global name, rather than a string.

Note that, besides not working, your usage of unassign does not make sense because unassign returns NULL, so if you could unassign an Array element, then the assignment would reassign it to NULL. For a table reference, either use unassign by itself, or do 

T[1] := evaln(T[1]):

@Carl Love I think if you look closer you'll see you did need to do so.  The reason is that sqrt(expr) evaluates to expr^(1/2). In the X expression there are occurrences of both expr^(1/2) and expr^(-1/2), the latter appearing as 1/sqrt(expr) but is actually represented as the negative power. 

I think you forgot to attach the file.

@Kitonum Alas, the Iterator package uses objects, which weren't officially introduced to Maple until Maple 16, though they exist in some form in previous versions. They aren't in Maple 12, so that won't help the user.

@Kitonum That shouldn't matter, end can be used to terminate a do loop.  I suppose it could be a 2D math interpretation issue, but it works fine on 2018.2.

@asa12 The Iterator:-Chase procedure can be used to iterate through all permutations. and should be significantly faster than using combinat[nextperm], however, given the ridiculous size it probably won't matter. 

First 24 25 26 27 28 29 30 Last Page 26 of 195