32 : x(0), y(0), z(0), v(0) {
36 : x(x), y(y), z(z), v(v) {
41 x(t), y(t), z(t), v(t) {
46 : x(x), y(y.x), z(y.y), v(z) {
52 : x(other.x), y(other.y), z(other.z), v(other.v) {
67 return other.
x == x && other.
y == y && other.
z == z && other.
v ==
v;
69 #if __cplusplus > 199711L || WIN32 70 std::vector<T> toStdVector() {
75 return std::vector<T>({
x,
y,
z, v });
83 return vec4<S>(S(x), S(y), S(z), S(v));
106 return x * other.
x + y * other.
y + z * other.
z + v * other.
v;
146 return vec4<T>(a.
x * scalar, a.
y * scalar, a.
z * scalar, a.
v * scalar);
165 return vec4<T>(a.
x / scalar, a.
y / scalar, a.
z / scalar, a.
v / scalar);
172 template<
class T,
class S>
188 for (
int i = 0; i < 4; ++i) {
202 std::stringstream ss;
__device__ __host__ T & operator[](size_t i)
Definition: vec4.hpp:97
__device__ __host__ vec1< T > operator-(const vec1< T > &a, const vec1< T > &b)
Definition: vec1.hpp:140
__host__ std::string str() const
Definition: vec4.hpp:201
__device__ __host__ vec4(T t)
Definition: vec4.hpp:40
__device__ __host__ vec1< T > operator*(T scalar, const vec1< T > &a)
Definition: vec1.hpp:131
std::ostream & operator<<(std::ostream &os, const alsutils::vec4< T > &vec)
Definition: vec4.hpp:184
#define __host__
Definition: types.hpp:46
__device__ static __host__ constexpr size_t size()
Definition: vec4.hpp:112
__device__ __host__ vec4(T x, vec2< T > y, T z)
Definition: vec4.hpp:45
__device__ __host__ vec4(const vec4< T &> &other)
Definition: vec4.hpp:51
__device__ __host__ bool operator==(const vec4 &other) const
Definition: vec4.hpp:66
__device__ __host__ vec1< T > operator+(const vec1< T > &a, const vec1< S > &b)
Definition: vec1.hpp:159
Various utilities for mpi and cuda.
Definition: Factory.hpp:3
__device__ __host__ vec4(T x, T y, T z, T v)
Definition: vec4.hpp:35
T y
Definition: vec4.hpp:27
__device__ __host__ vec4 & operator=(const vec4< S > &other)
Definition: vec4.hpp:57
T v
Definition: vec4.hpp:29
#define __device__
Definition: types.hpp:45
__device__ __host__ T dot(const vec4< T > &other) const
Definition: vec4.hpp:105
T x
Definition: vec4.hpp:26
__device__ __host__ vec1< T > operator/(const vec1< T > &a, const vec1< T > &b)
Definition: vec1.hpp:121
T z
Definition: vec4.hpp:28
__device__ __host__ vec4< T > & operator+=(const vec4< S > &b)
Definition: vec4.hpp:117
__device__ __host__ vec4()
Definition: vec4.hpp:31
__device__ __host__ vec4< S > convert()
Definition: vec4.hpp:82
__device__ __host__ const T & operator[](size_t i) const
Definition: vec4.hpp:89