You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

470 lines
26 KiB

  1. /* -*- c++ -*- (enables emacs c++ mode) */
  2. /*===========================================================================
  3. Copyright (C) 2003-2017 Yves Renard
  4. This file is a part of GetFEM++
  5. GetFEM++ is free software; you can redistribute it and/or modify it
  6. under the terms of the GNU Lesser General Public License as published
  7. by the Free Software Foundation; either version 3 of the License, or
  8. (at your option) any later version along with the GCC Runtime Library
  9. Exception either version 3.1 or (at your option) any later version.
  10. This program is distributed in the hope that it will be useful, but
  11. WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  12. or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
  13. License and GCC Runtime Library Exception for more details.
  14. You should have received a copy of the GNU Lesser General Public License
  15. along with this program; if not, write to the Free Software Foundation,
  16. Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
  17. As a special exception, you may use this file as it is a part of a free
  18. software library without restriction. Specifically, if other files
  19. instantiate templates or use macros or inline functions from this file,
  20. or you compile this file and link it with other files to produce an
  21. executable, this file does not by itself cause the resulting executable
  22. to be covered by the GNU Lesser General Public License. This exception
  23. does not however invalidate any other reasons why the executable file
  24. might be covered by the GNU Lesser General Public License.
  25. ===========================================================================*/
  26. /**@file gmm_lapack_interface.h
  27. @author Yves Renard <Yves.Renard@insa-lyon.fr>
  28. @date October 7, 2003.
  29. @brief gmm interface for LAPACK
  30. */
  31. #ifndef GMM_LAPACK_INTERFACE_H
  32. #define GMM_LAPACK_INTERFACE_H
  33. #include "gmm_blas_interface.h"
  34. #include "gmm_dense_lu.h"
  35. #include "gmm_dense_qr.h"
  36. #if defined(GMM_USES_LAPACK)
  37. namespace gmm {
  38. /* ********************************************************************* */
  39. /* Operations interfaced for T = float, double, std::complex<float> */
  40. /* or std::complex<double> : */
  41. /* */
  42. /* lu_factor(dense_matrix<T>, std::vector<int>) */
  43. /* lu_solve(dense_matrix<T>, std::vector<T>, std::vector<T>) */
  44. /* lu_solve(dense_matrix<T>, std::vector<int>, std::vector<T>, */
  45. /* std::vector<T>) */
  46. /* lu_solve_transposed(dense_matrix<T>, std::vector<int>, std::vector<T>,*/
  47. /* std::vector<T>) */
  48. /* lu_inverse(dense_matrix<T>) */
  49. /* lu_inverse(dense_matrix<T>, std::vector<int>, dense_matrix<T>) */
  50. /* */
  51. /* qr_factor(dense_matrix<T>, dense_matrix<T>, dense_matrix<T>) */
  52. /* */
  53. /* implicit_qr_algorithm(dense_matrix<T>, std::vector<T>) */
  54. /* implicit_qr_algorithm(dense_matrix<T>, std::vector<T>, */
  55. /* dense_matrix<T>) */
  56. /* implicit_qr_algorithm(dense_matrix<T>, std::vector<std::complex<T> >) */
  57. /* implicit_qr_algorithm(dense_matrix<T>, std::vector<std::complex<T> >, */
  58. /* dense_matrix<T>) */
  59. /* */
  60. /* geev_interface_right */
  61. /* geev_interface_left */
  62. /* */
  63. /* schur(dense_matrix<T>, dense_matrix<T>, dense_matrix<T>) */
  64. /* */
  65. /* svd(dense_matrix<T>, dense_matrix<T>, dense_matrix<T>, std::vector<T>)*/
  66. /* svd(dense_matrix<T>, dense_matrix<T>, dense_matrix<T>, */
  67. /* std::vector<std::complex<T> >) */
  68. /* */
  69. /* ********************************************************************* */
  70. /* ********************************************************************* */
  71. /* LAPACK functions used. */
  72. /* ********************************************************************* */
  73. extern "C" {
  74. void sgetrf_(...); void dgetrf_(...); void cgetrf_(...); void zgetrf_(...);
  75. void sgetrs_(...); void dgetrs_(...); void cgetrs_(...); void zgetrs_(...);
  76. void sgetri_(...); void dgetri_(...); void cgetri_(...); void zgetri_(...);
  77. void sgeqrf_(...); void dgeqrf_(...); void cgeqrf_(...); void zgeqrf_(...);
  78. void sorgqr_(...); void dorgqr_(...); void cungqr_(...); void zungqr_(...);
  79. void sormqr_(...); void dormqr_(...); void cunmqr_(...); void zunmqr_(...);
  80. void sgees_ (...); void dgees_ (...); void cgees_ (...); void zgees_ (...);
  81. void sgeev_ (...); void dgeev_ (...); void cgeev_ (...); void zgeev_ (...);
  82. void sgeesx_(...); void dgeesx_(...); void cgeesx_(...); void zgeesx_(...);
  83. void sgesvd_(...); void dgesvd_(...); void cgesvd_(...); void zgesvd_(...);
  84. }
  85. /* ********************************************************************* */
  86. /* LU decomposition. */
  87. /* ********************************************************************* */
  88. # define getrf_interface(lapack_name, base_type) inline \
  89. size_type lu_factor(dense_matrix<base_type > &A, std::vector<int> &ipvt){\
  90. GMMLAPACK_TRACE("getrf_interface"); \
  91. int m = int(mat_nrows(A)), n = int(mat_ncols(A)), lda(m), info(0); \
  92. if (m && n) lapack_name(&m, &n, &A(0,0), &lda, &ipvt[0], &info); \
  93. return size_type(info); \
  94. }
  95. getrf_interface(sgetrf_, BLAS_S)
  96. getrf_interface(dgetrf_, BLAS_D)
  97. getrf_interface(cgetrf_, BLAS_C)
  98. getrf_interface(zgetrf_, BLAS_Z)
  99. /* ********************************************************************* */
  100. /* LU solve. */
  101. /* ********************************************************************* */
  102. # define getrs_interface(f_name, trans1, lapack_name, base_type) inline \
  103. void f_name(const dense_matrix<base_type > &A, \
  104. const std::vector<int> &ipvt, std::vector<base_type > &x, \
  105. const std::vector<base_type > &b) { \
  106. GMMLAPACK_TRACE("getrs_interface"); \
  107. int n = int(mat_nrows(A)), info, nrhs(1); \
  108. gmm::copy(b, x); trans1; \
  109. if (n) \
  110. lapack_name(&t, &n, &nrhs, &(A(0,0)),&n,&ipvt[0], &x[0], &n, &info); \
  111. }
  112. # define getrs_trans_n const char t = 'N'
  113. # define getrs_trans_t const char t = 'T'
  114. getrs_interface(lu_solve, getrs_trans_n, sgetrs_, BLAS_S)
  115. getrs_interface(lu_solve, getrs_trans_n, dgetrs_, BLAS_D)
  116. getrs_interface(lu_solve, getrs_trans_n, cgetrs_, BLAS_C)
  117. getrs_interface(lu_solve, getrs_trans_n, zgetrs_, BLAS_Z)
  118. getrs_interface(lu_solve_transposed, getrs_trans_t, sgetrs_, BLAS_S)
  119. getrs_interface(lu_solve_transposed, getrs_trans_t, dgetrs_, BLAS_D)
  120. getrs_interface(lu_solve_transposed, getrs_trans_t, cgetrs_, BLAS_C)
  121. getrs_interface(lu_solve_transposed, getrs_trans_t, zgetrs_, BLAS_Z)
  122. /* ********************************************************************* */
  123. /* LU inverse. */
  124. /* ********************************************************************* */
  125. # define getri_interface(lapack_name, base_type) inline \
  126. void lu_inverse(const dense_matrix<base_type > &LU, \
  127. std::vector<int> &ipvt, const dense_matrix<base_type > &A_) { \
  128. GMMLAPACK_TRACE("getri_interface"); \
  129. dense_matrix<base_type> &A \
  130. = const_cast<dense_matrix<base_type > &>(A_); \
  131. int n = int(mat_nrows(A)), info, lwork(10000); base_type work[10000]; \
  132. if (n) { \
  133. std::copy(LU.begin(), LU.end(), A.begin()); \
  134. lapack_name(&n, &A(0,0), &n, &ipvt[0], &work[0], &lwork, &info); \
  135. } \
  136. }
  137. getri_interface(sgetri_, BLAS_S)
  138. getri_interface(dgetri_, BLAS_D)
  139. getri_interface(cgetri_, BLAS_C)
  140. getri_interface(zgetri_, BLAS_Z)
  141. /* ********************************************************************* */
  142. /* QR factorization. */
  143. /* ********************************************************************* */
  144. # define geqrf_interface(lapack_name1, base_type) inline \
  145. void qr_factor(dense_matrix<base_type > &A){ \
  146. GMMLAPACK_TRACE("geqrf_interface"); \
  147. int m = int(mat_nrows(A)), n = int(mat_ncols(A)), info, lwork(-1); \
  148. base_type work1; \
  149. if (m && n) { \
  150. std::vector<base_type > tau(n); \
  151. lapack_name1(&m, &n, &A(0,0), &m, &tau[0], &work1 , &lwork, &info); \
  152. lwork = int(gmm::real(work1)); \
  153. std::vector<base_type > work(lwork); \
  154. lapack_name1(&m, &n, &A(0,0), &m, &tau[0], &work[0], &lwork, &info); \
  155. GMM_ASSERT1(!info, "QR factorization failed"); \
  156. } \
  157. }
  158. geqrf_interface(sgeqrf_, BLAS_S)
  159. geqrf_interface(dgeqrf_, BLAS_D)
  160. // For complex values, housholder vectors are not the same as in
  161. // gmm::lu_factor. Impossible to interface for the moment.
  162. // geqrf_interface(cgeqrf_, BLAS_C)
  163. // geqrf_interface(zgeqrf_, BLAS_Z)
  164. # define geqrf_interface2(lapack_name1, lapack_name2, base_type) inline \
  165. void qr_factor(const dense_matrix<base_type > &A, \
  166. dense_matrix<base_type > &Q, dense_matrix<base_type > &R) { \
  167. GMMLAPACK_TRACE("geqrf_interface2"); \
  168. int m = int(mat_nrows(A)), n = int(mat_ncols(A)), info, lwork(-1); \
  169. base_type work1; \
  170. if (m && n) { \
  171. std::copy(A.begin(), A.end(), Q.begin()); \
  172. std::vector<base_type > tau(n); \
  173. lapack_name1(&m, &n, &Q(0,0), &m, &tau[0], &work1 , &lwork, &info); \
  174. lwork = int(gmm::real(work1)); \
  175. std::vector<base_type > work(lwork); \
  176. lapack_name1(&m, &n, &Q(0,0), &m, &tau[0], &work[0], &lwork, &info); \
  177. GMM_ASSERT1(!info, "QR factorization failed"); \
  178. base_type *p = &R(0,0), *q = &Q(0,0); \
  179. for (int j = 0; j < n; ++j, q += m-n) \
  180. for (int i = 0; i < n; ++i, ++p, ++q) \
  181. *p = (j < i) ? base_type(0) : *q; \
  182. lapack_name2(&m, &n, &n, &Q(0,0), &m,&tau[0],&work[0],&lwork,&info); \
  183. } \
  184. else gmm::clear(Q); \
  185. }
  186. geqrf_interface2(sgeqrf_, sorgqr_, BLAS_S)
  187. geqrf_interface2(dgeqrf_, dorgqr_, BLAS_D)
  188. geqrf_interface2(cgeqrf_, cungqr_, BLAS_C)
  189. geqrf_interface2(zgeqrf_, zungqr_, BLAS_Z)
  190. /* ********************************************************************* */
  191. /* QR algorithm for eigenvalues search. */
  192. /* ********************************************************************* */
  193. # define gees_interface(lapack_name, base_type) \
  194. template <typename VECT> inline void implicit_qr_algorithm( \
  195. const dense_matrix<base_type > &A, const VECT &eigval_, \
  196. dense_matrix<base_type > &Q, \
  197. double tol=gmm::default_tol(base_type()), bool compvect = true) { \
  198. GMMLAPACK_TRACE("gees_interface"); \
  199. typedef bool (*L_fp)(...); L_fp p = 0; \
  200. int n = int(mat_nrows(A)), info, lwork(-1), sdim; base_type work1; \
  201. if (!n) return; \
  202. dense_matrix<base_type > H(n,n); gmm::copy(A, H); \
  203. char jobvs = (compvect ? 'V' : 'N'), sort = 'N'; \
  204. std::vector<double> rwork(n), eigv1(n), eigv2(n); \
  205. lapack_name(&jobvs, &sort, p, &n, &H(0,0), &n, &sdim, &eigv1[0], \
  206. &eigv2[0], &Q(0,0), &n, &work1, &lwork, &rwork[0], &info); \
  207. lwork = int(gmm::real(work1)); \
  208. std::vector<base_type > work(lwork); \
  209. lapack_name(&jobvs, &sort, p, &n, &H(0,0), &n, &sdim, &eigv1[0], \
  210. &eigv2[0], &Q(0,0), &n, &work[0], &lwork, &rwork[0],&info);\
  211. GMM_ASSERT1(!info, "QR algorithm failed"); \
  212. extract_eig(H, const_cast<VECT &>(eigval_), tol); \
  213. }
  214. # define gees_interface2(lapack_name, base_type) \
  215. template <typename VECT> inline void implicit_qr_algorithm( \
  216. const dense_matrix<base_type > &A, const VECT &eigval_, \
  217. dense_matrix<base_type > &Q, \
  218. double tol=gmm::default_tol(base_type()), bool compvect = true) { \
  219. GMMLAPACK_TRACE("gees_interface2"); \
  220. typedef bool (*L_fp)(...); L_fp p = 0; \
  221. int n = int(mat_nrows(A)), info, lwork(-1), sdim; base_type work1; \
  222. if (!n) return; \
  223. dense_matrix<base_type > H(n,n); gmm::copy(A, H); \
  224. char jobvs = (compvect ? 'V' : 'N'), sort = 'N'; \
  225. std::vector<double> rwork(n), eigvv(n*2); \
  226. lapack_name(&jobvs, &sort, p, &n, &H(0,0), &n, &sdim, &eigvv[0], \
  227. &Q(0,0), &n, &work1, &lwork, &rwork[0], &rwork[0], &info); \
  228. lwork = int(gmm::real(work1)); \
  229. std::vector<base_type > work(lwork); \
  230. lapack_name(&jobvs, &sort, p, &n, &H(0,0), &n, &sdim, &eigvv[0], \
  231. &Q(0,0), &n, &work[0], &lwork, &rwork[0], &rwork[0],&info);\
  232. GMM_ASSERT1(!info, "QR algorithm failed"); \
  233. extract_eig(H, const_cast<VECT &>(eigval_), tol); \
  234. }
  235. gees_interface(sgees_, BLAS_S)
  236. gees_interface(dgees_, BLAS_D)
  237. gees_interface2(cgees_, BLAS_C)
  238. gees_interface2(zgees_, BLAS_Z)
  239. # define jobv_right char jobvl = 'N', jobvr = 'V';
  240. # define jobv_left char jobvl = 'V', jobvr = 'N';
  241. # define geev_interface(lapack_name, base_type, side) \
  242. template <typename VECT> inline void geev_interface_ ## side( \
  243. const dense_matrix<base_type > &A, const VECT &eigval_, \
  244. dense_matrix<base_type > &Q) { \
  245. GMMLAPACK_TRACE("geev_interface"); \
  246. int n = int(mat_nrows(A)), info, lwork(-1); base_type work1; \
  247. if (!n) return; \
  248. dense_matrix<base_type > H(n,n); gmm::copy(A, H); \
  249. jobv_ ## side \
  250. std::vector<base_type > eigvr(n), eigvi(n); \
  251. lapack_name(&jobvl, &jobvr, &n, &H(0,0), &n, &eigvr[0], &eigvi[0], \
  252. &Q(0,0), &n, &Q(0,0), &n, &work1, &lwork, &info); \
  253. lwork = int(gmm::real(work1)); \
  254. std::vector<base_type > work(lwork); \
  255. lapack_name(&jobvl, &jobvr, &n, &H(0,0), &n, &eigvr[0], &eigvi[0], \
  256. &Q(0,0), &n, &Q(0,0), &n, &work[0], &lwork, &info); \
  257. GMM_ASSERT1(!info, "QR algorithm failed"); \
  258. gmm::copy(eigvr, gmm::real_part(const_cast<VECT &>(eigval_))); \
  259. gmm::copy(eigvi, gmm::imag_part(const_cast<VECT &>(eigval_))); \
  260. }
  261. # define geev_interface2(lapack_name, base_type, side) \
  262. template <typename VECT> inline void geev_interface_ ## side( \
  263. const dense_matrix<base_type > &A, const VECT &eigval_, \
  264. dense_matrix<base_type > &Q) { \
  265. GMMLAPACK_TRACE("geev_interface"); \
  266. int n = int(mat_nrows(A)), info, lwork(-1); base_type work1; \
  267. if (!n) return; \
  268. dense_matrix<base_type > H(n,n); gmm::copy(A, H); \
  269. jobv_ ## side \
  270. std::vector<base_type::value_type> rwork(2*n); \
  271. std::vector<base_type> eigv(n); \
  272. lapack_name(&jobvl, &jobvr, &n, &H(0,0), &n, &eigv[0], &Q(0,0), &n, \
  273. &Q(0,0), &n, &work1, &lwork, &rwork[0], &info); \
  274. lwork = int(gmm::real(work1)); \
  275. std::vector<base_type > work(lwork); \
  276. lapack_name(&jobvl, &jobvr, &n, &H(0,0), &n, &eigv[0], &Q(0,0), &n, \
  277. &Q(0,0), &n, &work[0], &lwork, &rwork[0], &info); \
  278. GMM_ASSERT1(!info, "QR algorithm failed"); \
  279. gmm::copy(eigv, const_cast<VECT &>(eigval_)); \
  280. }
  281. geev_interface(sgeev_, BLAS_S, right)
  282. geev_interface(dgeev_, BLAS_D, right)
  283. geev_interface2(cgeev_, BLAS_C, right)
  284. geev_interface2(zgeev_, BLAS_Z, right)
  285. geev_interface(sgeev_, BLAS_S, left)
  286. geev_interface(dgeev_, BLAS_D, left)
  287. geev_interface2(cgeev_, BLAS_C, left)
  288. geev_interface2(zgeev_, BLAS_Z, left)
  289. /* ********************************************************************* */
  290. /* SCHUR algorithm: */
  291. /* A = Q*S*(Q^T), with Q orthogonal and S upper quasi-triangula */
  292. /* ********************************************************************* */
  293. # define geesx_interface(lapack_name, base_type) inline \
  294. void schur(dense_matrix<base_type> &A, \
  295. dense_matrix<base_type> &S, \
  296. dense_matrix<base_type> &Q) { \
  297. GMMLAPACK_TRACE("geesx_interface"); \
  298. int m = int(mat_nrows(A)), n = int(mat_ncols(A)); \
  299. GMM_ASSERT1(m == n, "Schur decomposition requires square matrix"); \
  300. char jobvs = 'V', sort = 'N', sense = 'N'; \
  301. bool select = false; \
  302. int lwork = 8*n, sdim = 0, liwork = 1; \
  303. std::vector<base_type> work(lwork), wr(n), wi(n); \
  304. std::vector<int> iwork(liwork); \
  305. std::vector<int> bwork(1); \
  306. resize(S, n, n); copy(A, S); \
  307. resize(Q, n, n); \
  308. base_type rconde(0), rcondv(0); \
  309. int info = -1; \
  310. lapack_name(&jobvs, &sort, &select, &sense, &n, &S(0,0), &n, \
  311. &sdim, &wr[0], &wi[0], &Q(0,0), &n, &rconde, &rcondv, \
  312. &work[0], &lwork, &iwork[0], &liwork, &bwork[0], &info);\
  313. GMM_ASSERT1(!info, "SCHUR algorithm failed"); \
  314. }
  315. # define geesx_interface2(lapack_name, base_type) inline \
  316. void schur(dense_matrix<base_type> &A, \
  317. dense_matrix<base_type> &S, \
  318. dense_matrix<base_type> &Q) { \
  319. GMMLAPACK_TRACE("geesx_interface"); \
  320. int m = int(mat_nrows(A)), n = int(mat_ncols(A)); \
  321. GMM_ASSERT1(m == n, "Schur decomposition requires square matrix"); \
  322. char jobvs = 'V', sort = 'N', sense = 'N'; \
  323. bool select = false; \
  324. int lwork = 8*n, sdim = 0; \
  325. std::vector<base_type::value_type> rwork(lwork); \
  326. std::vector<base_type> work(lwork), w(n); \
  327. std::vector<int> bwork(1); \
  328. resize(S, n, n); copy(A, S); \
  329. resize(Q, n, n); \
  330. base_type rconde(0), rcondv(0); \
  331. int info = -1; \
  332. lapack_name(&jobvs, &sort, &select, &sense, &n, &S(0,0), &n, \
  333. &sdim, &w[0], &Q(0,0), &n, &rconde, &rcondv, \
  334. &work[0], &lwork, &rwork[0], &bwork[0], &info); \
  335. GMM_ASSERT1(!info, "SCHUR algorithm failed"); \
  336. }
  337. geesx_interface(sgeesx_, BLAS_S)
  338. geesx_interface(dgeesx_, BLAS_D)
  339. geesx_interface2(cgeesx_, BLAS_C)
  340. geesx_interface2(zgeesx_, BLAS_Z)
  341. template <typename MAT>
  342. void schur(const MAT &A_, MAT &S, MAT &Q) {
  343. MAT A(A_);
  344. schur(A, S, Q);
  345. }
  346. /* ********************************************************************* */
  347. /* Interface to SVD. Does not correspond to a Gmm++ functionnality. */
  348. /* Author : Sebastian Nowozin <sebastian.nowozin@tuebingen.mpg.de> */
  349. /* ********************************************************************* */
  350. # define gesvd_interface(lapack_name, base_type) inline \
  351. void svd(dense_matrix<base_type> &X, \
  352. dense_matrix<base_type> &U, \
  353. dense_matrix<base_type> &Vtransposed, \
  354. std::vector<base_type> &sigma) { \
  355. GMMLAPACK_TRACE("gesvd_interface"); \
  356. int m = int(mat_nrows(X)), n = int(mat_ncols(X)); \
  357. int mn_min = m < n ? m : n; \
  358. sigma.resize(mn_min); \
  359. std::vector<base_type> work(15 * mn_min); \
  360. int lwork = int(work.size()); \
  361. resize(U, m, m); \
  362. resize(Vtransposed, n, n); \
  363. char job = 'A'; \
  364. int info = -1; \
  365. lapack_name(&job, &job, &m, &n, &X(0,0), &m, &sigma[0], &U(0,0), \
  366. &m, &Vtransposed(0,0), &n, &work[0], &lwork, &info); \
  367. }
  368. # define cgesvd_interface(lapack_name, base_type, base_type2) inline \
  369. void svd(dense_matrix<base_type> &X, \
  370. dense_matrix<base_type> &U, \
  371. dense_matrix<base_type> &Vtransposed, \
  372. std::vector<base_type2> &sigma) { \
  373. GMMLAPACK_TRACE("gesvd_interface"); \
  374. int m = int(mat_nrows(X)), n = int(mat_ncols(X)); \
  375. int mn_min = m < n ? m : n; \
  376. sigma.resize(mn_min); \
  377. std::vector<base_type> work(15 * mn_min); \
  378. std::vector<base_type2> rwork(5 * mn_min); \
  379. int lwork = int(work.size()); \
  380. resize(U, m, m); \
  381. resize(Vtransposed, n, n); \
  382. char job = 'A'; \
  383. int info = -1; \
  384. lapack_name(&job, &job, &m, &n, &X(0,0), &m, &sigma[0], &U(0,0), \
  385. &m, &Vtransposed(0,0), &n, &work[0], &lwork, \
  386. &rwork[0], &info); \
  387. }
  388. gesvd_interface(sgesvd_, BLAS_S)
  389. gesvd_interface(dgesvd_, BLAS_D)
  390. cgesvd_interface(cgesvd_, BLAS_C, BLAS_S)
  391. cgesvd_interface(zgesvd_, BLAS_Z, BLAS_D)
  392. template <typename MAT, typename VEC>
  393. void svd(const MAT &X_, MAT &U, MAT &Vtransposed, VEC &sigma) {
  394. MAT X(X_);
  395. svd(X, U, Vtransposed, sigma);
  396. }
  397. }
  398. #else
  399. namespace gmm
  400. {
  401. template <typename MAT>
  402. void schur(const MAT &A_, MAT &S, MAT &Q)
  403. {
  404. GMM_ASSERT1(false, "Use of function schur(A,S,Q) requires GetFEM++ "
  405. "to be built with Lapack");
  406. }
  407. }// namespace gmm
  408. #endif // GMM_USES_LAPACK
  409. #endif // GMM_LAPACK_INTERFACE_H