# include <cfenv>
#endif
+// Intel-MKL specific functions
+#ifdef DEAL_II_LAPACK_WITH_MKL
+// see
+// https://software.intel.com/en-us/mkl-windows-developer-guide-using-complex-types-in-c-c
+# define MKL_Complex8 std::complex<float>
+# define MKL_Complex16 std::complex<double>
+# include "mkl_trans.h"
+#endif
+
extern "C"
{
void
DEAL_II_NAMESPACE_OPEN
+template <typename number1, typename number2, typename number3>
+inline void
+mkl_omatcopy(char,
+ char,
+ dealii::types::blas_int,
+ dealii::types::blas_int,
+ const number1,
+ const number2 *,
+ dealii::types::blas_int,
+ number3 *,
+ dealii::types::blas_int)
+{
+ Assert(false, ExcNotImplemented());
+}
+
+
+
+inline void
+mkl_omatcopy(char ordering,
+ char trans,
+ dealii::types::blas_int rows,
+ dealii::types::blas_int cols,
+ const float alpha,
+ const float * A,
+ dealii::types::blas_int lda,
+ float * B,
+ dealii::types::blas_int ldb)
+{
+#ifdef DEAL_II_LAPACK_WITH_MKL
+ mkl_somatcopy(ordering, trans, rows, cols, alpha, A, lda, B, ldb);
+#else
+ (void)ordering;
+ (void)trans;
+ (void)rows;
+ (void)cols;
+ (void)alpha;
+ (void)A;
+ (void)lda;
+ (void)B;
+ (void)ldb;
+ Assert(false, LAPACKSupport::ExcMissing("mkl_somatcopy"));
+#endif // DEAL_II_LAPACK_WITH_MKL
+}
+
+
+
+inline void
+mkl_omatcopy(char ordering,
+ char trans,
+ dealii::types::blas_int rows,
+ dealii::types::blas_int cols,
+ const double alpha,
+ const double * A,
+ dealii::types::blas_int lda,
+ double * B,
+ dealii::types::blas_int ldb)
+{
+#ifdef DEAL_II_LAPACK_WITH_MKL
+ mkl_domatcopy(ordering, trans, rows, cols, alpha, A, lda, B, ldb);
+#else
+ (void)ordering;
+ (void)trans;
+ (void)rows;
+ (void)cols;
+ (void)alpha;
+ (void)A;
+ (void)lda;
+ (void)B;
+ (void)ldb;
+ Assert(false, LAPACKSupport::ExcMissing("mkl_domatcopy"));
+#endif // DEAL_II_LAPACK_WITH_MKL
+}
+
+
+
+inline void
+mkl_omatcopy(char ordering,
+ char trans,
+ dealii::types::blas_int rows,
+ dealii::types::blas_int cols,
+ const std::complex<float> alpha,
+ const std::complex<float> *A,
+ dealii::types::blas_int lda,
+ std::complex<float> * B,
+ dealii::types::blas_int ldb)
+{
+#ifdef DEAL_II_LAPACK_WITH_MKL
+ mkl_comatcopy(ordering, trans, rows, cols, alpha, A, lda, B, ldb);
+#else
+ (void)ordering;
+ (void)trans;
+ (void)rows;
+ (void)cols;
+ (void)alpha;
+ (void)A;
+ (void)lda;
+ (void)B;
+ (void)ldb;
+ Assert(false, LAPACKSupport::ExcMissing("mkl_comatcopy"));
+#endif // DEAL_II_LAPACK_WITH_MKL
+}
+
+
+
+inline void
+mkl_omatcopy(char ordering,
+ char trans,
+ dealii::types::blas_int rows,
+ dealii::types::blas_int cols,
+ const std::complex<double> alpha,
+ const std::complex<double> *A,
+ dealii::types::blas_int lda,
+ std::complex<double> * B,
+ dealii::types::blas_int ldb)
+{
+#ifdef DEAL_II_LAPACK_WITH_MKL
+ mkl_zomatcopy(ordering, trans, rows, cols, alpha, A, lda, B, ldb);
+#else
+ (void)ordering;
+ (void)trans;
+ (void)rows;
+ (void)cols;
+ (void)alpha;
+ (void)A;
+ (void)lda;
+ (void)B;
+ (void)ldb;
+ Assert(false, LAPACKSupport::ExcMissing("mkl_zomatcopy"));
+#endif // DEAL_II_LAPACK_WITH_MKL
+}
+
+
template <typename number1, typename number2, typename number3>
inline void
+template <typename number>
+void
+LAPACKFullMatrix<number>::transpose(LAPACKFullMatrix<number> &B) const
+{
+ const LAPACKFullMatrix<number> &A = *this;
+ AssertDimension(A.m(), B.n());
+ AssertDimension(A.n(), B.m());
+ const types::blas_int m = B.m();
+ const types::blas_int n = B.n();
+#ifdef DEAL_II_LAPACK_WITH_MKL
+ mkl_omatcopy('C', 'T', n, m, 1., &A.values[0], n, &B.values[0], m);
+#else
+ for (types::blas_int i = 0; i < m; ++i)
+ for (types::blas_int j = 0; j < n; ++j)
+ B(i, j) = A(j, i);
+#endif
+}
+
+
template <typename number>
void
LAPACKFullMatrix<number>::scale_rows(const Vector<number> &V)
--- /dev/null
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2014 - 2018 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE.md at
+// the top level directory of deal.II.
+//
+// ---------------------------------------------------------------------
+
+
+// Tests LAPACKFullMatrix::transpose(...) const
+
+#include <deal.II/lac/lapack_full_matrix.h>
+
+#include <iostream>
+#include <tuple>
+
+#include "../tests.h"
+#include "create_matrix.h"
+
+template <typename NumberType>
+void
+test(const unsigned int n = 3, const unsigned int k = 6)
+{
+ LAPACKFullMatrix<NumberType> A(n, k);
+ LAPACKFullMatrix<NumberType> At(k, n);
+
+ create_random(A);
+ A.transpose(At);
+ for (unsigned int i = 0; i < A.m(); ++i)
+ for (unsigned int j = 0; j < A.n(); ++j)
+ {
+ const auto &at = At(j, i);
+ const auto &a = A(i, j);
+ AssertThrow(at == a,
+ ExcMessage(std::to_string(a) + "!=" + std::to_string(at) +
+ " for (" + std::to_string(i) + "," +
+ std::to_string(j) + ")"));
+ }
+
+ deallog << "OK" << std::endl;
+}
+
+int
+main()
+{
+ initlog();
+ test<double>(11, 27);
+ test<double>(15, 4);
+ test<double>(10, 10);
+}