Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

Copy a submatrix to another matrix.

Kydon_G_
Beginner
358 Views

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.

0 Kudos
2 Replies
Gennady_F_Intel
Moderator
358 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?

0 Kudos
Kydon_G_
Beginner
358 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.

0 Kudos
Reply