Carl Love

Carl Love

28150 Reputation

25 Badges

13 years, 350 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

I just shortened the code of ConormalProduct by 8 lines. Perhaps that'll make it easier to understand.

At this point, I suspect that this bug only happens when coercion is used with keyword parameters. I also suspect that there's nothing special here about modules or objects; the bug comes from mixing these three things: keyword parameters, coercion, and the debugger.

These are only guesses.

@ijuptilk Another option is to replace the for or seq with this single line:

w:= gamma__1*alpha/~(4*k__1*~qq^~2/d^2-~alpha__3*xi/eta__1);

This is called elementwise operation: acting on all the elements of a list (qq) in a single operation. Note that this also eliminates the need for m.

What do you want the procedure to output/return? If you want some plots, your procedure doesn't have any plot commands to return. Do you want to return the 30 values of w? In its current form, the procedure only returns the 30th value of w, but it could be easily modified to return them all.

@nm Okay, I got the error. It seems like the debugger does not respect that ':-ic' is an unassigned global symbol. That is shown by the keyword argument becoming [ ]= [ ] as seen in the error message. And I agree that that lack of respect has something to do with using either form of coercion with a keyword parameter.

@vs140580 Yes, there's some new $ syntax in Maple 2022. Try this:

restart
:
RelationGraph:= proc(f, V::list({integer, symbol, string}))
local n:= {$1..nops(V)}, i, F:= i-> j-> f(V[i],V[j]);
    GraphTheory:-Graph(V, [seq](select(F(i), n, _rest), i= n))
end proc
:
ConormalProduct:= proc(
    G::Graph, H::Graph, {vertex_format::{string, symbol}:= "%A:%A"}
)
local Vg, Vh, E, P, i, j, Vgh, J;
    (Vg,Vh):= GraphTheory:-Vertices~([G,H])[];
    E:= op~(4, [G,H]);
    P:= [seq](seq([i,j], j= 1..nops(Vh)), i= 1..nops(Vg));
    Vgh:= (curry(sprintf, vertex_format)@((i,j)-> (Vg[i],Vh[j]))@op)~(P);
    J:= op~(table(Vgh=~ P));
    RelationGraph((a,b)-> ormap(i-> J[b][i] in E[i][J[a][i]], [1,2]), Vgh)
end proc
:

 

@nm Once you're in the debugger, what commands do you give to produce the error message? I've never used this, or any other, debugger.

@Alger Okay, your matrix is not truly tridiagonal, and, of course, I didn't see that you said that. So, the tridiagonal solver won't work, at least not directly. 

Is this true?: The nonzero entries are primarily on the 3 principal diagonals; there are "a few" elsewhere. If so, how many is "a few"? What is their pattern, if any?

Or perhaps you mean something like this: Let G be a graph with n vertices and 0 edges. Then G^k = G for any k >= 1. Any permutation of G's vertices is isomorphic to G^k, and all of these permutations are trivially edge disjoint. So, in this case we could say "There are n! edge-disjoint isomorphisms of G in G^k." Is that what you have in mind? Then, extending that idea, I see that perhaps there are some cases of a very sparse G being multiply embeddable in G^k.

I think that I must have the wrong idea about this because I don't see how there could possibly be more than 1 copy of G in G^k. Would you please give an example?

Yes, I know. But the OP said that they do  have a tridiagonal system, so the trivial solver will work for them. The OP seems to be ignoring this Answer. 

@Ronan That's the only thing that I pointed out because that's the only thing that you need to change to solve your entire problem of multi-line descriptions.

I was able to download the worksheet, no problem.

@mehdibgh If I recall correctly, there was once a time when garbage collected memory was not deallocated and returned to the O/S. However, that memory was still available to Maple. But for at least several years now, it is deallocated and that number you see on the status bar can go down. I don't think that the deallocation is done after every single garbage collection, but it's done often enough. 

@ijuptilk You can remove 0, or any other specific value, from a list soln by

remove(`=`, soln, 0)

First 81 82 83 84 85 86 87 Last Page 83 of 711