acer

32832 Reputation

29 Badges

20 years, 134 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

I agree with you, Patrick. Finding old Comments is overly difficult. I too have been frustrated and unable to find some old Comments, due to the missing lists you mention. Sometimes, even when I know who the author was.

But searching this site is harder than it ought to be in general. Sometimes I wonder whether material within <pre> tags is indexed. (It'd be awful if it weren't, as a lot of searches depend on some maple code word, and that mark-up is popular and useful for code. ...but it might explain some things.)

All member's blogs were done away with, with the arrival of the "new" mapleprimes. Old blog posts weren't deleted, but they became merely Posts. I found that disappointing, as the blog lists for Joe, Jacques, Alec, Doug, Axel, etc, were convenient and the contents were very interesting. Some people have subsequently gone back and given such posts (of their own) the blog "tag". The corporate blog site was merged into mapleprimes at this time.

I think that a large part of the value of this site is in its stockpile of material by its members. But without really good searching and indexing it just becomes a conveyor-belt of (free, one-off) tech support. But throwing away any of the content after its initial submission, by making it too hard to find, is wasteful.

acer

I use both Primes and the Cloud for sharing.

I don't post to the "public" Cloud group since it is full of (accidentally?) misplaced assignment submissions for college courses. Either some course instructors don't bother to create distinct groups for their course submissions, or the students don't submit properly, or don't delete from "public" after realizing a mistaken submission. Totally empty sheets can get flagged and removed, but nobody cleans up the many old or misplaced assignments there. Sorry to sound uptight about it, but the amount of clutter detracts from the forum.

I created a Cloud group where I upload (some of the longer) worksheets that I post on Primes. Feel free to "join". See my profile page for a little more detail.

I also use the Cloud as a convenient way to access material of my own when running Maple from different locations.

acer

@Kamel Yes, that's possible. But you have to know how many nonzero entries are in `a`.

Here's that rewritten, where you know in advance that there are 15 nonzero entries in `a`.

a := Vector[row](110000,[1.3,1.4,1.5,1.6,1.0,1.0,-1.0,2.0,2.0,
                      3.0,-2.0,1.0,-2.0,1.0,1.0], 
                  datatype=float[8]):

 irow := Vector[row](110000,[4,4,4,4,1,1,2,2,2,3,3,4,4,4,4], 
                  datatype=integer[kernelopts('wordsize')/8]):

 icol := Vector[row](110000,[1,2,3,4,2,3,1,3,4,1,4,1,2,3,4], 
                  datatype=integer[kernelopts('wordsize')/8]):

A:=Matrix(5,5,storage=sparse,datatype=float[8]):
 for i from 1 to 15 do
    A[irow[i],icol[i]]:=A[irow[i],icol[i]]+a[i];
 end do:
A;

Now let's try to find out that number, 15.

> rtable_num_elems(a,'NonZero');
                               15

So it looks like it could be done as,

restart:
a := Vector[row](110000,[1.3,1.4,1.5,1.6,1.0,1.0,-1.0,2.0,2.0,
                      3.0,-2.0,1.0,-2.0,1.0,1.0], 
                  datatype=float[8]):

 irow := Vector[row](110000,[4,4,4,4,1,1,2,2,2,3,3,4,4,4,4], 
                  datatype=integer[kernelopts('wordsize')/8]):

 icol := Vector[row](110000,[1,2,3,4,2,3,1,3,4,1,4,1,2,3,4], 
                  datatype=integer[kernelopts('wordsize')/8]):

A:=Matrix(5,5,storage=sparse,datatype=float[8]):
 for i from 1 to rtable_num_elems(a,'NonZero') do
    A[irow[i],icol[i]]:=A[irow[i],icol[i]]+a[i];
 end do:
A;

Of course, as you mentioned, `irow`, `icol`, and `a` all have the same number of non-zero entries, all packed up at the front.

I don't really understand why you have to make those three Vectors so large (size 110000). Is that supposed to be the largest possible number of values your code might in principal require to specify? Do you really need to store them separately and explicitly, or could you make them storage=sparse and initially short too? Or could you instead just curate the data by directly adding into sparse Matrix A, and omitting those three Vectors altogether?

acer

@Kamel Yes, that's possible. But you have to know how many nonzero entries are in `a`.

Here's that rewritten, where you know in advance that there are 15 nonzero entries in `a`.

a := Vector[row](110000,[1.3,1.4,1.5,1.6,1.0,1.0,-1.0,2.0,2.0,
                      3.0,-2.0,1.0,-2.0,1.0,1.0], 
                  datatype=float[8]):

 irow := Vector[row](110000,[4,4,4,4,1,1,2,2,2,3,3,4,4,4,4], 
                  datatype=integer[kernelopts('wordsize')/8]):

 icol := Vector[row](110000,[1,2,3,4,2,3,1,3,4,1,4,1,2,3,4], 
                  datatype=integer[kernelopts('wordsize')/8]):

A:=Matrix(5,5,storage=sparse,datatype=float[8]):
 for i from 1 to 15 do
    A[irow[i],icol[i]]:=A[irow[i],icol[i]]+a[i];
 end do:
A;

Now let's try to find out that number, 15.

> rtable_num_elems(a,'NonZero');
                               15

So it looks like it could be done as,

