deal.II version GIT relicensing-7069-g10dda06ddc 2026-11-13 05:10:02+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: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
4// Copyright (C) 1999 - 2026 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Detailed license information governing the source code and contributions
9// can be found in LICENSE.md and CONTRIBUTING.md at the top level directory.
10//
11// -----------------------------------------------------------------------------
12
13#include <deal.II/lac/vector.templates.h>
14
15#include <complex>
16
18
19#ifndef DOXYGEN
20# include "lac/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> &
31 Vector<double>::operator= <int>(const ::Vector<int> &);
32template bool Vector<int>::operator== <int>(const ::Vector<int> &) const;
33
34// instantiate for long double manually because we use it in a few places:
35template class Vector<long double>;
36template long double Vector<long double>::operator*
37 <long double>(const Vector<long double> &) const;
38
39// do a few functions that currently don't fit the scheme because they have
40// two template arguments that need to be different (the case of same
41// arguments is covered by the default copy constructor and copy operator that
42// is declared separately)
43
44# define TEMPL_COPY_CONSTRUCTOR(S1, S2) \
45 template Vector<S1>::Vector(const Vector<S2> &); \
46 template Vector<S1> &Vector<S1>::operator= <S2>(const Vector<S2> &)
47
48TEMPL_COPY_CONSTRUCTOR(double, float);
49TEMPL_COPY_CONSTRUCTOR(float, double);
50
51# ifdef DEAL_II_WITH_COMPLEX_VALUES
52TEMPL_COPY_CONSTRUCTOR(std::complex<double>, std::complex<float>);
53TEMPL_COPY_CONSTRUCTOR(std::complex<float>, std::complex<double>);
54# endif
55
56# undef TEMPL_COPY_CONSTRUCTOR
57
58
59# define TEMPL_OP_EQ(S1, S2) \
60 template void Vector<S1>::scale(const Vector<S2> &); \
61 template void Vector<S1>::equ(const S1, const Vector<S2> &)
62
63TEMPL_OP_EQ(double, float);
64TEMPL_OP_EQ(float, double);
65
66
67# ifdef DEAL_II_WITH_COMPLEX_VALUES
68TEMPL_OP_EQ(std::complex<double>, std::complex<float>);
69TEMPL_OP_EQ(std::complex<float>, std::complex<double>);
70# endif
71
72# undef TEMPL_OP_EQ
73#endif
74
75
76template <>
79{
80 Assert(false, ExcMessage("No lp norm for integer vectors"));
81 return -1;
82}
83
84#ifndef DOXYGEN
85# ifdef DEAL_II_TRILINOS_WITH_TPETRA
86# ifdef DEAL_II_TRILINOS_WITH_TPETRA_INST_FLOAT
93template Vector<float> &Vector<float>::operator= <float>(
95template Vector<float> &Vector<float>::operator= <float>(
97# endif
98
99# ifdef DEAL_II_TRILINOS_WITH_TPETRA_INST_DOUBLE
104template Vector<double> &Vector<double>::operator= <double>(
106template Vector<double> &Vector<double>::operator= <double>(
108template ::Vector<float> &
110 const ::LinearAlgebra::TpetraWrappers::
111 Vector<double, ::MemorySpace::Host> &);
112# endif
113
114# ifdef DEAL_II_WITH_COMPLEX_VALUES
115# ifdef DEAL_II_TRILINOS_WITH_TPETRA_INST_COMPLEX_FLOAT
117 const LinearAlgebra::TpetraWrappers::Vector<std::complex<float>,
120 const LinearAlgebra::TpetraWrappers::Vector<std::complex<float>,
123 Vector<std::complex<float>>::operator= <std::complex<float>>(
127 Vector<std::complex<float>>::operator= <std::complex<float>>(
130# endif
131
132# ifdef DEAL_II_TRILINOS_WITH_TPETRA_INST_COMPLEX_DOUBLE
134 const LinearAlgebra::TpetraWrappers::Vector<std::complex<double>,
137 const LinearAlgebra::TpetraWrappers::Vector<std::complex<double>,
140 Vector<std::complex<double>>::operator= <std::complex<double>>(
144 Vector<std::complex<double>>::operator= <std::complex<double>>(
147# endif
148# endif
149# endif
150#endif
151
typename numbers::NumberTraits< Number >::real_type real_type
Definition vector.h:133
real_type lp_norm(const real_type p) const
friend class Vector
Definition vector.h:1102
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
#define Assert(cond, exc)