But...

If you look at the dimension ordering in slicing
where dim(0) is the left-most index, then PDL is
actually using the same memory ordering as with
fortan: dim0 iterates first, then dim1 increases,
then dim2....

In fact sequence(3,4) is in memory in this
order: (0,0), (1,0), (2,0), (0,1), (1,1), (2,1),
(0,2), (1,2), (2,2), (0,3), (1,3), (2,3) which
is exactly the memory order of a(3,4) in fortran.

It seems the issue is that *displaying* the
data uses C ordering.  If we were to display
the data as if transposed, then PDL would seem
to me to be a column major storage system.

I wonder what would happen if matrix operations
used the natural dimension order rather than
the imposed C ordering?  It would get rid of
all the nasty transposes in the matrix multiplication
and things the tensor sums would compose naturally.

Am I the only one who thinks PDL for matrix ops is
a bit screwy---but for no good reason?

--Chris

On 6/4/2017 16:27, Grégory Vanuxem wrote:

Hi here,

https://docs.oracle.com/cd/E19957-01/805-4940/z400091044d0/index.html

Just for information.

Now, an other thing to know.

Imagine I have a 2x2 matrix.

If I write in the computer memory 4 integer’s (1-2-3-4) in one time, in C this will be in matrix representation :

1  2

3  4

But in Fortran, like in mathematics :

1  3

2  4

So operations on these two representations are completely differents.

Generaly computations on matrices are done on a very low level and use directly the memory areas (no aware of indexing scheme).

Hope that helps

__

Greg

*De : *Luis Mochan <mailto:[email protected]>
*Envoyé le :*jeudi 1 juin 2017 20:06
*À : *[email protected] <mailto:[email protected]>
*Objet :*Re: [Pdl-general] SVD

Still confusing:

On Wed, May 31, 2017 at 03:36:33PM +1000, Karl Glazebrook wrote:

> column-major all the way down, as image processing came before matrix ops and i in A(i,j) is naturally the x-axis.

but the x axis displays horizontally, as row, and when matrices are

multiplied i is interpreted as column index, i.e., as index along row.

> i.e. A[0,1] is followed by A[1,0] in memory

You mean A[0,0] is followed by A[1,0] in memory, right?

So memory is arranged as in fortran arrays (first index fastest), but

the interpretation as row and column indices is different.

Regards,

Luis

>

>

> Karl

>

>

>

> > On 22 May 2017, at 6:32 am, Chris Marshall <[email protected]> wrote:

> >

> > Please ignore the following. Just mark me confused...

> >

> > --Chris

> >

> > On 5/21/2017 15:51, Chris Marshall wrote:

> >> The row-major and col-major for PDL has always

> >> confused me since, AFAICT the PDL dimensions and

> >> slicing syntax actually are column major in

> >> memory but we print them out in row-major.

> >>

> >> Maybe one of the original PDL developers could

> >> give an explanation (of the history at least!).

> >>

> >

> >

> > ------------------------------------------------------------------------------

> > Check out the vibrant tech community on one of the world's most

> > engaging tech sites, Slashdot.org! http://sdm.link/slashdot

> > _______________________________________________

> > pdl-general mailing list

> > [email protected]

> > https://lists.sourceforge.net/lists/listinfo/pdl-general

>

>

> ------------------------------------------------------------------------------

> Check out the vibrant tech community on one of the world's most

> engaging tech sites, Slashdot.org! http://sdm.link/slashdot

> _______________________________________________

> pdl-general mailing list

> [email protected]

> https://lists.sourceforge.net/lists/listinfo/pdl-general

>

--

o

W. Luis Mochán,                      | tel:(52)(777)329-1734     /<(*)

Instituto de Ciencias Físicas, UNAM  | fax:(52)(777)317-5388     `>/   /\

Apdo. Postal 48-3, 62251 |                           (*)/\/  \

Cuernavaca, Morelos, México          | [email protected]   /\_/\__/

GPG: 791EB9EB, C949 3F81 6D9B 1191 9A16 C2DF 5F0A C52B 791E B9EB

------------------------------------------------------------------------------

Check out the vibrant tech community on one of the world's most

engaging tech sites, Slashdot.org! http://sdm.link/slashdot

_______________________________________________

pdl-general mailing list

[email protected]

https://lists.sourceforge.net/lists/listinfo/pdl-general


<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> Garanti sans virus. www.avast.com <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


_______________________________________________
pdl-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pdl-general

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
pdl-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pdl-general

Reply via email to