Reference documentation for deal.II version 9.1.0-pre
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 // instantiate for integers:
23 template class Vector<int>;
25  operator=<int>(const ::Vector<int> &);
26 template bool Vector<int>::operator==<int>(::Vector<int> const &) const;
27 
28 template void
29 Vector<int>::reinit<double>(const Vector<double> &, const bool);
30 
31 // instantiate for long double manually because we use it in a few places:
32 template class Vector<long double>;
33 template long double Vector<long double>::
34  operator*<long double>(const Vector<long double> &) const;
35 
36 // do a few functions that currently don't fit the scheme because they have
37 // two template arguments that need to be different (the case of same
38 // arguments is covered by the default copy constructor and copy operator that
39 // is declared separately)
40 
41 #define TEMPL_COPY_CONSTRUCTOR(S1, S2) \
42  template Vector<S1>::Vector(const Vector<S2> &); \
43  template Vector<S1> &Vector<S1>::operator=<S2>(const Vector<S2> &)
44 
45 TEMPL_COPY_CONSTRUCTOR(double, float);
46 TEMPL_COPY_CONSTRUCTOR(float, double);
47 
48 TEMPL_COPY_CONSTRUCTOR(std::complex<double>, std::complex<float>);
49 TEMPL_COPY_CONSTRUCTOR(std::complex<float>, std::complex<double>);
50 
51 #undef TEMPL_COPY_CONSTRUCTOR
52 
53 
54 #define TEMPL_OP_EQ(S1, S2) \
55  template void Vector<S1>::scale(const Vector<S2> &); \
56  template void Vector<S1>::equ(const S1, const Vector<S2> &)
57 
58 TEMPL_OP_EQ(double, float);
59 TEMPL_OP_EQ(float, double);
60 
61 
62 TEMPL_OP_EQ(std::complex<double>, std::complex<float>);
63 TEMPL_OP_EQ(std::complex<float>, std::complex<double>);
64 
65 #undef TEMPL_OP_EQ
66 
67 
68 
69 template <>
71 Vector<int>::lp_norm(const real_type) const
72 {
73  Assert(false, ExcMessage("No lp norm for integer vectors"));
74  return -1;
75 }
76 
77 DEAL_II_NAMESPACE_CLOSE
real_type lp_norm(const real_type p) const
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:1227