- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi Michael,

You are right ifyou have *N* columns in your matrix *A, *then*LDA=N* for row-major case.

In general leading dimension is equal to the number of elements in major dimension.Also it isequal to the distance in elements between two neighbor elements in a line of minor dimension.

Thusif you have no extra elements in your matrix with *M* rows and *N* columns, then:

- In row-major case: row *i*lays in memory right after row *i-1*and thus *LDA=N* - number of elements in row.

- In column-major case: column *i*lays in memory right after column *i-1*and thus *LDA=M* - number of elements in column.

If you refer to a submatrix ( *m *x *n* )then you use as leading dimension the number of elements in major dimension of the whole matrix (as above)while*m* and*n* in subroutine's inputparametersdescribes the size of the submatrix.

You are welcome.

Alexander.

Link Copied

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi Michael,

You are right ifyou have *N* columns in your matrix *A, *then*LDA=N* for row-major case.

In general leading dimension is equal to the number of elements in major dimension.Also it isequal to the distance in elements between two neighbor elements in a line of minor dimension.

Thusif you have no extra elements in your matrix with *M* rows and *N* columns, then:

- In row-major case: row *i*lays in memory right after row *i-1*and thus *LDA=N* - number of elements in row.

- In column-major case: column *i*lays in memory right after column *i-1*and thus *LDA=M* - number of elements in column.

If you refer to a submatrix ( *m *x *n* )then you use as leading dimension the number of elements in major dimension of the whole matrix (as above)while*m* and*n* in subroutine's inputparametersdescribes the size of the submatrix.

You are welcome.

Alexander.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page