Copy a submatrix to another matrix.

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.

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

"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?

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.

Leave a Comment

Please sign in to add a comment. Not a member? Join today