Reference documentation for deal.II version 9.0.0
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 namespace types
26 {
27 #ifdef LAPACK_WITH_64BIT_BLAS_INDICES
28 
31  typedef long long blas_int;
32 #else
33 
36  typedef int blas_int;
37 #endif
38 }
39 
44 namespace LAPACKSupport
45 {
56  enum State
57  {
63  lu,
69  svd,
73  unusable = 0x8000
74  };
75 
79  inline const char *state_name(State s)
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 *property_name(const Property s)
128  {
129  switch (s)
130  {
131  case general:
132  return "general";
133  case symmetric:
134  return "symmetric";
135  case upper_triangular:
136  return "upper triangular";
137  case lower_triangular:
138  return "lower triangular";
139  case diagonal:
140  return "diagonal";
141  case hessenberg:
142  return "Hessenberg";
143  }
144 
145  Assert (false, ExcNotImplemented());
146  return "invalid";
147  }
148 
152  static const char A = 'A';
156  static const char N = 'N';
160  static const char T = 'T';
164  static const char U = 'U';
168  static const char L = 'L';
172  static const char V = 'V';
176  static const types::blas_int zero = 0;
180  static const types::blas_int one = 1;
181 
186  << "The function " << arg1 << " returned with an error code " << arg2);
187 
194  << "The function cannot be called while the matrix is in state "
195  << state_name(arg1));
196 
202  << "The function cannot be called with a "
203  << property_name(arg1)
204  << " matrix.");
205 
210  DeclException1(ExcMissing, char *,
211  << "When you ran 'cmake' during installation of deal.II, "
212  << "no suitable installation of the BLAS or LAPACK library could "
213  << "be found. Consequently, the function <"
214  << arg1
215  << "> can not be called. Refer to the doc/readme.html "
216  << "file for information on how to ensure that deal.II "
217  << "picks up an existing BLAS and LAPACK installation at "
218  << "configuration time.");
219 }
220 
221 
222 DEAL_II_NAMESPACE_CLOSE
223 
224 #endif
Matrix is symmetric.
#define DeclException2(Exception2, type1, type2, outsequence)
Definition: exceptions.h:358
static const char L
int blas_int
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
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:346
static const char T
Definition: types.h:30
#define Assert(cond, exc)
Definition: exceptions.h:1142
static ::ExceptionBase & ExcErrorCode(char *arg1, types::blas_int arg2)
Contents is something useless.
Matrix is the inverse of a singular value decomposition.
static const char A
Matrix contains singular value decomposition,.
static const char N
No special properties.
static ::ExceptionBase & ExcMissing(char *arg1)
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.