acer

32490 Reputation

29 Badges

20 years, 7 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@tomleslie First thing: ArrayTools:-Append acts in-place on its rtable argument. In the given example it is applied to the value assigned to the parameter Rx1. The parameter Rx1 (of the procedure Sort4) is not being assigned a value or being otherwise used illegally when ArrayTools:-Append acts on its assigned (rtable) value.

Second thing: round-bracket indexing into rtables (Vector, Matrix, and Array), aka "programmer indexing", was introduced in Maple 12 (released 2008). See ?updates,Maple12,programming 

The old (lowercase) matrix and array are both implemented internally using a table.

Several of the old linalg commands have early code like, say,

proc(A)
   B := evalm(A);
   ...(operations on elements of B)...

or similar. Generally the linalg commands did not offer in-place semantics. The newer uppercase Matrix and Array with dense storage are based internally on the newer rtable (ie. rectangular table, because elements are stored in a continguous rectangular block of memory to allow efficient use by external compiled routines).

Unlike a table, an rtable does not have last-name-eval. But an rtable is indeed generally passed by reference (which I suspect contradicts a claim above). No copy is made on a procedure pass because eval works differently on an rtable (hence the later need for rtable_eval).

The example with elementwise sqrt~ works on a full copy because map does so (as a special case), and not because Matrices are in general passed by value.

The reason for this handling of tables is that they are mutable and the behaviour is more generally useful than not. Eg. in-place argument passing, which is not beneficial merely for memory performance.

I recall looking at this before, where some branches of the piecewise are evaluated prematurely. IIRC it's related to stuff around showstat(`eval/piecewise`,15).

@Adam Ledger You identified three steps. Making the "pre execution" action of step 3 to be automatic is the least of the difficulties.

For steps 1 and 3 you could wrap all your commands in a call to a prodecure you write. Eg. B( intended_command_here ) . Making step 3 (or 1) automatic -- without the wrapping call -- is a finesse that could well wait until last.

For step 1 you need to measure the performance of executed commands and record the details in a way that can be analyzed in step 2. You could use commands from the CodeTools package for most of the measurement, I expect.

The central difficulties will be in step 2. The computations in general will not exhibit patterns that could be predicted statistically. You will have to severely restrict the kinds of computations to a relatively few narrow domains if there is to be a hope of successful data mining and predicition as you describe it. So far you have given no indication in this thread of any tight and narrow domain of computation. I suspect that you do not properly conceive of the enormity of what you seem to be asking more generally.

The breadth of the computational domain aside, who is going to devise the data mining of step 2 and the statistical prediction methodology of step 3? That would require programming acumen and, I expect, considerably more detail as to the computational domain.

What have you accomplished so far on this project?

This is a very ambitious project for someone (ie. you) who is not well versed in how Maple's kernel and interfaces work and interoperate.

Since I am sure that you do not yet know how to properly and generally accomplish the described goal I've changed the parent from Post to Question. (I'm trying to be pragmatic here, and I truly intend no offense.)

This would be a good time to fully describe the requirements, e.g. what will the user see as input interface (the usual, or just a single reusable container)? Where will the output go? etc.

I have two prototypes of a general purpose Maple interface involving all input and output via 3 embedded components (input, output, and plotting). The purpose is to have something that works in the maplecloud or MaplePlayer. One of them also has a dynamic menu driven interface to the right click context menus.

Hence, if you tell me what user interface you're after then I may well be able to offer advice on the hurdles I know will appear. (Eg. managing the history of input and output assignments is desirable but heavy work.)

A more basic all round effect might be attainable, while keeping the usual worksheet flow, by replacing the kernel evaluator. I've had experience with that too.

But the detailed requirements are needed from you first.

@Adam Ledger This member (under one handle or another) has been posting here since long before your handle has actively posted here.

@asa12 Upload your complete code here if you expect us to work with it.

@Lali_miani See here for a list of books on Maple.

The first one listed, by Ian Thompson, is good and very reasonably priced.

An older book by Andre Heck is also good (it may not describe all modern features, but it laid out the basic concepts quite well).

Another good (but again slightly older) book is by Doug Meade et al.

 

 

Nobody wants to re-type your Matrices from images.

Upload a worsheet that contains the actual values for the Matrices or the complete code to reproduce them.

Code that contains, say,  close3(tt+Jesus[H][1,1]+i) without any code to evaluate that to a real constant value is of no use.

I had hoped to obtain the desired output display using a function call to Typesetting:-menclose with an argument something like notation="strikethrough", alongside other Typesetting calls.

But I have not been able to get a properly rendered display, with this approach.

@Christopher2222 If you upload it zipped somewhere then I would have a go with `vi`, a very strong editor.

I'm not sure that your editing methodology would be just the same as mine, wrt output removal.

If all else fails would you be ok with a version of the file that had all its output removed?

If so then you could upload it (here or somewhere), preferably zipped.

@vv  I stand by my comment.

The numeric  rank should enumerate how many singular values are greater than a tolerance times the largest singular value. That's not always equivalent to the number of nonzero singular values (including application of fnormal), which is generally not as adequate.

Btw, how does the computed result change for this example, as Digits gets gradually increased?

First 258 259 260 261 262 263 264 Last Page 260 of 594