deal.II version GIT relicensing-6842-g793a97d2aa 2026-10-02 14:00:01+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> &
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#ifndef DOXYGEN
86# ifdef DEAL_II_TRILINOS_WITH_TPETRA
87# ifdef DEAL_II_TRILINOS_WITH_TPETRA_INST_FLOAT
94template Vector<float> &
97template Vector<float> &
100# endif
101
102# ifdef DEAL_II_TRILINOS_WITH_TPETRA_INST_DOUBLE
107template Vector<double> &
110template Vector<double> &
113template ::Vector<float> &
115 const ::LinearAlgebra::TpetraWrappers::Vector<double,
117 &);
118# endif
119
120# ifdef DEAL_II_WITH_COMPLEX_VALUES
121# ifdef DEAL_II_TRILINOS_WITH_TPETRA_INST_COMPLEX_FLOAT
123 const LinearAlgebra::TpetraWrappers::Vector<std::complex<float>,
126 const LinearAlgebra::TpetraWrappers::Vector<std::complex<float>,
129Vector<std::complex<float>>::operator=<std::complex<float>>(
133Vector<std::complex<float>>::operator=<std::complex<float>>(
136# endif
137
138# ifdef DEAL_II_TRILINOS_WITH_TPETRA_INST_COMPLEX_DOUBLE
140 const LinearAlgebra::TpetraWrappers::Vector<std::complex<double>,
143 const LinearAlgebra::TpetraWrappers::Vector<std::complex<double>,
146Vector<std::complex<double>>::operator=<std::complex<double>>(
150Vector<std::complex<double>>::operator=<std::complex<double>>(
153# endif
154# endif
155# endif
156#endif
157
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)