Carl Love

Carl Love

28020 Reputation

25 Badges

12 years, 302 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@subzero Look at the status bar---the bottom right border of the Maple window. What are the values stated for Memory and Time? And has the Time value been updating regularly? Now look at the upper toolbar. In the center, there should be an octagon with an exclamation point (!) in it. Is the octagon red or gray?

If you're using Windows, I'll give you details on using Windows Task Manager to get further information.

@Joe Riel I wasn't suggesting that the compile= false option be eliminated. And surely the name of the file that contains the compiled code could be stored in the library. There must be some way to prevent the need to recompile after every restart. The StringTools package is mostly compiled code.

Usually if an app is not on your "trusted" list, a dialog pops up asking if you trust it. Then you click "yes", or whatever, and you never need to do that again, unless you reinstall the app.

@Ronan Multiplying by (-1)^(m3+1) is equivalent to replacing c3 by -c3 and negating the whole expression. Thus, this'll handle all cases:

restart:
Iterator:-CartesianProduct([1,1]): #Force compilation

P:= 2..4: #suffixes of m and c variables
N:= [$0..4]: #evaluation values of m variables
V:= subs(c3= -c3, [c||P]): #c3= -c3 does nothing if there's no c3 

B:= subs(
    {_C= [$P], _V= V, _S= sign(1-nops(V))}, #sign(0)=1
    proc(M)
    local r:= add(M*~_C), s:= 1+r, t:= s-add(M);
        _S*r!*c0^t*mul(_V^~M)/t!/mul(M!~)/c1^s
    end proc
):
B([m||P]); #to verify formula
#no change below here
CodeTools:-Usage(
    seq[reduce= `+`](B(v), v= Iterator:-CartesianProduct(N$(rhs(P)-1)))
);

 

How can anyone investigate your Question without knowing the data read into W? You don't need to post the whole file, just the part that's read into W

Also, it is possible that undefined is the correct response. I'm not saying at this point that there's any evidence that that's true, just that it's something that's worth keeping in mind. 

@Thomas Richard I consider that as being broken. IIRC, the originally designed purpose of the feature was the immediate quarantining of the main article, all its subthreads, all other threads by the same author, and all future threads by that author.

Let's not forget that in the old days it was common for 20 or so spam to appear from the same author within a few minutes, and I'd delete 50-100 spam every single day. So any deletion process requiring multiple steps is totally unacceptable. If anyone here can't remember how bad it was, that's only because I and a few other Moderators were busy deleting it before those more-casual users saw it.

@Carl Love I've confirmed that Delete As Spam is definitely broken. There's no error message this time; it appears as if it's deleting it; but in the end it's still there.

@Carl Love It may be broken again. Everything on MaplePrimes is unbearably slow right now. There are three new spam Questions (rather than the more-usual Posts) at the moment, 2 of which have spam Replies. I don't know if that's connected to this slowness

For what it's worth, I never close the help window. That's not because I think that I may have some problem reopening it, but rather because closing it seems to me (if I thought about it at all) like a totally unnecessary extra step. But actually it's never occurred to me to close it, although I've always been aware that that was possible, and it's a nuisance to me that I need to reopen it if my Maple crashes.

I'm not at my computer at the moment, but when I have a chance I'll check if I can duplicate what you described. I'm also using Windows 10.

@Carl Love Given procedure above, the original formula can be returned (for verification, among other things) by 

B([m||P]);

@Joe Riel If the Iterators can be meaningfully compiled with dummy input as you showed, then why not do that and store the compiled versions in the library during the overall installation of Maple?

@subzero The command op(k, f) will extract the kth argument of function f. Note that f must be a function (i.e., it must have arguments) for this to work; it can't simply be a function's name as is the U in the example that you just posted. The command op(0, f) will extract the function's "name", which isn't always a name in the strict sense. For example, op(0, D(y)(0)) returns D(y). Another way to think about it is that op(0, f) is what remains after f​​​​'s argument sequence is removed.

If you have an expression e from which you want to extract all functions whose first argument is x, use

indets(e, patfunc(identical(x), anything))

@Joe Riel Joe, If you're looking at that SCR that I submitted last night regarding the kernel crash, I have very significant additional information about it, which I'll email to you if you want. My evidence proves that the bug is specific to the combination of add and Iterator, that eval has nothing to do with it, and that the compilation is only tangentially related to it (the compilation leads to the kernel crash, but the underlying bug occurs regardless of compilation). However, my evidence suggests that the culprit is Maple 2021 changes to add, which may not be something that you work on.

@Ronan I don't think that using startup code would help because compilation happens for each use by default. [Edit: Joe has just said below that due to a recent change, the startup code actually will help.] But, for the small sizes of the cartesian products that we're dealing with here, the effort of compilation isn't worth it, and it can be turned off. Compare:

restart:
B:= (2*m2 + 3*m3 + 4*m4)!*c0^(1 + m2 + 2*m3 + 3*m4)*c2^m2*c3^m3*c4^m4
    /((1 + m2 + 2*m3 + 3*m4)!*m2!*m3!*m4!*c1^(2*m2 + 3*m3 + 4*m4 + 1))
:
P:= 4: M:= [m||(2..P)]: N:= 4:
CodeTools:-Usage(
    seq[reduce= `+`](
        eval(B, M=~ [seq](c)), 
        c= Iterator:-CartesianProduct([$0..N]$(P-1))
    )
):
memory used=13.48MiB, alloc change=35.01MiB, 
cpu time=203.00ms, real time=205.00ms, gc time=0ns

restart:
B:= (2*m2 + 3*m3 + 4*m4)!*c0^(1 + m2 + 2*m3 + 3*m4)*c2^m2*c3^m3*c4^m4
    /((1 + m2 + 2*m3 + 3*m4)!*m2!*m3!*m4!*c1^(2*m2 + 3*m3 + 4*m4 + 1))
:
P:= 4: M:= [m||(2..P)]: N:= 4:
CodeTools:-Usage(
    seq[reduce= `+`](
        eval(B, M=~ [seq](c)), 
        c= Iterator:-CartesianProduct([$0..N]$(P-1), compile= false)
    )
):
memory used=2.48MiB, alloc change=0 bytes, 
cpu time=31.00ms, real time=23.00ms, gc time=0ns

 

One may wonder why I chose a new-fangled embedded for-loop for the above Answer when an old-fashioned add command with an index variable would've been shorter and more to the point. The reason is that in Maple 2021 (only), the following gives a kernel crash:

restart:
B:= (2*m2 + 3*m3 + 4*m4)!*c0^(1 + m2 + 2*m3 + 3*m4)*c2^m2*c3^m3*c4^m4
    /((1 + m2 + 2*m3 + 3*m4)!*m2!*m3!*m4!*c1^(2*m2 + 3*m3 + 4*m4 + 1))
:
P:= 4: M:= [m||(2..P)]: N:= 4:
add(eval(B, M=~ [seq](c)), c= Iterator:-CartesianProduct([$0..N]$(P-1))); 

I have formally reported this bug. However, this bug is not manifested by the OP's slightly simpler expression A.

First 124 125 126 127 128 129 130 Last Page 126 of 708