Reference documentation for deal.II version GIT e8f57130d0 2023-09-28 07:00:03+00:00
\(\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\}}\)
vector.cc
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1999 - 2022 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 #include <deal.II/lac/vector.templates.h>
17 
19 
20 #ifndef DOXYGEN
21 # include "vector.inst"
22 
23 # ifndef DEAL_II_WITH_COMPLEX_VALUES
24 // instantiate for std::complex<double> since we are using it internally in
25 // FESeries.
26 template class Vector<std::complex<double>>;
27 # endif
28 
29 // instantiate for integers:
30 template class Vector<int>;
31 template Vector<double> &
32 Vector<double>::operator=<int>(const ::Vector<int> &);
33 template bool
34 Vector<int>::operator==<int>(const ::Vector<int> &) const;
35 
36 // instantiate for long double manually because we use it in a few places:
37 template class Vector<long double>;
38 template long double
39 Vector<long double>::operator*<long double>(const Vector<long double> &) const;
40 
41 // do a few functions that currently don't fit the scheme because they have
42 // two template arguments that need to be different (the case of same
43 // arguments is covered by the default copy constructor and copy operator that
44 // is declared separately)
45 
46 # define TEMPL_COPY_CONSTRUCTOR(S1, S2) \
47  template Vector<S1>::Vector(const Vector<S2> &); \
48  template Vector<S1> &Vector<S1>::operator=<S2>(const Vector<S2> &)
49 
50 TEMPL_COPY_CONSTRUCTOR(double, float);
51 TEMPL_COPY_CONSTRUCTOR(float, double);
52 
53 # ifdef DEAL_II_WITH_COMPLEX_VALUES
54 TEMPL_COPY_CONSTRUCTOR(std::complex<double>, std::complex<float>);
55 TEMPL_COPY_CONSTRUCTOR(std::complex<float>, std::complex<double>);
56 # endif
57 
58 # undef TEMPL_COPY_CONSTRUCTOR
59 
60 
61 # define TEMPL_OP_EQ(S1, S2) \
62  template void Vector<S1>::scale(const Vector<S2> &); \
63  template void Vector<S1>::equ(const S1, const Vector<S2> &)
64 
65 TEMPL_OP_EQ(double, float);
66 TEMPL_OP_EQ(float, double);
67 
68 
69 # ifdef DEAL_II_WITH_COMPLEX_VALUES
70 TEMPL_OP_EQ(std::complex<double>, std::complex<float>);
71 TEMPL_OP_EQ(std::complex<float>, std::complex<double>);
72 # endif
73 
74 # undef TEMPL_OP_EQ
75 #endif
76 
77 
78 template <>
81 {
82  Assert(false, ExcMessage("No lp norm for integer vectors"));
83  return -1;
84 }
85 
Definition: vector.h:110
typename numbers::NumberTraits< Number >::real_type real_type
Definition: vector.h:147
real_type lp_norm(const real_type p) const
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:477
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:478
#define Assert(cond, exc)
Definition: exceptions.h:1616
static ::ExceptionBase & ExcMessage(std::string arg1)
#define TEMPL_COPY_CONSTRUCTOR(S1, S2)