45 : x(x), y(y.x), z(z) {
50 : x(other.x), y(other.y), z(other.z) {
64 return other.
x == x && other.
y == y && other.
z ==
z;
66 #if __cplusplus > 199711L || WIN32 67 std::vector<T> toStdVector() {
72 return std::vector<T>({
x,
y, z });
80 return vec3<S>(S(x), S(y), S(z));
103 return x * other.
x + y * other.
y + z * other.
z;
143 return vec3<T>(a.
x * scalar, a.
y * scalar, a.
z * scalar);
150 template<
class T,
class S>
172 return vec3<T>(a.
x / scalar, a.
y / scalar, a.
z / scalar);
179 template<
class T,
class S>
194 for (
int i = 0; i < 3; ++i) {
208 std::stringstream ss;
__device__ __host__ vec1< T > operator-(const vec1< T > &a, const vec1< T > &b)
Definition: vec1.hpp:140
__device__ __host__ bool operator==(const vec3 &other) const
Definition: vec3.hpp:63
T z
Definition: vec3.hpp:28
__device__ __host__ vec3(const vec3< T &> &other)
Definition: vec3.hpp:49
__device__ __host__ vec3(T x, T y, T z)
Definition: vec3.hpp:39
__device__ __host__ vec1< T > operator*(T scalar, const vec1< T > &a)
Definition: vec1.hpp:131
__device__ __host__ vec3 & operator=(const vec3< S > &other)
Definition: vec3.hpp:55
__device__ __host__ const T & operator[](size_t i) const
Definition: vec3.hpp:86
#define __host__
Definition: types.hpp:46
__device__ static __host__ constexpr size_t size()
Definition: vec3.hpp:109
__device__ __host__ vec3< S > convert() const
Definition: vec3.hpp:79
__device__ __host__ vec3(T x, vec1< T > y, T z)
Definition: vec3.hpp:44
__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__ T dot(const vec3< T > &other) const
Definition: vec3.hpp:102
__device__ __host__ vec3< T > & operator+=(const vec3< S > &b)
Definition: vec3.hpp:114
#define __device__
Definition: types.hpp:45
__device__ __host__ T & operator[](size_t i)
Definition: vec3.hpp:94
T y
Definition: vec3.hpp:27
__device__ __host__ vec1< T > operator/(const vec1< T > &a, const vec1< T > &b)
Definition: vec1.hpp:121
__device__ __host__ vec3(T t)
Definition: vec3.hpp:35
__host__ std::string str() const
Definition: vec3.hpp:207
std::ostream & operator<<(std::ostream &os, const alsutils::vec3< T > &vec)
Definition: vec3.hpp:190
__device__ __host__ vec3()
Definition: vec3.hpp:30
T x
Definition: vec3.hpp:26