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