acer

32348 Reputation

29 Badges

19 years, 329 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

Firstly, you'll need outputoptions=datatype=float[8] on the RandomMatrix calls, or else Maple may spend a long time generating software float Matrices (which would just end up being converted to float[8] prior to being sent to MKL).

Next, be careful that it is the MatrixMatrixMultiply operation at which you are examining things. That will call the BLAS function dgemm (which is in ATLAS or MKL).

Also, you can compare the results of time() against those using time[real](). In Maple, the time() command returns the sum of the CPU-time spent in all threads, I believe. And time[real]() reports wall-clock time. On a machine not running any other application, the time[real]() result is close to how much CPU-time is used. Hence time() usually shows the same general result even when external code (eg, MKL) runs threaded, while time[real]() can show the speedup.

You won't see any speedup or multicore use during the RandomMatrix call, in Maple 13. I'm not sure about MatrixInverse (it can be done two ways, using lapack's inverse routine or its linear-solver routine for full rectangular storage, and both might not be implemented in every atlas/mkl version so it'd depend on which was used). The Matrix addition operation might hit something threaded in MKL, but it's only O(n^2) so the speedup would be less noticable than that in the other O(n^3) operations of multiplication and LU (for linear-solving/inversion).

acer

In 2D Math entry mode, open the "Operators" palette. The fourth and fifth items from the left in the third-to-last row are double vertical bars. Placed around a Matrix or Vector, these appear to cause LinearAlgebra:-Norm to get called. They also seem to allow subscripting the right-double-bar as a means to specify the norm.

That was in Maple 13. I didn't check Maple 12.

I'm not sure whether there is any difference between those two palette items, the Verbar and the DoubleVerticalBar. They also both appear in the Relational palette, and the DoubleVerticalBar also appears in the Fenced palette.

Unfortunately, neither appears when I tried command-completion on a single typed bar (pipe) in 2D Math mode. I will submit an SCR.

acer

What's the difficulty? Is it that you didn't expect `Norm` to invoke Student:-LinearAlgebra:-Norm? Or is it that it issues an error instead of returning unevaluated when passed an unassigned name? Why do you consider it wrong behaviour?

acer

Sure, although in your particular example the subspace spanned by the set of eigenvectors associated with that close pair (cluster) of eigenvalues is the same. I don't know whether the Original Poster's Matrix is floating-point, even if the description of the large size might hint at it. I was trying to suggest that in the floating-point scenario it'd be up to the OP to state how close eigenvalues were to be treated.

acer

Sure, although in your particular example the subspace spanned by the set of eigenvectors associated with that close pair (cluster) of eigenvalues is the same. I don't know whether the Original Poster's Matrix is floating-point, even if the description of the large size might hint at it. I was trying to suggest that in the floating-point scenario it'd be up to the OP to state how close eigenvalues were to be treated.

acer

I've suggested this elsewhere: allow the users to rate the content. If that were done, then the frontpage could have a section on top-rated content.

I have a feeling that things like the finance-ticker-stock-quote sockets code in alex_01's and Samir's posts would be the sort of fascinating content to float to the top. Also, Alec's and Robert's frequent tours de force would likely bubble to the top too.

acer

This has been improved in Maple 13.

In Maple 12.02,

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

> st,ba,bu := time(),kernelopts(bytesalloc),kernelopts(bytesused):
> Matrix(A,'storage'='rectangular','datatype'=float[8]):
time()-st,kernelopts(bytesalloc)-ba,kernelopts(bytesused)-bu;
> time()-st,kernelopts(bytesalloc)-ba,kernelopts(bytesused)-bu;
                            12.392, 2424388, 626765

In Maple 13.01,

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

> st,ba,bu := time(),kernelopts(bytesalloc),kernelopts(bytesused):
> Matrix(A,'storage'='rectangular','datatype'=float[8]):
> time()-st,kernelopts(bytesalloc)-ba,kernelopts(bytesused)-bu;
                            0.004, 2031244, 504051

The improvement is more significant as N grows. For N=1000, in Maple 12.02,

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

> st,ba,bu := time(),kernelopts(bytesalloc),kernelopts(bytesused):
> Matrix(A,'storage'='rectangular','datatype'=float[8]):
> time()-st,kernelopts(bytesalloc)-ba,kernelopts(bytesused)-bu;
                           202.032, 9828600, 2482992

and in Maple 13.01,

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

