acer

33193 Reputation

29 Badges

20 years, 212 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@Markiyan Hirnyk One can consider the diagonalization of symmetric C instead, where C has dimensions m-by-m.

Let r=Rank(C). Take A=X and B=E.X^%T where E is the r-by-r diagonal Matrix of nonzero eigenvalues of C, and where X is the m-by-r Matrix whose columns are the orthonormal eigenvectors corresponding to those nonzero eigenvalues of C.

Then it should hold that C = X.E.Transpose(X) = A.B as well as that X.Transpose(X)=IdentityMatrix(m).

Then B.A = E.Transpose(X).X = E.

I used the singular value decomposition of C before, with X=U, in part because Maple returns that with S the singular values already sorted, so its easier to construct E with only nonzero eigenvalues. (That relates to C being symmetric.) 

So then one can note (by computation) that your 3-by-3 symmetric Matrix C with rank=2 is diagonalizable and has a repeated eigenvalue of value 9 (with multiplicity 2).

@xcyborg Aren't you closing the bracket too early in that first `printf` call? Don't you want M(t,t+1) to be the seventh value after the format string? Ie, the eighth argument.

@Carl Love Do you see better performance if passing the option compile=true to the dsolve/numeric step?

This kind of plotting with an image as surface texture (either image file, or ImageTools Array) can be accomplished directly in Maple 18. See here and ?plot3d,options

Eg,

restart:
with(ImageTools):
im:=Read(cat(kernelopts(mapledir),"/data/tree.jpg")):
im:=Scale(im,0.5):

plot3d(1, x=0..2*Pi, y=0..Pi, coords=spherical, style=surface,
       image=im, orientation=[-100,-70,170]);

plot3d(1, x=0..2*Pi, y=-Pi..Pi, coords=toroidal, style=surface,
       image=im, scaling=constrained, orientation=[-70,-40,180]);

GUI performance is better if the image dimensions are not large.

acer

Maple 18 has this as a new feature for 2D plots. See the `size` option described on ?plot,options

acer

Maple 18 has this as a new feature for 2D plots. See the `size` option described on ?plot,options

acer

The Online Help now reflects version 18.

Overview of What's New

Index of New Commands and Packages in Maple 18

The sidebar browser on that page also shows more details of individual enhancements that do the product pages off the main corporate website. Eg, here.

And code (where it appears) shows in a larger font, at this time. Eg. compare this with this.

I interpreted the question as being one in which the relative multiplicity of members would not matter, and that mere membership in the second list would warrant its removal. I noticed the discrepency in results and figure that the OP had made a typo.

The operation is not well defined by the provided single example alone, though it might be guessed correctly.

It seems a bit unusual to me, if the multiplicities must match exactly but the order doesn't matter.

Anyway, if I misinterpreted the question, then just ignore my answer.

@Christopher2222 You wrote, "rosettacode updates from Maple users are old and almost non-existant."

Are you suggesting that Maple users add entries? Have you contributed?

@henrylyl I downloaded a new installer for the MaplePlayer yesterday. The installer was named MaplePlayer18WindowsX64Installer.exe .

I installed it, but it does not have a restart icon on the menubar.

@Christopher2222 Well, if you don't have a definition for where some border may start or finish then chopping the eyeballed image with simple rtable indexing might suffice.

For the above code (leading up to that assignment of a procedure to `p`, one could instead have,

restart:
with(ImageTools):

img1 := Read(cat(kernelopts(homedir),"/Documents/circshift/13ydvt0.jpg")):
img2 := Read(cat(kernelopts(homedir),"/Documents/circshift/30rkxvt.jpg")):

img1,img2:=img1[1+2..-1-2,1+2..-1-2],img2[1+2..-1-2,1+2..-1-2]:
img1,img2 := Scale(img1,1..184,1..184),Scale(img2,1..184,1..184):

with(ArrayTools):
A:=Reshape(img1,[1..184*184]):
B:=Reshape(img2,[1..184*184]):

and so on. That produces this result image:

 

@acer After corrections mention in the bracketed update paragraph in my Answer above, I get these as the two input images and the final result.

I notice that there is a border artefact in the final result (but not so severe as when the first input image had been padded, which made the computed minimal more visually invalid IMHO). I expect that the results would be much better if any thin pure black border were first trimmed off the two input images.

 

@Kitonum Pardon if this is mere nit pciking, but it might be closer to exactly what is asked if the procedure itself prints the plot (and returns nothing, as asked). So, perhaps,

P:=proc(N::posint, F::appliable)
  uses plots,plottools;
  print(display(seq(seq(disk([i,j],0.1,color=`if`(F(i,j),red,blue)),
                        i=1..N),j=1..N),axes=none));
  NULL;
end:

P(7,`>`);

P(10, (i,j)->isprime(i+j) and i::odd);

@Christopher2222  It might be possible to allow the C compiler to squeeze out a bit more, by using float[4] single precision in the Compiled version. I'm not sure.

I would expect almost linear speedup on multi-core, if what I wrote were modified a bit to allow parallel computation across split partitions of Array C (ie. for subranges of the offset used, `c`). And I would not be surprised if there were another factor speedup on top of that, related to getting rid of use of `irem` as mentioned in the comment above. Who knows... the whole set of possible offsets might be handled in just a second or two. But keep in mind that 184x184 is a small image and the total time will likely grow linearly wrt both image height and width in pixels.

 

 

There should also be savings by case-splitting according to the magnitude and sign of s, i , N^2 and there differences, and thus removing the call to irem in the loop.

First 373 374 375 376 377 378 379 Last Page 375 of 607