Reference documentation for deal.II version 8.4.2
lapack_support.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2005 - 2015 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE at
12 // the top level of the deal.II distribution.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii__lapack_support_h
17 #define dealii__lapack_support_h
18 
19 
20 #include <deal.II/base/config.h>
21 #include <deal.II/base/exceptions.h>
22 
23 DEAL_II_NAMESPACE_OPEN
24 
25 
26 namespace LAPACKSupport
27 {
35  enum State
36  {
38  matrix,
40  inverse_matrix,
42  lu,
44  eigenvalues,
46  svd,
48  inverse_svd,
50  unusable = 0x8000
51  };
52 
56  inline const char *state_name(State s)
57  {
58  switch (s)
59  {
60  case matrix:
61  return "matrix";
62  case inverse_matrix:
63  return "inverse matrix";
64  case lu:
65  return "lu decomposition";
66  case eigenvalues:
67  return "eigenvalues";
68  case svd:
69  return "svd";
70  case inverse_svd:
71  return "inverse_svd";
72  case unusable:
73  return "unusable";
74  default:
75  return "unknown";
76  }
77  return "internal error";
78  }
79 
84  enum Properties
85  {
87  general = 0,
89  symmetric = 1,
91  upper_triangle = 2,
93  lower_triangle = 4,
95  diagonal = 6,
97  hessenberg = 8
98  };
99 
103  static const char A = 'A';
107  static const char N = 'N';
111  static const char T = 'T';
115  static const char U = 'U';
119  static const char V = 'V';
123  static const int zero = 0;
127  static const int one = 1;
128 
132  DeclException2(ExcErrorCode, char *, int,
133  << "The function " << arg1 << " returned with an error code " << arg2);
134 
140  DeclException1(ExcState, State,
141  << "The function cannot be called while the matrix is in state "
142  << state_name(arg1));
143 
148  DeclException1(ExcMissing, char *,
149  << "When you ran 'cmake' during installation of deal.II, "
150  << "no suitable installation of the BLAS or LAPACK library could "
151  << "be found. Consequently, the function <"
152  << arg1
153  << "> can not be called. Refer to the doc/readme.html "
154  << "file for information on how to ensure that deal.II "
155  << "picks up an existing BLAS and LAPACK installation at "
156  << "configuration time.");
157 }
158 
159 
160 DEAL_II_NAMESPACE_CLOSE
161 
162 #endif
#define DeclException2(Exception2, type1, type2, outsequence)
Definition: exceptions.h:552
#define DeclException1(Exception1, type1, outsequence)
Definition: exceptions.h:542