Reference documentation for deal.II version 9.2.0
\(\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 {
57  enum State
58  {
64  lu,
70  svd,
74  unusable = 0x8000
75  };
76 
80  inline const char *
82  {
83  switch (s)
84  {
85  case matrix:
86  return "matrix";
87  case inverse_matrix:
88  return "inverse matrix";
89  case lu:
90  return "lu decomposition";
91  case cholesky:
92  return "cholesky decomposition";
93  case eigenvalues:
94  return "eigenvalues";
95  case svd:
96  return "svd";
97  case inverse_svd:
98  return "inverse_svd";
99  case unusable:
100  return "unusable";
101  default:
102  return "unknown";
103  }
104  }
105 
110  enum Property
111  {
113  general = 0,
121  diagonal = 6,
124  };
125 
129  inline const char *
131  {
132  switch (s)
133  {
134  case general:
135  return "general";
136  case symmetric:
137  return "symmetric";
138  case upper_triangular:
139  return "upper triangular";
140  case lower_triangular:
141  return "lower triangular";
142  case diagonal:
143  return "diagonal";
144  case hessenberg:
145  return "Hessenberg";
146  }
147 
148  Assert(false, ExcNotImplemented());
149  return "invalid";
150  }
151 
155  static const char A = 'A';
159  static const char N = 'N';
163  static const char T = 'T';
167  static const char U = 'U';
171  static const char L = 'L';
175  static const char V = 'V';
179  static const types::blas_int zero = 0;
183  static const types::blas_int one = 1;
184 
189  std::string,
191  << "The function " << arg1 << " returned with an error code "
192  << arg2);
193 
200  ExcState,
201  State,
202  << "The function cannot be called while the matrix is in state "
203  << state_name(arg1));
204 
210  Property,
211  << "The function cannot be called with a "
212  << property_name(arg1) << " matrix.");
213 
219  ExcMissing,
220  std::string,
221  << "When you ran 'cmake' during installation of deal.II, "
222  << "no suitable installation of the BLAS or LAPACK library could "
223  << "be found. Consequently, the function <" << arg1
224  << "> can not be called. Refer to the doc/readme.html "
225  << "file for information on how to ensure that deal.II "
226  << "picks up an existing BLAS and LAPACK installation at "
227  << "configuration time.");
228 } // namespace LAPACKSupport
229 
230 
232 
233 #endif
LAPACKSupport::svd
@ svd
Matrix contains singular value decomposition,.
Definition: lapack_support.h:70
LAPACKSupport::diagonal
@ diagonal
Matrix is diagonal.
Definition: lapack_support.h:121
LAPACKSupport::property_name
const char * property_name(const Property s)
Definition: lapack_support.h:130
LAPACKSupport::unusable
@ unusable
Contents is something useless.
Definition: lapack_support.h:74
LAPACKSupport::lower_triangular
@ lower_triangular
Matrix is lower triangular.
Definition: lapack_support.h:119
LAPACKSupport::inverse_svd
@ inverse_svd
Matrix is the inverse of a singular value decomposition.
Definition: lapack_support.h:72
StandardExceptions::ExcNotImplemented
static ::ExceptionBase & ExcNotImplemented()
LAPACKSupport::V
static const char V
Definition: lapack_support.h:175
LAPACKSupport::U
static const char U
Definition: lapack_support.h:167
LAPACKSupport::ExcProperty
static ::ExceptionBase & ExcProperty(Property arg1)
LAPACKSupport::L
static const char L
Definition: lapack_support.h:171
LAPACKSupport::state_name
const char * state_name(State s)
Definition: lapack_support.h:81
LAPACKSupport::one
static const types::blas_int one
Definition: lapack_support.h:183
LAPACKSupport::cholesky
@ cholesky
Contents is a Cholesky decomposition.
Definition: lapack_support.h:66
LAPACKSupport::T
static const char T
Definition: lapack_support.h:163
LAPACKSupport
Definition: lapack_support.h:45
LAPACKSupport::symmetric
@ symmetric
Matrix is symmetric.
Definition: lapack_support.h:115
LAPACKSupport::hessenberg
@ hessenberg
Matrix is in upper Hessenberg form.
Definition: lapack_support.h:123
LAPACKSupport::eigenvalues
@ eigenvalues
Eigenvalue vector is filled.
Definition: lapack_support.h:68
LAPACKSupport::State
State
Definition: lapack_support.h:57
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
LAPACKSupport::matrix
@ matrix
Contents is actually a matrix.
Definition: lapack_support.h:60
LAPACKSupport::general
@ general
No special properties.
Definition: lapack_support.h:113
DeclException1
#define DeclException1(Exception1, type1, outsequence)
Definition: exceptions.h:518
LAPACKSupport::ExcErrorCode
static ::ExceptionBase & ExcErrorCode(std::string arg1, types::blas_int arg2)
types
Definition: types.h:31
exceptions.h
LAPACKSupport::inverse_matrix
@ inverse_matrix
Contents is the inverse of a matrix.
Definition: lapack_support.h:62
LAPACKSupport::A
static const char A
Definition: lapack_support.h:155
Assert
#define Assert(cond, exc)
Definition: exceptions.h:1419
LAPACKSupport::zero
static const types::blas_int zero
Definition: lapack_support.h:179
LAPACKSupport::upper_triangular
@ upper_triangular
Matrix is upper triangular.
Definition: lapack_support.h:117
config.h
LAPACKSupport::Property
Property
Definition: lapack_support.h:110
LAPACKSupport::N
static const char N
Definition: lapack_support.h:159
LAPACKSupport::ExcMissing
static ::ExceptionBase & ExcMissing(std::string arg1)
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
LAPACKSupport::ExcState
static ::ExceptionBase & ExcState(State arg1)
types::blas_int
int blas_int
Definition: lapack_support.h:37
DeclException2
#define DeclException2(Exception2, type1, type2, outsequence)
Definition: exceptions.h:541
LAPACKSupport::lu
@ lu
Contents is an LU decomposition.
Definition: lapack_support.h:64
int