ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
Utils::Vector< T, N > Class Template Reference

#include <Vector.hpp>

+ Inheritance diagram for Utils::Vector< T, N >:
+ Collaboration diagram for Utils::Vector< T, N >:

Public Member Functions

 Vector ()=default
 
 Vector (Vector const &)=default
 
Vectoroperator= (Vector const &)=default
 
void swap (Vector &rhs)
 
template<class Range >
constexpr Vector (Range const &rng)
 
constexpr Vector (T const (&v)[N])
 
constexpr Vector (std::initializer_list< T > v)
 
template<typename InputIterator >
 Vector (InputIterator first, InputIterator last)
 
std::vector< T > as_vector () const
 
 operator std::vector< T > () const
 
constexpr std::span< T, N > as_span () const
 
constexpr operator std::span< T, N > () const
 
template<class U >
 operator Vector< U, N > () const
 
norm2 () const
 
norm () const
 
Vectornormalize ()
 
Vector normalized () const
 
- Public Member Functions inherited from Utils::Array< T, N >
DEVICE_QUALIFIER constexpr reference at (size_type i)
 
DEVICE_QUALIFIER constexpr const_reference at (size_type i) const
 
DEVICE_QUALIFIER constexpr reference operator[] (size_type i)
 
DEVICE_QUALIFIER constexpr const_reference operator[] (size_type i) const
 
DEVICE_QUALIFIER constexpr reference front ()
 
DEVICE_QUALIFIER constexpr const_reference front () const
 
DEVICE_QUALIFIER constexpr reference back ()
 
DEVICE_QUALIFIER constexpr const_reference back () const
 
DEVICE_QUALIFIER constexpr pointer data () noexcept
 
DEVICE_QUALIFIER constexpr const_pointer data () const noexcept
 
DEVICE_QUALIFIER constexpr iterator begin () noexcept
 
DEVICE_QUALIFIER constexpr const_iterator begin () const noexcept
 
DEVICE_QUALIFIER constexpr const_iterator cbegin () const noexcept
 
DEVICE_QUALIFIER constexpr iterator end () noexcept
 
DEVICE_QUALIFIER constexpr const_iterator end () const noexcept
 
DEVICE_QUALIFIER constexpr const_iterator cend () const noexcept
 
DEVICE_QUALIFIER constexpr bool empty () const noexcept
 
DEVICE_QUALIFIER constexpr size_type size () const noexcept
 
DEVICE_QUALIFIER constexpr size_type max_size () const noexcept
 
DEVICE_QUALIFIER void fill (const value_type &value)
 

Static Public Member Functions

static DEVICE_QUALIFIER constexpr Vector< T, N > broadcast (typename Base::value_type const &value)
 Create a vector that has all entries set to the same value.
 
- Static Public Member Functions inherited from Utils::Array< T, N >
static DEVICE_QUALIFIER constexpr Array< T, N > broadcast (const value_type &value)
 
static constexpr detail::ArrayFormatter formatter (char const *sep=" ")
 

Additional Inherited Members

- Public Types inherited from Utils::Array< T, N >
using value_type = T
 
using size_type = std::size_t
 
using difference_type = std::ptrdiff_t
 
using reference = value_type &
 
using const_reference = const value_type &
 
using iterator = value_type *
 
using const_iterator = const value_type *
 
using pointer = value_type *
 
using const_pointer = const value_type *
 
- Public Attributes inherited from Utils::Array< T, N >
detail::Storage< T, N > m_storage
 

Detailed Description

template<typename T, std::size_t N>
class Utils::Vector< T, N >

Definition at line 48 of file Vector.hpp.

Constructor & Destructor Documentation

◆ Vector() [1/6]

template<typename T , std::size_t N>
Utils::Vector< T, N >::Vector ( )
default

◆ Vector() [2/6]

template<typename T , std::size_t N>
Utils::Vector< T, N >::Vector ( Vector< T, N > const &  )
default

◆ Vector() [3/6]

template<typename T , std::size_t N>
template<class Range >
constexpr Utils::Vector< T, N >::Vector ( Range const &  rng)
inlineexplicitconstexpr

Definition at line 83 of file Vector.hpp.

◆ Vector() [4/6]

template<typename T , std::size_t N>
constexpr Utils::Vector< T, N >::Vector ( T const (&)  v[N])
inlineexplicitconstexpr

Definition at line 85 of file Vector.hpp.

◆ Vector() [5/6]

template<typename T , std::size_t N>
constexpr Utils::Vector< T, N >::Vector ( std::initializer_list< T >  v)
inlineconstexpr

Definition at line 89 of file Vector.hpp.

◆ Vector() [6/6]

