46 : x(other.x), y(other.y) {
63 return other.
x == x && other.
y ==
y;
65 #if __cplusplus > 199711L || WIN32 66 std::vector<T> toStdVector() {
71 return std::vector<T>({
x, y });
102 return x * other.
x + y * other.
y;
138 return vec2<T>(a.
x * scalar, a.
y * scalar);
157 return vec2<T>(a.
x / scalar, a.
y / scalar);
164 template<
class T,
class S>
T x
Definition: vec2.hpp:25
__device__ __host__ vec1< T > operator-(const vec1< T > &a, const vec1< T > &b)
Definition: vec1.hpp:140
T y
Definition: vec2.hpp:26
__device__ __host__ const T & operator[](size_t i) const
Definition: vec2.hpp:85
__device__ __host__ vec1< T > operator*(T scalar, const vec1< T > &a)
Definition: vec1.hpp:131
#define __host__
Definition: types.hpp:46
__device__ __host__ vec2(const vec2< T &> &other)
Definition: vec2.hpp:45
__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__ bool operator==(const vec2 &other) const
Definition: vec2.hpp:62
__device__ __host__ vec2(T t)
Definition: vec2.hpp:33
__device__ __host__ T dot(const vec2< T > &other) const
Definition: vec2.hpp:101
__device__ __host__ vec2< S > convert() const
Definition: vec2.hpp:78
#define __device__
Definition: types.hpp:45
__device__ __host__ vec2< T > & operator+=(const vec2< S > &b)
Definition: vec2.hpp:113
__device__ __host__ vec1< T > operator/(const vec1< T > &a, const vec1< T > &b)
Definition: vec1.hpp:121
__device__ static __host__ constexpr size_t size()
Definition: vec2.hpp:108
__device__ __host__ T & operator[](size_t i)
Definition: vec2.hpp:93
__device__ __host__ vec2()
Definition: vec2.hpp:28
__device__ __host__ vec2 & operator=(const vec2< S > &other)
Definition: vec2.hpp:53
__device__ __host__ vec2(T x, T y)
Definition: vec2.hpp:38