From 5a41381fe8b9248242b10a3639ee4e0e096baf0a Mon Sep 17 00:00:00 2001 From: Benjamin Brands Date: Tue, 6 Feb 2018 16:41:17 +0100 Subject: [PATCH] add ScaLAPACKMatrix.copy_transposed() --- include/deal.II/lac/scalapack.h | 8 ++++++++ source/lac/scalapack.cc | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/include/deal.II/lac/scalapack.h b/include/deal.II/lac/scalapack.h index 9f701bfbc7..934b2fea7b 100644 --- a/include/deal.II/lac/scalapack.h +++ b/include/deal.II/lac/scalapack.h @@ -191,6 +191,14 @@ public: const std::pair &submatrix_size) const; /** + * Transposing assignment: A = BT + * + * The matrices A and B must have the same process grid + * + * Following alignment conditions have to be fulfilled: MB_A = NB_B and NB_A = MB_B + */ + void copy_transposed(const ScaLAPACKMatrix &B); + /** * Matrix-addition: * diff --git a/source/lac/scalapack.cc b/source/lac/scalapack.cc index e815bc1911..be2cd3391f 100644 --- a/source/lac/scalapack.cc +++ b/source/lac/scalapack.cc @@ -441,6 +441,10 @@ ScaLAPACKMatrix::copy_to (ScaLAPACKMatrix &dest) const template +void ScaLAPACKMatrix::copy_transposed(const ScaLAPACKMatrix &B) +{ + add(B,0,1,true); +} -- 2.39.5