template<typename T , std::size_t N>
template<typename InputIterator >
Utils::Vector< T, N >::Vector ( InputIterator  first,
InputIterator  last 
)
inline

Definition at line 99 of file Vector.hpp.

References Utils::Array< T, N >::begin().

Member Function Documentation

◆ as_span()

template<typename T , std::size_t N>
constexpr std::span< T, N > Utils::Vector< T, N >::as_span ( ) const
inlineconstexpr

◆ as_vector()

template<typename T , std::size_t N>
std::vector< T > Utils::Vector< T, N >::as_vector ( ) const
inline

◆ broadcast()

template<typename T , std::size_t N>
static DEVICE_QUALIFIER constexpr Vector< T, N > Utils::Vector< T, N >::broadcast ( typename Base::value_type const &  value)
inlinestaticconstexpr

Create a vector that has all entries set to the same value.

Definition at line 110 of file Vector.hpp.

Referenced by P3MLocalMesh::calc_local_ca_mesh(), Utils::calc_orthonormal_vector(), Observables::LBProfileObservable::calculate_sampling_positions(), CoulombTuningAlgorithm< FloatType, Architecture >::determine_mesh_limits(), DipolarP3MImpl< FloatType, Architecture >::DipolarP3MImpl(), ScriptInterface::System::System::do_call_method(), ScriptInterface::Integrators::VelocityVerletIsoNPT::do_construct(), dp3m_k_space_error(), dp3m_tune_aliasing_sums(), FieldCoupling::Fields::Interpolated< T, codim >::fits_in_box(), G_opt(), G_opt_dipolar(), G_opt_dipolar_self_energy(), ScriptInterface::Particles::get_gamma_safe(), walberla::EKinWalberlaImpl< FluxCount, FloatType >::get_interval(), walberla::LBWalberlaImpl< FloatType, Architecture >::get_interval(), DipolarTuningAlgorithm< FloatType, Architecture >::get_time(), in_local_domain(), CoulombP3MImpl< FloatType, Architecture >::init_cpu_kernels(), DipolarP3MImpl< FloatType, Architecture >::init_cpu_kernels(), walberla::interpolate_bspline_at_pos(), LB::ParticleCoupling::kernel(), lb_handle_particle_anisotropy(), CoulombP3MImpl< FloatType, Architecture >::long_range_kernel(), DipolarP3MImpl< FloatType, Architecture >::long_range_kernel(), CoulombP3MImpl< FloatType, Architecture >::long_range_pressure(), AtomDecomposition::max_cutoff(), p3m_calculate_interpolation_weights(), p3m_gpu_init(), p3m_tune_aliasing_sums(), P3MParameters::P3MParameters(), positions_in_halo(), P3MParameters::recalc_a_ai_cao_cut(), ScriptInterface::Thermostat::Interface< CoreClass >::sanity_checks_positive(), and ScriptInterface::walberla::LatticeSlice< FieldSerializer >::scatter_3d().

◆ norm()

◆ norm2()

template<typename T , std::size_t N>
T Utils::Vector< T, N >::norm2 ( ) const
inline

◆ normalize()

template<typename T , std::size_t N>
Vector & Utils::Vector< T, N >::normalize ( )
inline

◆ normalized()

template<typename T , std::size_t N>
Vector Utils::Vector< T, N >::normalized ( ) const
inline

Definition at line 157 of file Vector.hpp.

References Utils::Vector< T, N >::norm().

Referenced by Utils::basis_change().

◆ operator std::span< T, N >()

template<typename T , std::size_t N>
constexpr Utils::Vector< T, N >::operator std::span< T, N > ( ) const
inlineconstexpr

Definition at line 126 of file Vector.hpp.

◆ operator std::vector< T >()

template<typename T , std::size_t N>
Utils::Vector< T, N >::operator std::vector< T > ( ) const
inline

Definition at line 120 of file Vector.hpp.

◆ operator Vector< U, N >()

template<typename T , std::size_t N>
template<class U >
Utils::Vector< T, N >::operator Vector< U, N > ( ) const
inlineexplicit

Definition at line 128 of file Vector.hpp.

References Utils::Array< T, N >::begin(), and Utils::Array< T, N >::end().

◆ operator=()

template<typename T , std::size_t N>
Vector & Utils::Vector< T, N >::operator= ( Vector< T, N > const &  )
default

◆ swap()

template<typename T , std::size_t N>
void Utils::Vector< T, N >::swap ( Vector< T, N > &  rhs)
inline

Definition at line 71 of file Vector.hpp.

References Utils::Array< T, N >::begin(), and Utils::Array< T, N >::end().


The documentation for this class was generated from the following file: