Reference documentation for deal.II version GIT relicensing-222-g16f23ad599 2024-03-28 18:20: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: LGPL-2.1-or-later
4// Copyright (C) 1999 - 2023 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
89template Vector<float> &
92# endif
93
94# ifdef HAVE_TPETRA_INST_DOUBLE
97template Vector<double> &
100# endif
101
102# ifdef DEAL_II_WITH_COMPLEX_VALUES
103# ifdef HAVE_TPETRA_INST_COMPLEX_FLOAT
105 const LinearAlgebra::TpetraWrappers::Vector<std::complex<float>> &);
107Vector<std::complex<float>>::operator=<std::complex<float>>(
109# endif
110
111# ifdef HAVE_TPETRA_INST_COMPLEX_DOUBLE
113 const LinearAlgebra::TpetraWrappers::Vector<std::complex<double>> &);
115Vector<std::complex<double>>::operator=<std::complex<double>>(
117# endif
118# endif
119#endif
120
typename numbers::NumberTraits< Number >::real_type real_type
Definition vector.h:157
real_type lp_norm(const real_type p) const
friend class Vector
Definition vector.h:1109
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:502
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:503
#define Assert(cond, exc)
#define TEMPL_COPY_CONSTRUCTOR(S1, S2)