34 x(t), y(t), z(t), v(t), w(t) {
38 : x(0), y(0), z(0), v(0), w(0) {
42 : x(x), y(y), z(z), v(v), w(w) {
47 : x(x), y(y.x), z(y.y), v(y.z), w(z) {
52 : x(other.x), y(other.y), z(other.z), v(other.v), w(other.w) {
69 return other.
x == x && other.
y == y && other.
z == z && other.
v == v
72 #if __cplusplus > 199711L || WIN32 73 std::vector<T> toStdVector() {
78 return std::vector<T>({
x,
y,
z,
v, w });
86 return vec5<S>(S(x), S(y), S(z), S(v), S(w));
102 return ((T*)
this)[i];
109 return x * other.
x + y * other.
y + z * other.
z + v * other.
v + w * other.
w;
149 return vec5<T>(a.
x * scalar, a.
y * scalar, a.
z * scalar, a.
v * scalar,
169 return vec5<T>(a.
x / scalar, a.
y / scalar, a.
z / scalar, a.
v / scalar,
177 template<
class T,
class S>
195 for (
int i = 0; i < 5; ++i) {
209 std::stringstream ss;
__device__ __host__ vec1< T > operator-(const vec1< T > &a, const vec1< T > &b)
Definition: vec1.hpp:140
T y
Definition: vec5.hpp:27
__device__ __host__ bool operator==(const vec5 &other) const
Definition: vec5.hpp:68
__device__ __host__ vec1< T > operator*(T scalar, const vec1< T > &a)
Definition: vec1.hpp:131
#define __host__
Definition: types.hpp:46
__device__ __host__ vec5 & operator=(const vec5< S > &other)
Definition: vec5.hpp:58
__device__ __host__ vec5(T x, vec3< T > y, T z)
Definition: vec5.hpp:46
__host__ std::string str() const
Definition: vec5.hpp:208
__device__ __host__ T & operator[](size_t i)
Definition: vec5.hpp:100
__device__ __host__ vec1< T > operator+(const vec1< T > &a, const vec1< S > &b)
Definition: vec1.hpp:159
__device__ __host__ vec5< T > & operator+=(const vec5< S > &b)
Definition: vec5.hpp:120
Various utilities for mpi and cuda.
Definition: Factory.hpp:3
T v
Definition: vec5.hpp:29
__device__ __host__ vec5< S > convert()
Definition: vec5.hpp:85
__device__ __host__ vec5(const vec5< T &> &other)
Definition: vec5.hpp:51
__device__ static __host__ constexpr size_t size()
Definition: vec5.hpp:115
__device__ __host__ vec5(T t)
Definition: vec5.hpp:33
__device__ __host__ const T & operator[](size_t i) const
Definition: vec5.hpp:92
#define __device__
Definition: types.hpp:45
__device__ __host__ vec5()
Definition: vec5.hpp:37
__device__ __host__ T dot(const vec5< T > &other) const
Definition: vec5.hpp:108
T w
Definition: vec5.hpp:30
__device__ __host__ vec1< T > operator/(const vec1< T > &a, const vec1< T > &b)
Definition: vec1.hpp:121
__device__ __host__ vec5(T x, T y, T z, T v, T w)
Definition: vec5.hpp:41
T z
Definition: vec5.hpp:28
T x
Definition: vec5.hpp:26
std::ostream & operator<<(std::ostream &os, const alsutils::vec5< T > &vec)
Definition: vec5.hpp:191