How to identify a specific element A[j][i] of matrix A?

Post here if you have a question about LAPACK or ScaLAPACK algorithm or data format

How to identify a specific element A[j][i] of matrix A?

Postby marcoi » Fri Nov 17, 2017 7:25 am

I do not understand how the columns (arrays) of a matrix are identified in Lapack.
For example: https://github.com/langou/latl/blob/master/include/geqr2.h#L69
A[i] is the value of the array corrisponding to the shortest dimension of the matrix A. So, if for example, the shortest dimension of A is the rows number, A[i], as far as I understood, is the value in the i-th row... is it correct?.
I read here: https://github.com/langou/latl/blob/master/include/latl.h#L25 that matrices are implemented as pointers to column-major contiguous arrays.
But to which colum of the matrix this i-th row of A[i] (in case m=min(n,m)) belongs to?

For example: in https://github.com/langou/latl/blob/master/include/gemv.h#L136
Code: Select all
               for(j=0;j<n;j++)
               {
                  temp=alpha*x[jx];
                  iy=ky;
                  for(i=0;i<m;i++)
                  {
                     y[iy]+=temp*A[i];
                     iy+=incy;
                  }
                  A+=ldA;
                  jx+=incx;
               }



temp * A[i] is added to the i-th element of the array y . And for all n columns (arrays) of the matrix A[i]
But how to identify a specific element A[j][i] of matrix A?
marcoi
 
Posts: 3
Joined: Thu May 04, 2017 7:10 am

Return to Algorithm / Data

Who is online

Users browsing this forum: No registered users and 2 guests