Showing results for

- Intel Community
- Software
- Software Development SDKs and Libraries
- Intel® oneAPI Math Kernel Library
- Copy a submatrix to another matrix.

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

Kydon_G_

Beginner

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

03-19-2014
01:28 AM

49 Views

Copy a submatrix to another matrix.

Hi! I want to copy the first 2 columns of a matrix A to the last two columns of another matrix B. A and B is matrices of size 3x3. I found that this can be done with the function p?lacpy ( I don't know if there is another routine for this)

The code I used is

#include <stdio.h> #include <mkl.h> #include "mkl_scalapack.h" int main() { double A[9]={0, 1,2,3,4,5,6,7,8}; double B[9]; int m=3, n=2, d=1; char *uplo = "All"; pdlacpy(uplo, &m, &n, A, 0, 0, ?, B, 0, &d, ?); }

I don't understand what do we select for the parameters descb and desca. I read that is " INTEGER array, DIMENSION (`dlen_`). The array descriptor for the distributed matrix A." but I don't understand what does it mean.

Thank you very much.

Link Copied

2 Replies

Gennady_F_Intel

Moderator

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

03-19-2014
02:28 AM

49 Views

"I don't know if there is another routine for thisdlacpy" -- in the case of SMP system - you can use dlacpy() routine

or you really need to use ScaLapack routines for that?

Kydon_G_

Beginner

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

03-19-2014
02:59 AM

49 Views

The function dlacpy says how to copy the upper/lower triangular part of `A`. or the whole matrix. Please correct me if I am wrong. I want to copy the first two columns of a matrix to the last two columns of another matrix- I don't understand how to do that with the dlacpy. I don't really need to use ScaLapack routines for that, I just want a routine to do that.

Thank you very much.

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

For more complete information about compiler optimizations, see our Optimization Notice.