Reference documentation for deal.II version Git f0d9923401 2020-09-28 19:47:38 -0600
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
lapack_support.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2005 - 2018 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.md at
12 // the top level directory of deal.II.
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 
23 
25 
26 namespace types
27 {
28 #ifdef LAPACK_WITH_64BIT_BLAS_INDICES
29 
32  using blas_int = long long;
33 #else
34 
37  using blas_int = int;
38 #endif
39 } // namespace types
40 
45 namespace LAPACKSupport
46 {
55  enum State
56  {
62  lu,
68  svd,
72  unusable = 0x8000
73  };
74 
78  inline const char *
80  {
81  switch (s)
82  {
83  case matrix:
84  return "matrix";
85  case inverse_matrix:
86  return "inverse matrix";
87  case lu:
88  return "lu decomposition";
89  case cholesky:
90  return "cholesky decomposition";
91  case eigenvalues:
92  return "eigenvalues";
93  case svd:
94  return "svd";
95  case inverse_svd:
96  return "inverse_svd";
97  case unusable:
98  return "unusable";
99  default:
100  return "unknown";
101  }
102  }
103 
108  enum Property
109  {
111  general = 0,
119  diagonal = 6,
122  };
123 
127  inline const char *
129  {
130  switch (s)
131  {
132  case general:
133  return "general";
134  case symmetric:
135  return "symmetric";
136  case upper_triangular:
137  return "upper triangular";
138  case lower_triangular:
139  return "lower triangular";
140  case diagonal:
141  return "diagonal";
142  case hessenberg:
143  return "Hessenberg";
144  }
145 
146  Assert(false, ExcNotImplemented());
147  return "invalid";
148  }
149 
153  static const char A = 'A';
157  static const char N = 'N';
161  static const char O = 'O';
165  static const char T = 'T';
169  static const char U = 'U';
173  static const char L = 'L';
177  static const char V = 'V';
181  static const types::blas_int zero = 0;
185  static const types::blas_int one = 1;
186 
191  std::string,
193  << "The function " << arg1 << " returned with an error code "
194  << arg2);
195 
202  ExcState,
203  State,
204  << "The function cannot be called while the matrix is in state "
205  << state_name(arg1));
206 
212  Property,
213  << "The function cannot be called with a "
214  << property_name(arg1) << " matrix.");
215 
221  ExcMissing,
222  std::string,
223  << "When you ran 'cmake' during installation of deal.II, "
224  << "no suitable installation of the BLAS or LAPACK library could "
225  << "be found. Consequently, the function <" << arg1
226  << "> can not be called. Refer to the doc/readme.html "
227  << "file for information on how to ensure that deal.II "
228  << "picks up an existing BLAS and LAPACK installation at "
229  << "configuration time.");
230 } // namespace LAPACKSupport
231 
232 
234 
235 #endif
Matrix is symmetric.
#define DeclException2(Exception2, type1, type2, outsequence)
Definition: exceptions.h:538
static const char L
Contents is actually a matrix.
Matrix is upper triangular.
Contents is the inverse of a matrix.
static const char V
static const types::blas_int one
static const char U
static ::ExceptionBase & ExcErrorCode(std::string arg1, types::blas_int arg2)
static const char O
const char * state_name(State s)
Matrix is diagonal.
static ::ExceptionBase & ExcState(State arg1)
Contents is a Cholesky decomposition.
#define DeclException1(Exception1, type1, outsequence)
Definition: exceptions.h:515
static const char T
Definition: types.h:31
#define Assert(cond, exc)
Definition: exceptions.h:1411
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:363
static ::ExceptionBase & ExcMissing(std::string arg1)
Contents is something useless.
Matrix is the inverse of a singular value decomposition.
static const char A
int blas_int
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:362
Matrix contains singular value decomposition,.
static const char N
No special properties.
static ::ExceptionBase & ExcNotImplemented()
static const types::blas_int zero
const char * property_name(const Property s)
Eigenvalue vector is filled.
static ::ExceptionBase & ExcProperty(Property arg1)
Matrix is in upper Hessenberg form.
Matrix is lower triangular.
Contents is an LU decomposition.