Dave L

Dave Linder

472 Reputation

16 Badges

15 years, 305 days
Maplesoft
Software Architect
Waterloo, Ontario, Canada

 

Dave Linder
Mathematical Software, Maplesoft

MaplePrimes Activity


These are replies submitted by Dave L

Right! `KP` is what LinearAlgebra:-KroneckerProduct does for the exact case. So it's hardly surprising that it too is much slower than the full LinearAlgebra:-_Main:-KroneckerProduct routine when dealing with float Matrices. You haven't done anything 'wrong". This just illustrates what differences there are in approach.

Consider: LinearAlgebra:-KroneckerProduct calls LinearAlgebra:-LA_Main:-KroneckerProduct. And that latter routine splits according to the case of exact versus float. If the data is exact, it uses code just like `KP`. If the data is float then it is free to convert the data to float[8], construct a much lighter float[8] result container, and then do the entire computation in external compiled C.

All the posted versions at top are much slower than LinearAlgebra:-KroneckerProduct for float Matrices. And they consume much more memory since -- unlike LinearAlgebra:-KroneckerProduct -- they havn't been designed to return a float[8] matrix as the result. They use fundamentally different approaches from what LinearAlgebra:-KroneckerProduct does in the float case. It doesn't make much sense to compare them in that way -- except of course for the purpose of seeing how different they behave.

It might make sense to compare LinearAlgebra:-KroneckerProduct to new versions of the posted codes, redesigned for floats.

Or it might make sense to to compare the posted routine `KP` to the others originally posted (ideally for exact examples), since that looks like the exact case code inside LinearAlgebra:-KroneckerProduct. I guess it might be kinda sorta interesting to compare `KP` against the others originally posted on large float examples, just as an experiment (while ackowledging that was not the designed purpose, but at least it's a "fair" comparison).

It makes sense to compare `KP` against the posted versions. Or to compare LinearAlgebra:-KroneckerProduct against the posted versions for exact examples (large of small). It doesn't make a lot of sense to compare LinearAlgebra:-KroneckerProduct against the posted codes (or `KP`), for float examples.

The `KPKP` routine posted ran ok for me, without accessing out of range. Is it actually fastest on the original small exact symbolic test example?

Dave Linder
Mathematical Software, Maplesoft

@Axel Vogt Thanks, Axel. I'll enter it now.

I hope that Mapleprimes encourages submission of SCRs, in an ongoing and visible way.

So far, I recall only seeing a single post to the new Mapleprimes with 8 thumbs up votes, and only a couple of posts with 7 up votes. There are relatively few posts with more than 4 up votes, so far. On that scale, this post's 7 thumbs up and 0 down votes indicates that the active voting community is strongly in favour.

Dave Linder

@John Fredsted Please, repeated construction of lists like this is a bad thing to do, especially when there are alternatives which are just as easy. It's a classic mistake. It's using the wrong data structure for the job.

@John Fredsted Please, repeated construction of lists like this is a bad thing to do, especially when there are alternatives which are just as easy. It's a classic mistake. It's using the wrong data structure for the job.

The version of MKL used in Maple 14 was updated, for both 64bit and 32bit Maple on MS-Windows. See the first section (when expanded) of the What's New efficiency help page.

Dave Linder
Mathematical Software, Maplesoft

This original blog has a comment with a link to what now appears to be a missing file.

@herclau, see also a little more on the benefit, from an original post (before it got implemented within SingularValues).

Also, you are doing floating-point calculations, so SmithForm is not really appropriate. The SVD is what you want here.

@all, John's cylon icon was made using an image approximation based on SVD computations.

Dave Linder
Mathematical Software, Maplesoft

@herclau, see also a little more on the benefit, from an original post (before it got implemented within SingularValues).

Also, you are doing floating-point calculations, so SmithForm is not really appropriate. The SVD is what you want here.

@all, John's cylon icon was made using an image approximation based on SVD computations.

Dave Linder
Mathematical Software, Maplesoft

I will record these details (SCR), including the other erroneous result of 0.

Dave Linder
Mathematical Software, Maplesoft

I am reminded to update these two help pages (1, 2).

Dave Linder
Mathematical Software, Maplesoft

I am reminded to update these two help pages (1, 2).

Dave Linder
Mathematical Software, Maplesoft

I submitted an SCR (bug report) for this topic this afternoon, including the details.

Best regards,
Dave Linder
Mathematical Software, Maplesoft

I submitted an SCR (bug report) for this topic this afternoon, including the details.

Best regards,
Dave Linder
Mathematical Software, Maplesoft

Overwriting any of Maple's own system .lib or .mla files, and even toggling them as writable temporarily, is a Really Bad Idea. I truly hope that no other user will follow that unsafe advice.

Create your own personal .mla archive in a folder of your own (not Maple's primary lib folder), savelib to that, and then set libname in subsequent sessions in order to access that .mla.

You can add the command which appends to libname in your (personal) Maple initialization file.

Dave Linder
Mathematical Software, Maplesoft

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