deal.II version GIT relicensing-2291-g668cd86249 2024-12-24 11:30:00+00:00
\(\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\}}\)
Loading...
Searching...
No Matches
vector.cc
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 1999 - 2024 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Part of the source code is dual licensed under Apache-2.0 WITH
9// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10// governing the source code and code contributions can be found in
11// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12//
13// ------------------------------------------------------------------------
14
15#include <deal.II/lac/vector.templates.h>
16
18
19#ifndef DOXYGEN
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.
25template class Vector<std::complex<double>>;
26# endif
27
28// instantiate for integers:
29template class Vector<int>;
30template Vector<double> &
31Vector<double>::operator=<int>(const ::Vector<int> &);
32template bool
33Vector<int>::operator==<int>(const ::Vector<int> &) const;
34
35// instantiate for long double manually because we use it in a few places:
36template class Vector<long double>;
37template long double
38Vector<long double>::operator*<long double>(const Vector<long double> &) const;
39
40// do a few functions that currently don't fit the scheme because they have
41// two template arguments that need to be different (the case of same
42// arguments is covered by the default copy constructor and copy operator that
43// is declared separately)
44
45# define TEMPL_COPY_CONSTRUCTOR(S1, S2) \
46 template Vector<S1>::Vector(const Vector<S2> &); \
47 template Vector<S1> &Vector<S1>::operator=<S2>(const Vector<S2> &)
48
49TEMPL_COPY_CONSTRUCTOR(double, float);
50TEMPL_COPY_CONSTRUCTOR(float, double);
51
52# ifdef DEAL_II_WITH_COMPLEX_VALUES
53TEMPL_COPY_CONSTRUCTOR(std::complex<double>, std::complex<float>);
54TEMPL_COPY_CONSTRUCTOR(std::complex<float>, std::complex<double>);
55# endif
56
57# undef TEMPL_COPY_CONSTRUCTOR
58
59
60# define TEMPL_OP_EQ(S1, S2) \
61 template void Vector<S1>::scale(const Vector<S2> &); \
62 template void Vector<S1>::equ(const S1, const Vector<S2> &)
63
64TEMPL_OP_EQ(double, float);
65TEMPL_OP_EQ(float, double);
66
67
68# ifdef DEAL_II_WITH_COMPLEX_VALUES
69TEMPL_OP_EQ(std::complex<double>, std::complex<float>);
70TEMPL_OP_EQ(std::complex<float>, std::complex<double>);
71# endif
72
73# undef TEMPL_OP_EQ
74#endif
75
76
77template <>
80{
81 Assert(false, ExcMessage("No lp norm for integer vectors"));
82 return -1;
83}
84
85#ifdef DEAL_II_TRILINOS_WITH_TPETRA
86# ifdef HAVE_TPETRA_INST_FLOAT
91template Vector<float> &
94template Vector<float> &
97# endif
98
99# ifdef HAVE_TPETRA_INST_DOUBLE
104template Vector<double> &
107template Vector<double> &
110# endif
111
112# ifdef DEAL_II_WITH_COMPLEX_VALUES
113# ifdef HAVE_TPETRA_INST_COMPLEX_FLOAT
115 const LinearAlgebra::TpetraWrappers::Vector<std::complex<float>,
118 const LinearAlgebra::TpetraWrappers::Vector<std::complex<float>,
121Vector<std::complex<float>>::operator=<std::complex<float>>(
125Vector<std::complex<float>>::operator=<std::complex<float>>(
128# endif
129
130# ifdef HAVE_TPETRA_INST_COMPLEX_DOUBLE
132 const LinearAlgebra::TpetraWrappers::Vector<std::complex<double>,
135 const LinearAlgebra::TpetraWrappers::Vector<std::complex<double>,
138Vector<std::complex<double>>::operator=<std::complex<double>>(
142Vector<std::complex<double>>::operator=<std::complex<double>>(
145# endif
146# endif
147#endif
148
typename numbers::NumberTraits< Number >::real_type real_type
Definition vector.h:155
real_type lp_norm(const real_type p) const
friend class Vector
Definition vector.h:1124
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:498
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:499
#define Assert(cond, exc)
#define TEMPL_COPY_CONSTRUCTOR(S1, S2)