> st,ba,bu := time(),kernelopts(bytesalloc),kernelopts(bytesused):
> Matrix(A,'storage'='rectangular','datatype'=float[8]):
> time()-st,kernelopts(bytesalloc)-ba,kernelopts(bytesused)-bu;
                            0.008, 8059452, 2004043

acer

Two examples, just for illustration: eval is built-in, but can call to `eval/piecewise` a Library routine, and `*` is built-in but can call `rtable/Product` to do elementwise multiplication of two Arrays.

acer

Lots of suggestions have been made in the past.

  • Ratings of posts/responses by the reader. (This was done for apps on the Maple-Applications site, and is even more potentially useful here on account of the range of quality.)
  • Readership stats. For example, Blog posts on mapleprimes used to be dynamically marked with their number of views. Why not bring that back?
  • Favourites. The ability to mark, store locally, and view posts as favourites. There are lots of gems on mapleprimes, and managing browser bookmarks is out of vogue.
  • Fix the small things, and every now and then mention what's fixed. For example, the "profile" links were recently fixed, but who would have guessed since they were broken for 3 years? Eg, here.
  • Encourage maplesoft staff to post.
  • Encourage content (tips,techniques,blogs,whatever). Technical content can be very useful even if it does not have all the final polish of what gets on the Apps Centre.
  • Update the FAQ of what gets asked here, frequently. Make it more visible for readers (top menubar, beside forums/blogs/...?) and more easily linked-to by responders.
  • Add a mode to the top menubar's Search box, for the Online help.

It might be nice if some level of meta-tagging of threads could be done. Sometimes a question is asked and answered, and it relates to a topic with a common technical name -- say "quadrature". Now, it often happens that, unfortunately, neither the original poster or the responders will use that particular term. But such a term might be typical of what would get used to do a relevant search. So, if a new Search facility could search meta-tags, and if some subset of admins/experts/world could add salient metatags to threads, then the ability to search for a given topic would be so much better.

acer

It wasn't entirely clear (to me) that the OP wanted to do interactive things (typing, entering commands, editing, etc) while the component was being constant refreshed by the background Thread. I originally interpreted the query as being about having Maple's kernel (quietly) do other computations at the same time.

If a new, second Worksheet/Document were opened using a new (not shared) "engine", then would'nt updates to the MathContainer in the first sheet occur even while one was interacting in the second sheet? That seems to work OK, although granted continuous updates in one sheet are not so useful if one has to temporarily switch tabs in order to view results.

I'd likely just start two Maple GUI instances, if I wanted to use Maple to run a tickertape as a sideshow.

acer

It wasn't entirely clear (to me) that the OP wanted to do interactive things (typing, entering commands, editing, etc) while the component was being constant refreshed by the background Thread. I originally interpreted the query as being about having Maple's kernel (quietly) do other computations at the same time.

If a new, second Worksheet/Document were opened using a new (not shared) "engine", then would'nt updates to the MathContainer in the first sheet occur even while one was interacting in the second sheet? That seems to work OK, although granted continuous updates in one sheet are not so useful if one has to temporarily switch tabs in order to view results.

I'd likely just start two Maple GUI instances, if I wanted to use Maple to run a tickertape as a sideshow.

acer

Thanks, Robert. Yes, I did indeed do that crucial step, but forgot to mention it.

acer

Thanks, Robert. Yes, I did indeed do that crucial step, but forgot to mention it.

acer

This is Maple 13.01, Standard GUI, Worksheet mode, 1D Maple input.

> restart:

> 'LinearAlgebra:-Norm(<3,4>)';
                         LinearAlgebra:-Norm(<3, 4>)

> op(Norm);
                                    Norm

> (1);  # equation label, using Ctl-l
                                      4

> op(Norm);
                             LinearAlgebra:-Norm

The name `Norm` has not been rebound, but it prints wrongly.

Now, if I subsequently issue,

> Norm(<1,17>);
                LinearAlgebra:-Norm(<1,17>)

> (5);  # equation label of last command
                                17

acer

So that the TTY/commandline Maple interface people don't feel left out...

`\e[00m\e[03;31mThis is my text.\e[00m`;

It's the Thursday afternoon before the Friday before a long weekend.

acer

ps.

`\e[00m\e[05;35mTTY rules.\e[00m`;
First 481 482 483 484 485 486 487 Last Page 483 of 592