16 #ifndef dealii_cuda_vector_h 17 #define dealii_cuda_vector_h 19 #include <deal.II/base/config.h> 21 #include <deal.II/base/exceptions.h> 22 #include <deal.II/base/index_set.h> 24 #include <deal.II/lac/vector_operation.h> 25 #include <deal.II/lac/vector_space_vector.h> 27 #ifdef DEAL_II_WITH_CUDA 29 DEAL_II_NAMESPACE_OPEN
31 class CommunicationPatternBase;
32 template <
typename Number>
33 class ReadWriteVector;
52 template <
typename Number>
53 class Vector :
public VectorSpaceVector<Number>
56 using value_type =
typename VectorSpaceVector<Number>::value_type;
57 using size_type =
typename VectorSpaceVector<Number>::size_type;
58 using real_type =
typename VectorSpaceVector<Number>::real_type;
68 Vector(
const Vector<Number> &V);
73 Vector(Vector<Number> &&) noexcept = default;
85 explicit
Vector(const size_type n);
91 operator=(const
Vector<Number> &v);
97 operator=(
Vector<Number> &&v) noexcept = default;
123 reinit(const size_type n, const
bool omit_zeroing_entries = false);
130 reinit(const VectorSpaceVector<Number> &V,
131 const
bool omit_zeroing_entries = false) override;
143 const ReadWriteVector<Number> & V,
145 std::shared_ptr<const CommunicationPatternBase> communication_pattern =
146 std::shared_ptr<const CommunicationPatternBase>()) override;
153 operator=(const Number s) override;
159 operator*=(const Number factor) override;
165 operator/=(const Number factor) override;
171 operator+=(const VectorSpaceVector<Number> &V) override;
177 operator-=(const VectorSpaceVector<Number> &V) override;
183 operator*(const VectorSpaceVector<Number> &V) const override;
189 add(const Number a) override;
195 add(const Number a, const VectorSpaceVector<Number> &V) override;
202 const VectorSpaceVector<Number> &V,
204 const VectorSpaceVector<Number> &W) override;
213 const VectorSpaceVector<Number> &V) override;
221 scale(const VectorSpaceVector<Number> &scaling_factors) override;
227 equ(const Number a, const VectorSpaceVector<Number> &V) override;
289 const VectorSpaceVector<Number> &V,
290 const VectorSpaceVector<Number> &W) override;
303 size() const override;
317 const
unsigned int precision = 2,
318 const
bool scientific = true,
319 const
bool across = true) const override;
338 std::unique_ptr<Number[],
void (*)(Number *)>
val;
358 template <typename Number>
370 template <
typename Number>
379 template <
typename Number>
387 template <
typename Number>
396 template <
typename Number>
406 DEAL_II_NAMESPACE_CLOSE
virtual Number add_and_dot(const Number a, const VectorSpaceVector< Number > &V, const VectorSpaceVector< Number > &W) override
virtual void equ(const Number a, const VectorSpaceVector< Number > &V) override
void reinit(const size_type n, const bool omit_zeroing_entries=false)
Number * get_values() const
std::unique_ptr< Number[], void(*)(Number *)> val
virtual real_type l1_norm() const override
virtual void swap(Vector< Number > &v)
LinearAlgebra::distributed::Vector< Number > Vector
virtual value_type mean_value() const override
virtual ::IndexSet locally_owned_elements() const override
virtual void add(const Number a) override
#define DeclException0(Exception0)
static ::ExceptionBase & ExcVectorTypeNotCompatible()
virtual bool all_zero() const override
void swap(Vector< Number > &u, Vector< Number > &v)
real_type norm_sqr() const
virtual std::size_t memory_consumption() const override
virtual real_type l2_norm() const override
virtual void scale(const VectorSpaceVector< Number > &scaling_factors) override
virtual void sadd(const Number s, const Number a, const VectorSpaceVector< Number > &V) override
virtual void import(const ReadWriteVector< Number > &V, VectorOperation::values operation, std::shared_ptr< const CommunicationPatternBase > communication_pattern=std::shared_ptr< const CommunicationPatternBase >()) override
virtual void print(std::ostream &out, const unsigned int precision=2, const bool scientific=true, const bool across=true) const override
virtual size_type size() const override
virtual real_type linfty_norm() const override