Joe Riel

9660 Reputation

23 Badges

20 years, 3 days

MaplePrimes Activity


These are replies submitted by Joe Riel

This is a character between the vertical bar and the X; remove it and all is well.

I don't have a good solution.  Your goal, I presume, is to print the minimal information necessary.  That is, because order, etc. take their default values, they would be elided.  The content itself is a bit tricky; suppose you input

Matrix(3, {(1,1)=1});

In that case you might prefer to see that form, however, with more values explicitly defined you might prefer an explicit listing of the values.

It works with 1D math. You could convert all input to 1D, do the replacement, then convert back. 

Equation (4), which is supposed to be the basis function, is just the derivative of the exact solution, as given in the previous line. Presumably this is a typo.  

@Preben Alsholm That was what prompted my question.  Turns out that post is not spam, though the author would have been better off making it appear less so.

@acer Yes, that certainly is an issue with the OPs worksheet.  Not the only one.  Alas, in retesting his worksheet I found another bug in CodeBuilder.  Will upload a new version shortly.

Just the demo worksheet has the weird looking, but quite useful, 1D prompts as (**).  Probably I should change that. 

Followup

Just pushed a new version to the cloud.  The cloud version is 3.  Following is a slight rewrite of the OP's worksheet that now works. One of the bugs in it was not putting the $include statements flush left. Another was not consistently using the prefix used to hide the leading $ in the $include statements.

2-CodeBuilder_Pkg_test.mw

The tile with the yellow background, if I recall correctly. Maybe that wasn't quite it, am not sure. It didn't become a problem until the number got to three digits.  Zooming in improved the situation, at least for my eyes.

Also, when I reply to you, and just you, this site doesn't echo your user name, just an empty ampersand.

The motivation for making it more effiicient is that, with some minor tweaks, it should then be practical to use the procedures as an engine to explore the effectiveness of various strategies. 

@John May What do the color indicate?  It wasn't immediately obvious to me.  One of the colors made the numbers a bit hard to distinguish.

@Axel Vogt Ah, yes.  Looks like I misinterpreted what the problem is.  

Hi Daniel,

Nice project and post. I played the game last night---didn't do particularly well so took the liberty of stepping through some of the code. At the risk of appearing unduly pedantic I'll offer a few hopefully constructive comments. 

Transforming the matrix to allow a single scoring routine is clever. It could be done somewhat more efficiently by passing the inline option to Transpose and possibly the other routines (do they take an inline option?).  Doing so allows reusing the Matrix which reduces memory allocation.  

A somewhat simpler approach might be to write a single scoring routine that takes a Vector as an input and is passed an offset and stepsize (positive or negative). It computes the score of a single row or column and updates the Vector inplace. Then use ArrayTools:-Alias to create a Vector Alias for the Matrix and pass it to the scoring routine along with the appropriate offset and stepsize for each row or column, depending on the selected direction. The advantage (in my mind) of that approach is that the scoring routine for a single row/column is easier to write and debug, even accounting for the offset/stepsize parameters.

I'm not suggesting you make any changes, just sharing some thoughts.

The truly amazing feature of the SMOG index is the four digits of precision of the constants in the formula. Hard to believe that sqrt(...) + 3 wouldn't suffice.

It would be interesting to see the score of some of the spam that used to plague this site but, thankfully, no longer appears.

@Carl Love I didn't want to use an eval with a seq because it seemed a bit crude (no offense).  However, I wasn't wild about my directly assigning to u, which prevents reexecuting the previous part without a restart. A nicer approach would have been to just change the symbol to avoid that issue and then assigning:

assign(subs([u=U, v=V], op(Sol)):
U := Matrix(25,U):

Check the frequency of garbage collection.  The default Usage output settings display the number of times garbage collection occurred. You can adjust the occurrence of gc using kernelopts.

Without an example its hard to be sure what your issue is. A usual approach is to pass an optional procedure to collect that is applied to each of the coefficients, say

collect(expr, x, factor);
First 29 30 31 32 33 34 35 Last Page 31 of 195