Loading [MathJax]/extensions/TeX/AMSsymbols.js
 Reference documentation for deal.II version 8.5.1
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
vector.cc
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1999 - 2017 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 
26 template
27 void Vector<int>::reinit<double>(const Vector<double> &, const bool);
28 
29 // instantiate for long double manually because we use it in a few places:
30 template class Vector<long double>;
31 template long double Vector<long double>::operator *<long double>(const Vector<long double> &) const;
32 
33 // do a few functions that currently don't fit the scheme because they have
34 // two template arguments that need to be different (the case of same
35 // arguments is covered by the default copy constructor and copy operator that
36 // is declared separately)
37 
38 #define TEMPL_COPY_CONSTRUCTOR(S1,S2) \
39  template Vector<S1>::Vector (const Vector<S2> &); \
40  template Vector<S1>& Vector<S1>::operator=<S2> (const Vector<S2> &)
41 
42 #ifndef DEAL_II_EXPLICIT_CONSTRUCTOR_BUG
43 TEMPL_COPY_CONSTRUCTOR(double,float);
44 TEMPL_COPY_CONSTRUCTOR(float,double);
45 
46 
47 TEMPL_COPY_CONSTRUCTOR(std::complex<double>,std::complex<float>);
48 TEMPL_COPY_CONSTRUCTOR(std::complex<float>,std::complex<double>);
49 
50 #endif
51 
52 #undef TEMPL_COPY_CONSTRUCTOR
53 
54 
55 #define TEMPL_OP_EQ(S1,S2) \
56  template void Vector<S1>::scale (const Vector<S2>&); \
57  template void Vector<S1>::equ (const S1, const Vector<S2>&)
58 
59 TEMPL_OP_EQ(double,float);
60 TEMPL_OP_EQ(float,double);
61 
62 
63 TEMPL_OP_EQ(std::complex<double>,std::complex<float>);
64 TEMPL_OP_EQ(std::complex<float>,std::complex<double>);
65 
66 #undef TEMPL_OP_EQ
67 
68 #ifdef DEAL_II_BOOST_BIND_COMPILER_BUG
69 template <>
71 Vector<std::complex<float> >::operator= (const std::complex<float> s)
72 {
73  AssertIsFinite(s);
74  if (s != std::complex<float>())
75  Assert (vec_size!=0, ExcEmptyObject());
76  if (vec_size!=0)
77  std::fill (begin(), end(), s);
78 
79  return *this;
80 }
81 #endif
82 
83 template <>
85 Vector<int>::lp_norm (const real_type) const
86 {
87  Assert(false, ExcMessage("No lp norm for integer vectors"));
88  return -1;
89 }
90 
91 DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcMessage(std::string arg1)
numbers::NumberTraits< Number >::real_type real_type
Definition: vector.h:163
#define Assert(cond, exc)
Definition: exceptions.h:313
real_type lp_norm(const real_type p) const
static ::ExceptionBase & ExcEmptyObject()
#define AssertIsFinite(number)
Definition: exceptions.h:1197