Reference documentation for deal.II version 8.5.1
lapack_support.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2005 - 2017 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 {
38  enum State
39  {
41  matrix,
43  inverse_matrix,
45  lu,
47  eigenvalues,
49  svd,
51  inverse_svd,
53  unusable = 0x8000
54  };
55 
59  inline const char *state_name(State s)
60  {
61  switch (s)
62  {
63  case matrix:
64  return "matrix";
65  case inverse_matrix:
66  return "inverse matrix";
67  case lu:
68  return "lu decomposition";
69  case eigenvalues:
70  return "eigenvalues";
71  case svd:
72  return "svd";
73  case inverse_svd:
74  return "inverse_svd";
75  case unusable:
76  return "unusable";
77  default:
78  return "unknown";
79  }
80  }
81 
86  enum Properties
87  {
89  general = 0,
91  symmetric = 1,
93  upper_triangle = 2,
95  lower_triangle = 4,
97  diagonal = 6,
99  hessenberg = 8
100  };
101 
105  static const char A = 'A';
109  static const char N = 'N';
113  static const char T = 'T';
117  static const char U = 'U';
121  static const char V = 'V';
125  static const int zero = 0;
129  static const int one = 1;
130 
134  DeclException2(ExcErrorCode, char *, int,
135  << "The function " << arg1 << " returned with an error code " << arg2);
136 
142  DeclException1(ExcState, State,
143  << "The function cannot be called while the matrix is in state "
144  << state_name(arg1));
145 
150  DeclException1(ExcMissing, char *,
151  << "When you ran 'cmake' during installation of deal.II, "
152  << "no suitable installation of the BLAS or LAPACK library could "
153  << "be found. Consequently, the function <"
154  << arg1
155  << "> can not be called. Refer to the doc/readme.html "
156  << "file for information on how to ensure that deal.II "
157  << "picks up an existing BLAS and LAPACK installation at "
158  << "configuration time.");
159 }
160 
161 
162 DEAL_II_NAMESPACE_CLOSE
163 
164 #endif
#define DeclException2(Exception2, type1, type2, outsequence)
Definition: exceptions.h:576
static ::ExceptionBase & ExcState(State arg1)
#define DeclException1(Exception1, type1, outsequence)
Definition: exceptions.h:564
static ::ExceptionBase & ExcErrorCode(char *arg1, int arg2)
static ::ExceptionBase & ExcMissing(char *arg1)