restart:
a := Vector[row](110000,[1.3,1.4,1.5,1.6,1.0,1.0,-1.0,2.0,2.0,
                      3.0,-2.0,1.0,-2.0,1.0,1.0], 
                  datatype=float[8]):

 irow := Vector[row](110000,[4,4,4,4,1,1,2,2,2,3,3,4,4,4,4], 
                  datatype=integer[kernelopts('wordsize')/8]):

 icol := Vector[row](110000,[1,2,3,4,2,3,1,3,4,1,4,1,2,3,4], 
                  datatype=integer[kernelopts('wordsize')/8]):

A:=Matrix(5,5,storage=sparse,datatype=float[8]):
 for i from 1 to rtable_num_elems(a,'NonZero') do
    A[irow[i],icol[i]]:=A[irow[i],icol[i]]+a[i];
 end do:
A;

Of course, as you mentioned, `irow`, `icol`, and `a` all have the same number of non-zero entries, all packed up at the front.

I don't really understand why you have to make those three Vectors so large (size 110000). Is that supposed to be the largest possible number of values your code might in principal require to specify? Do you really need to store them separately and explicitly, or could you make them storage=sparse and initially short too? Or could you instead just curate the data by directly adding into sparse Matrix A, and omitting those three Vectors altogether?

acer

@Kamel Your code fragment calls `find` and `size` on S, before it assigns to S. What does that mean?

@Kamel Your code fragment calls `find` and `size` on S, before it assigns to S. What does that mean?

If one flags an old Post with a brief note then the admins get a message. That way specific pages can get converted to Question, and their Comments to Answers.

Yes, there are a lot of old Posts that were not properly ported to Primes ver.2 in this respect. But at least the pages on which you want to up vote Answers can be handled (if manually at least).

acer

The performance of Statistics:-CovarianceMatrix was significantly improved, between Maple 13 and Maple 14.

The performance (as shown in the above Post for the Maple 12 and Maple 13 timeframes) of the CovarianceMatrix command has improved in Maple 14 to be on par with the Post's suggested implementation.

acer

The performance of Statistics:-CorrelationMatrix was significantly improved, between Maple 13 and Maple 14.

The performance (as shown in the above Post for the Maple 12 and Maple 13 timeframes) of the CorrelationMatrix command has improved in Maple 14 to be on par with the Post's suggested implementation.

acer

@David88 Don't use Units:-Natural. It will interpret many simple letters as being units, even when you don't think that you are entering them as units. (...that's why it's called "Natural", seriously). Instead, use Unit:-Standard which is appropriate for your usage where you are specifically entering units as such.

Also, it appears that you might be confused as to the dimensions of the unit `poundforce`. It is a unit of force, not of mass. (See here.)

Perhaps you meant to type something else instead of `poundforce`, such as just `pound`? (...and in which case the result of that amended example would have dimension of length^3, not length^4)

> convert(poundforce,dimensions);

                             force

> convert(poundforce/inch^2,dimensions);

                            pressure

> convert(lb*ft,dimensions);

                          mass length

> convert((lb*ft)/(poundforce/inch^2),dimensions);

                               2     2
                         length  time 

> convert(pound/inch^2,dimensions);

                             mass  
                            -------
                                  2
                            length 

> convert((lb*ft)/(pound/inch^2),dimensions);

                             volume

@David88 Don't use Units:-Natural. It will interpret many simple letters as being units, even when you don't think that you are entering them as units. (...that's why it's called "Natural", seriously). Instead, use Unit:-Standard which is appropriate for your usage where you are specifically entering units as such.

Also, it appears that you might be confused as to the dimensions of the unit `poundforce`. It is a unit of force, not of mass. (See here.)

Perhaps you meant to type something else instead of `poundforce`, such as just `pound`? (...and in which case the result of that amended example would have dimension of length^3, not length^4)

> convert(poundforce,dimensions);

                             force

> convert(poundforce/inch^2,dimensions);

                            pressure

> convert(lb*ft,dimensions);

                          mass length

> convert((lb*ft)/(poundforce/inch^2),dimensions);

                               2     2
                         length  time 

> convert(pound/inch^2,dimensions);

                             mass  
                            -------
                                  2
                            length 

> convert((lb*ft)/(pound/inch^2),dimensions);

                             volume

Nobody wrote that interface(rtablesize) does not affect all interfaces. Nobody wrote that the difference between Vectors and Arrays is just how they are printed. These aspects are simply germane to the issues at hand and that is all. Maybe I misread the tone.

acer

Nobody wrote that interface(rtablesize) does not affect all interfaces. Nobody wrote that the difference between Vectors and Arrays is just how they are printed. These aspects are simply germane to the issues at hand and that is all. Maybe I misread the tone.

acer

The problem is the trailing semicolon in the first line, as has been mentioned in answers below.

However, note that in 1D Maple notation the following also generates an error, in both the Standard GUI and the commandline interface of Maple 14. (In Maple 13 the following worked in 2D, but that bug was "fixed" for Maple 14, to conform with 1D's error.)

> u:=proc();
> local k;
> end proc:
Error, unexpected local declaration in procedure body

Similar errors are generated using full colon, or for `global` declaration or `option` statements. [edited: the explanation for this may be quite different from the explanation for the top Question in this thread. Maybe I ought to have kept quiet here.]

acer

This is at least the third posting of this question. (One was deleted.) Please stop posting duplicates.

If you have extra detail to add (like this Matrix info) then you could put it in a Comment/Answer to your earlier Question.

acer

First 448 449 450 451 452 453 454 Last Page 450 of 601