#ifndef RTS_rtsPoint_H #define RTS_rtsPoint_H #include "rts/math/vector.h" #include #include "rts/cuda/callable.h" namespace rts { template struct point { T p[N]; CUDA_CALLABLE point() { } //efficiency constructor, makes construction easier for 1D-4D vectors CUDA_CALLABLE point(T x, T y = (T)0.0, T z = (T)0.0, T w = (T)0.0) { if(N >= 1) p[0] = x; if(N >= 2) p[1] = y; if(N >= 3) p[2] = z; if(N >= 4) p[3] = w; } //arithmetic operators CUDA_CALLABLE rts::point operator+(vector v) { rts::point r; //calculate the position of the resulting point for(int i=0; i operator-(vector v) { rts::point r; //calculate the position of the resulting point for(int i=0; i operator-(point rhs) { vector r; //calculate the position of the resulting point for(int i=0; i operator*(T rhs) { rts::point r; //calculate the position of the resulting point for(int i=0; i std::ostream& operator<<(std::ostream& os, rts::point p) { os< CUDA_CALLABLE rts::point operator*(T lhs, rts::point rhs) { rts::point r; return rhs * lhs; } //#if __GNUC__ > 3 && __GNUC_MINOR__ > 7 //template using rtsPoint = rts::point; //#endif #endif