AddAlongDimension with float[8]

alec's picture
A:=Matrix(2,3,1,datatype=float[8]);
                             [1.    1.    1.]
                        A := [              ]
                             [1.    1.    1.]

ArrayTools:-AddAlongDimension(A);

                               [2., 2.]

B:=Matrix(3,10,1,datatype=float[8]);

             [1. , 1. , 1. , 1. , 1. , 1. , 1. , 1. , 1. , 1.]
             [                                               ]
        B := [1. , 1. , 1. , 1. , 1. , 1. , 1. , 1. , 1. , 1.]
             [                                               ]
             [1. , 1. , 1. , 1. , 1. , 1. , 1. , 1. , 1. , 1.]

ArrayTools:-AddAlongDimension(B);

                             [3., 3., 3.]

In other words, it adds only the number of columns equal to the number of rows. With datatype=anything seems to be OK.

Alec

software change request

Hi Alec,

Have you seen the mechanism on mapleprimes introduced during your quiet period, called "Submit Maple Software Change Request"? It's a euphemism for "submit a bug report".

 

alec's picture

Bug reports

This way it might get a better attention. For large array sizes this thing crashes Maple.

Alec

submitted

I submitted this.

alec's picture

Thank you

Joe,

Thank you.

Perhaps it is related to the same indexed evalf bug - I haven't looked into details.

Alec

acer's picture

the cause

The problem appears to be line 30 (Maple 12) of the routine ArrayTools:-AddAlongDimension2D .

> restart:
> kernelopts(opaquemodules=false):
> showstat(ArrayTools:-AddAlongDimension2D);

The line (30) which creates the object to contain the result looks like,

  x := Vector[row](nrows,('datatype') = Datatypey);

It should probably instead be,

  x := Vector[row](ncols,('datatype') = Datatypey);

That Vector is acted on in-place by NAG f06ecf which is really just the BLAS function daxpy. Line 33 shows that it will try to add ncols entries from y to whatever is already in ncols entries of x (since incx the x stride is 1). So x better be of length at least ncols (and not just nrows which in this example is smaller).

acer

alec's picture

Crashes

That also explains crashes. They happened not because the arrays were large, as I thought, but because I executed AddAlongDimension (A,2) and Maple tried to add more rows than the Matrix had.

Alec

software change requests

Currently, the best ways to submit a bug report are either to send it as email to support@maplesoft.com or to submit it here using the Software Change Request (SCR) form.

Posting it here without submitting it on the SCR form runs the risk that it'll get overlooked, since it adds another layer of dependence on human actions between the submitter and the developer who ultimately gives it attention. The SCR form is a way for you to be able to submit it with greater confidence that it will get into the system.

But I don't see any objection to your posting it and submitting it. Problems in Maple that get posted here often lead to some very interesting discussions and innovative suggestions which I am sure benefit the wider mapleprimes community.

Dave Linder
Mathematical Software, Maplesoft

alec's picture

2 cents

If only I get 2 cents for every bug report I submit...

Generally speaking, why would I be interested in doing that? I don't use Maple myself other than for this site postings. The more bugs - the more posts - the more points - the more Maple Mentor Awards :)

Alec

alec's picture

Fixed in Maple 12.01

According to this announcement, that was fixed in Maple 12.01.

Alec

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}