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