acer's blog

acer's picture

new package adoption

Every now and then someone will post here on Mapleprimes and the code will use an older package such as linalg or stats. Quite often it is clear that the poster is new to Maple. Yet these packages have been superceded with new ones, eg. LinearAlgebra and Statistics.

One obvious question that then arises is: how did this user decide to use the older package?

acer's picture

overloaded operators

Over on the usenet newsgroup comp.math.soft-sys.maple, someone asked about using Maple's overload facility to redefine the operators such as `*`, `+`, etc.

The difficulty for the submitter is that while overload (and option overload for procedures) can provide enhanced operators for new routines, it doesn't affect routines saved in the Maple Library which already have their bindings. Overloading does not subsequently change the bindings of the operators when used in (most all) Library routines.

One way to try and get around this is to actually redefine the global operators. And since overload is on topic, one can still use it in the replacements that one writes.

In order to redefine global operators one must first unprotect them. They are protected for a very good reason. If the replacements are not adequate then Maple can fail in a multitude of ways. It's a case of caveat emptor.

acer's picture

poll: change in Maple that you want most?

What single change in Maple would you want more than any other?

Maybe it's an enhancement, or a functionality change, or a bug fix.

Here's a first working shot at an external, programmatic mechanism for opening .mw worksheets/Documents as new tabs in an already running Maple Standard GUI session.

This involves a `sh` shell script, runnable in Unix/Linux/OSX/cygwin. Maybe someone could post a MS-Windows .bat batch file equivalent.

acer's picture

context driven help suggestions

Maple's Standard GUI has context-sensitive menus. Those are the menus that appear when one right-clicks on a output (or input, in a Dcoument).

Those context-menus can be customized.

Below is an example which adds a new submenu. The new submenu is populated automatically according to the types of thing found within the object itself.

acer's picture

undoing one form of symbolic root

In this previous post, an example is shown that demonstrates the potential problems that can arise following symbolic conversions such as from sqrt(x^2)  to x^(1/2).

acer's picture

wine 1.0

So, after many years in the making, version 1.0 of wine is released.

Can anyone say, whether it'll run Maple 12?

acer

acer's picture

int() and float input

This is one sort of Maple inconsistency that interests me. Why should the first example behave like evalf(Int(...)) and call `evalf/int` while the second example does not?

acer's picture

timelimit

I was looking at the timelimit command in Maple, and wonder about whether it might be improved .

The help-page ?timelimit says that it suspends its checks while within builtin functions. It says that, inside builtins, the time limit is "ignored".

But Maple has a lot of builtins. And significant portions of the work may go on within them. Does this make the timelimit() function not useful, from a practical point of view?

What if timelimit were to make checks whenever garbage collection (gc) ocurred? That's a safe point, no? And gc can happen within some builtins? Or what if time checks were made at the same frequency that interrupt requests were checked? Those can happen within some builtins, at safe points.

Those were my thoughts, until I tried it. The command anames(builtin) shows that rtable() is a builtin. But I have found that timelimit will function within at least some rtable() calls.

acer's picture

exploding a sparse float[8] Matrix

I was reminded of this by another thread.

It is faster to add in-place a large size storage=sparse float[8] Matrix into a new empty storage=rectangular float[8] Matrix than it is to convert it that way using the Matrix() or rtable() constructors.

Here's an example. First I'll do it with in-place Matrix addition. And then after that with a call to Matrix(). I measure the time to execute as well as the increase in bytes-allocated and bytes-used.

> with(LinearAlgebra):

> N := 500:
> A := RandomMatrix(N,'density'=0.1,
>                   'outputoptions'=['storage'='sparse',
>                                    'datatype'=float[8]]):

> st,ba,bu := time(),kernelopts(bytesalloc),kernelopts(bytesused):

> B := Matrix(N,'datatype'=float[8]):
> MatrixAdd(B,A,'inplace'=true):

> time()-st,kernelopts(bytesalloc)-ba,kernelopts(bytesused)-bu;
                            0.022, 2489912, 357907
Syndicate content
}