Joe Riel

9660 Reputation

23 Badges

20 years, 15 days

MaplePrimes Activity


These are replies submitted by Joe Riel

Excluding the base of 0, which isn't defined everywhere, x^x is closed over C.

I assumed that would be your next question. You won't be able to assign to a[1], etc, because Maple automatically adds lists, so a[1]+a[2] would be displayed as before. Instead you'll need to devise a means to represent a[1]+a[2]. One possibility is to use a list, that is [1,2] represents a[1]+a[2]. Then you'd change the procedure passed to Categorize to handle these lists, say,
proc(x,y) global a; local i; sort(add(a[i[]], i=x)) = sort(add(a[i[]], i=y)) end proc
I assumed that would be your next question. You won't be able to assign to a[1], etc, because Maple automatically adds lists, so a[1]+a[2] would be displayed as before. Instead you'll need to devise a means to represent a[1]+a[2]. One possibility is to use a list, that is [1,2] represents a[1]+a[2]. Then you'd change the procedure passed to Categorize to handle these lists, say,
proc(x,y) global a; local i; sort(add(a[i[]], i=x)) = sort(add(a[i[]], i=y)) end proc
I agree, it is hard to find; I already knew of it 'cause I'd stumbled over it awhile ago and had used it a few times. If I'd only used it once I would then probably recall that such a command existed but wouldn't be able to find it, which is frustrating. This points out a deficiency of Maple's help system (this isn't particular to Maple), it doesn't provide a good way to search for concepts. Most help pages have aliases that link to them, however, those are usually used for alternative spellings. If you had searched for "equivalence" using text search, the 16th match is "ListTools,Categorize"; however, the total list is about 70 items and it is tedious to scan. I wonder what would be outcome if, as has been suggested in another thread, the Maple help pages were made available on the web and indexable by Google?
I agree, it is hard to find; I already knew of it 'cause I'd stumbled over it awhile ago and had used it a few times. If I'd only used it once I would then probably recall that such a command existed but wouldn't be able to find it, which is frustrating. This points out a deficiency of Maple's help system (this isn't particular to Maple), it doesn't provide a good way to search for concepts. Most help pages have aliases that link to them, however, those are usually used for alternative spellings. If you had searched for "equivalence" using text search, the 16th match is "ListTools,Categorize"; however, the total list is about 70 items and it is tedious to scan. I wonder what would be outcome if, as has been suggested in another thread, the Maple help pages were made available on the web and indexable by Google?
Looks like a bug to me. Try the following in Standard
restart;
with(Logic):
printlevel := 10:
a and b;
                                   a and b
# enter the following using 2D mode
a and b;
{--> enter Logic:-&and, args = a, b
{--> enter UseComputationEnvironment, args = Logic:-`&and`(a, b)
                           _ComputationEnvironment
<-- exit UseComputationEnvironment (now in Logic:-&and) = Logic:-`&and`(a, b)}
                              Logic:-&and(a, b)
<-- exit Logic:-&and (now at top level) = Logic:-`&and`(a, b)}
                              Logic:-&and(a, b)

Presumably the Typesetting mode is being fooled; it wants to reinterpret `a and b' as `a &and b', but &and is rebound in Logic. Or something like that...
I considered distinguishing the two, but didn't bother, mainly 'cause I don't know a way to sleep on a Windows box. Presumably there is a system command to call, but I don't have Windows. It's not clear how Threads[Wait] could be utilized here, that merely moves the problem to another thread.
I considered distinguishing the two, but didn't bother, mainly 'cause I don't know a way to sleep on a Windows box. Presumably there is a system command to call, but I don't have Windows. It's not clear how Threads[Wait] could be utilized here, that merely moves the problem to another thread.
You forgot to assign y.
sleep := proc(delay::nonnegative)
local endtime;
   endtime := time() + delay;
   while time() < endtime do end do;
end proc:
You forgot to assign y.
sleep := proc(delay::nonnegative)
local endtime;
   endtime := time() + delay;
   while time() < endtime do end do;
end proc:
I assigned a procedure because it permits plotting without having to precompute all the points. Be sure to assign a(1) a floating point value. If you assign it a fraction, say 8/10, it will run a lot slower. Also, you probably don't want to use style=point, otherwise it will be even harder to see the graph (it's not very nice).
I assigned a procedure because it permits plotting without having to precompute all the points. Be sure to assign a(1) a floating point value. If you assign it a fraction, say 8/10, it will run a lot slower. Also, you probably don't want to use style=point, otherwise it will be even harder to see the graph (it's not very nice).
Is "scatter-point indexing" the appropriate name? I invariably forget the various assignment options for Matrices---it doesn't help that finding the appropriate help page is a challenge. I believe ?LinearAlgebra,General,MVassignment is the best resource, but it only mentions this in passing. As clever as this is, note that it is no faster than the loop method I proposed. Hmmm. Actually, I have to retract that. It is faster. The difference is small since most of the time is in the call to Matrix. Pulling that outside the procedure and just reassigning the elements of a preallocated Matrix shows that your method is better. Very nice.
Is "scatter-point indexing" the appropriate name? I invariably forget the various assignment options for Matrices---it doesn't help that finding the appropriate help page is a challenge. I believe ?LinearAlgebra,General,MVassignment is the best resource, but it only mentions this in passing. As clever as this is, note that it is no faster than the loop method I proposed. Hmmm. Actually, I have to retract that. It is faster. The difference is small since most of the time is in the call to Matrix. Pulling that outside the procedure and just reassigning the elements of a preallocated Matrix shows that your method is better. Very nice.
Yes, they are quite handy, though in that example they don't measurably improve the efficiency. They can be used for Vectors and Matrices, but not general rtables, since those allow indices that do not start at one.
First 155 156 157 158 159 160 161 Last Page 157 of 195