diff options
author | Anthony LaTorre <telatorre@gmail.com> | 2011-05-05 16:28:09 -0400 |
---|---|---|
committer | Anthony LaTorre <telatorre@gmail.com> | 2011-05-05 16:28:09 -0400 |
commit | 7a4c43ed53fe0f6a61484be3e082a1d21dbd2ece (patch) | |
tree | e32fee7d8da724b64ba0bcbc9ed4026cccd04feb /linalg.h | |
parent | 48cb6fc276143567e13bfec6846721beb4ca2f46 (diff) | |
download | chroma-7a4c43ed53fe0f6a61484be3e082a1d21dbd2ece.tar.gz chroma-7a4c43ed53fe0f6a61484be3e082a1d21dbd2ece.tar.bz2 chroma-7a4c43ed53fe0f6a61484be3e082a1d21dbd2ece.zip |
finished basic linear algebra operations and tests
Diffstat (limited to 'linalg.h')
-rw-r--r-- | linalg.h | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -3,7 +3,7 @@ __device__ __host__ float3 operator+ (const float3 &a, const float3 &b) { - return make_float3(a.x+b.x, a.y+b.y, a.z+b.y); + return make_float3(a.x+b.x, a.y+b.y, a.z+b.z); } __device__ __host__ void operator+= (float3 &a, const float3 &b) @@ -30,7 +30,7 @@ __device__ __host__ float3 operator+ (const float3 &a, const float &c) return make_float3(a.x+c, a.y+c, a.z+c); } -__device__ __host__ float3 operator+= (const float3 &a, const float &c) +__device__ __host__ void operator+= (float3 &a, const float &c) { a.x += c; a.y += c; @@ -47,7 +47,7 @@ __device__ __host__ float3 operator- (const float3 &a, const float &c) return make_float3(a.x-c, a.y-c, a.z-c); } -__device__ __host__ float3 operator-= (const float3 &a, const float &c) +__device__ __host__ void operator-= (float3 &a, const float &c) { a.x -= c; a.y -= c; @@ -64,7 +64,7 @@ __device__ __host__ float3 operator* (const float3 &a, const float &c) return make_float3(a.x*c, a.y*c, a.z*c); } -__device__ __host__ float3 operator*= (const float3 &a, const float &c) +__device__ __host__ void operator*= (float3 &a, const float &c) { a.x *= c; a.y *= c; @@ -81,7 +81,7 @@ __device__ __host__ float3 operator/ (const float3 &a, const float &c) return make_float3(a.x/c, a.y/c, a.z/c); } -__device__ __host__ float3 operator/= (const float3 &a, const float &c) +__device__ __host__ void operator/= (float3 &a, const float &c) { a.x /= c; a.y /= c; |