Reference documentation for deal.II version 9.3.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\}}\)
vector.cc
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1999 - 2020 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>;
32  operator=<int>(const ::Vector<int> &);
33 template bool Vector<int>::operator==<int>(::Vector<int> const &) const;
34 
35 template void
36 Vector<int>::reinit<double>(const Vector<double> &, const bool);
37 
38 // instantiate for long double manually because we use it in a few places:
39 template class Vector<long double>;
40 template long double Vector<long double>::
41  operator*<long double>(const Vector<long double> &) const;
42 
43 // do a few functions that currently don't fit the scheme because they have
44 // two template arguments that need to be different (the case of same
45 // arguments is covered by the default copy constructor and copy operator that
46 // is declared separately)
47 
48 # define TEMPL_COPY_CONSTRUCTOR(S1, S2) \
49  template Vector<S1>::Vector(const Vector<S2> &); \
50  template Vector<S1> &Vector<S1>::operator=<S2>(const Vector<S2> &)
51 
52 TEMPL_COPY_CONSTRUCTOR(double, float);
53 TEMPL_COPY_CONSTRUCTOR(float, double);
54 
55 # ifdef DEAL_II_WITH_COMPLEX_VALUES
56 TEMPL_COPY_CONSTRUCTOR(std::complex<double>, std::complex<float>);
57 TEMPL_COPY_CONSTRUCTOR(std::complex<float>, std::complex<double>);
58 # endif
59 
60 # undef TEMPL_COPY_CONSTRUCTOR
61 
62 
63 # define TEMPL_OP_EQ(S1, S2) \
64  template void Vector<S1>::scale(const Vector<S2> &); \
65  template void Vector<S1>::equ(const S1, const Vector<S2> &)
66 
67 TEMPL_OP_EQ(double, float);
68 TEMPL_OP_EQ(float, double);
69 
70 
71 # ifdef DEAL_II_WITH_COMPLEX_VALUES
72 TEMPL_OP_EQ(std::complex<double>, std::complex<float>);
73 TEMPL_OP_EQ(std::complex<float>, std::complex<double>);
74 # endif
75 
76 # undef TEMPL_OP_EQ
77 #endif
78 
79 
80 template <>
83 {
84  Assert(false, ExcMessage("No lp norm for integer vectors"));
85  return -1;
86 }
87 
#define TEMPL_COPY_CONSTRUCTOR(S1, S2)
typename numbers::NumberTraits< Number >::real_type real_type
Definition: vector.h:140
static ::ExceptionBase & ExcMessage(std::string arg1)
#define Assert(cond, exc)
Definition: exceptions.h:1465
real_type lp_norm(const real_type p) const
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:395
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:394