Joe Riel

7969 Reputation

22 Badges

14 years, 348 days

MaplePrimes Activity

These are replies submitted by Joe Riel

@emendes It's mostly a memory issue.  Converting from a list to an Array will naturally double the memory consumption (i.e. same data now in two locations). If it is feasible, working entirely with an Array might be the most efficient. 

@Carl Love I'm not saying you have to declare them as static, but it doesn't hurt and seems a good idea since they are effectively static. The code I suggested works fine without the static declarations in big_car.

@acer (lost my previous reply, if this is a duplicate I apologize).  Alas, that doesn't generalize. It works only because 'name' was declared as static, which means all objects of that class have the same value for 'name'.  For a Maple object's method to access non-static locals, the object must be passed as an argument to the method.

@itsme The position of the object in the parameter list is not a requirement. I usually make the object the first parameter, but for some methods have used a different slot.

@acer Am guessing MWE = minimal working example.

@itsme From the Maple source, created in external text files, I use a shell-script, mload, also available at my github site, that loads the file into a Maple archive (mla file).  Actually, I never directly call the shell-script, rather I use a Makefile that calls mload and also installs the mla into the appropriate directory. Most of the time I don't directly call make, but rather use a hotkey in Emacs that executes the compile command which has been configured to build and install the mla (by invoking make). That configuration is achieved by a project specific .maplev file which the maplev-mode for Emacs reads whenever a Maple source file is opened.

This sounds more complicated than it is. The project Makefile is simple because most of it is common to all projects and is included into the Makefile:

# Makefile - for Bark

pkg := Bark

VERSION := 1.0.7
CLOUD-ID  := 6273820789833728
CLOUD-DESCRIPTION := A package for creating Maple shell scripts

# Activate selected make sections
BOOK := true
TEST := true

include Maple-Makefile

The .maplev file (an elisp file) is also short

(let ((proj-root "/home/joe/maple/Bark"))
   :maple-options "-B -A2 -e2"  ; configure libname and error/warning levels of Maple 
   :mint-options "-l -v -D MINTONLY"        ; -l: ignore leading underscore; -V: verbose (in smint)
   :include-path (list "/home/joe" proj-root)      ; add proj-root to the include path for Maple and Mint 
   :compile (format "make -C %s mla-install" proj-root)))

@wswain There are native distributions of GNU Emacs for Windows, that's what I use when I have to use Windows.

@acer To clarify, I've written, use, and continue to develop an Emacs-based debugger (mdcs) for Maple that does use the maplev-mode for Emacs, which I also wrote and maintain.  The debugger is a huge improvement (my biased opinion) over the interface available  in Maple in that it allows full screen debugging, stepping through the actual source code. Am currently in the process of making it easier to install.  While I almost exclusively use it in Linux, it also works with a Mac and on Windows. I've used it quite a bit with the latter, though not recently. The long pole in the tent for typical users is dealing with Emacs. Both are available at, however, neither are current there.  If anyone is interested, send me an email.

I believe that in older versions of the Maple, the following would throw an error:

proc() local i :: string; seq(i, i=1..3); end proc();

However, I may be confusing that with the following

protect(i): seq(i, i=1..3);
Error, attempting to assign to `i` which is protected.  Try declaring `local i`; see ?protect for details.

That used to cause a problem if the call to seq where in a procedure where i was not declared; seq would use the global variable which was protected and would thus throw an error. Fortunately that no longer occurs (not sure why).

@Rouben Rostamian  In maple 2020 I get

      Pi*(piecewise(j+k = 0,1,0)+piecewise(j-k = 0,1,0))

@Anthrazit Plenty of engineers prefer the way that Maple's rounding works.  My old HP 15C has three modes: fixed, scientific, and engineering.  Fixed is the style you want, retaining a fixed precision after the decimal.  Scientific and Engineering both keep the total number of digits constant; engineering keeps the exponent a multiple of 3. As an electrical engineer I exclusively used the engineering mode.  Fixed precision is more useful when addition is the primary operation, which is certainly the case for accounting and possibly structural engineering. Once multiplication is involved it makes less sense.

@Carl Love I'll be investigating this.  Thanks for the report.

@Lisa6 I believe the default install directory is /opt/maple2020.  Can you launch maple with /opt/maple2020/bin/xmaple?  Because I normally launch maple from the command line, I put links in a bin file in $PATH to the desired executables.

@mmcdara I don't quite understand how finding all types that describe an expression will help you.  However, I can make the package available and you can play with it.  I'll upload it to Maple Cloud, after first writing a few help pages and maybe extending it to handle any new relevant types.

Could you give an example?  Am trying to understand the point of calling DEBUG() at the top-level.

1 2 3 4 5 6 7 Last Page 1 of 181