Jean-Claude Arbaut

Mr. Jean-Claude Arbaut

72 Reputation

One Badge

3 years, 314 days
I used briefly Maple in the late 90s during my undergraduate studies. Back then it was Maple V r4 if I remember correctly, and a few years later Maple 6. I use again Maple since around 2018.

MaplePrimes Activity


These are replies submitted by Jean-Claude Arbaut

Now fonts display correctly even with font antialiasing disabled. I believe this comes from the switch to Java 15. Though not a big enhancement, it's very nice, as I can't bear font antialiasing.

A little regression: when executing a group, the cursor jumps on the second line of the next group (or sometimes at the end of that group), when there is more than one.

@tomleslie 

Slightly shorter with a seq:

(assign('x', 11), " it was 10")

@Carl Love 

Yes, I saw the "uses" clause in your code, which I didn't know, and even though I didn't use it in my preceding function, I will certainly in the future.

I also learned about typing parameters (I knew this, but I understand that typing is much more flexible than I thought). As well as a few tricks for functional programming, with @and ~ (I knew them, more or less).

There is one thing, though, that I have already seen in Maple library source, and I didn't see it yet in the documentation: what do those ':-' mean in quoted symbols, such as ':-symmetric'? I know the syntax package:-function, but what about this usage?

Edit: I found it in the manual (it's simply '?:-'): The ":-" operator can also be used as a unary, prefix operator, whose sole operand is a symbol. The expression :-sym evaluates to the global instance of "sym", even if there is a local binding for "sym" in scope.

 

Thanks for your help.

@tomleslie 

Thank you too. Fortunately the problem mentioned by Carl Love didn't occur in my case because I don't have bidirectional edges, but it may happen of course.

@Carl Love 

Thank you!

In the meantime, I also found a workaround, though it's not as advanced syntax:

Dir2Undir:=proc(G)
  local W:=WeightMatrix(G),d:=ArrayTools[Diagonal]@@2;
  W+=W^%T-d(W);
  Graph(Vertices(G),map(convert,Edges(G),set),W)
end;

Of course, it would need some polishing to check input, and it would fail on an undirected graph.

By the way, I learned new programming tricks with your answer, so thank you for this too.

@Mac Dude 

I can't help you with your config, but I can tell you what I get with the basic CUDA example (?CUDA in Maple).

For all values of n between 1000 and 8000, the matrix product is always faster without CUDA (around 30%-40% faster).

The program does not raise an error, and I can see in the task manager that the GPU is actually used when enabling CUDA in Maple. In Non CUDA mode, all 8 CPU cores are used 100% speed. In CUDA, however, the task manager tells me the GPU is used up to 12%. No idea why.

Config: Maple 2020.2, Windows 10, CPU: i7-9700K (8 cores), GPU: Nvidia RTX 2060, 16 GB RAM.

Conclusion: for the time being, considering my hardware, I don't see a reason to use CUDA in Maple.

@acer 

 

Maybe Intel oneAPI with its new OpenMP offload to GPU? I don't know yet how it behaves but it looks promising, and I believe it was the point of Intel switching to these new compilers.

@vv It's doing exactly what I was looking for. I'll give it a try. Thanks!

After another attempt, it works with:

int(piecewise(x^2+y^2<=1,1,0),[x=-1..1,y=-1..1]);


Initially I didn't even think Maple would yield a different result than with Heaviside, but apparently it does.

I'm still interested to know if there are better ways.

(answering as my comment to acer's answer was removed as well as his answer, and it might be useful to the reader passing by)

I think I got it. The problem is not so much n, as I don't see how it would be evalf'ed before entering u. The problem is 1.

If I understand correctly, in u(n)$n=1..10, if there are quotes around u(n), Maple will build u(1),u(2)... as expected, and evaluate with an integer n.

Without quotes, it's evalf'ed first, but since n is not yet known I thought nothing happens. Wrong! The expression is evalf'ed as much as possible, which means n remains a symbol, and 1 is replaced by an sfloat, and when n is replaced, there must be some type promotion from integer to sfloat, and everything is evaluated as if n was passed as an sfloat.

Good to know.

@acer 

I think I got it. The problem is not so much n, as I don't see how it would be evalf'ed before entering u. The problem is 1.

If I understand correctly, in u(n)$n=1..10, if there are quotes around u(n), Maple will build u(1),u(2)... as expected, and evaluate with an integer n.

Without quotes, it's evalf'ed first, but since n is not yet known I thought nothing happens. Wrong! The expression is evalf'ed as much as possible, which means n remains a symbol, and 1 is replaced by an sfloat, and when n is replaced, there must be some type promotion from integer to sfloat, and everything is evaluated as if n was passed as an sfloat.

Good to know.

Page 1 of 1