From 7a4c43ed53fe0f6a61484be3e082a1d21dbd2ece Mon Sep 17 00:00:00 2001 From: Anthony LaTorre Date: Thu, 5 May 2011 16:28:09 -0400 Subject: finished basic linear algebra operations and tests --- linalg.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'linalg.h') diff --git a/linalg.h b/linalg.h index 4d0344e..698b6f5 100644 --- a/linalg.h +++ b/linalg.h @@ -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; -- cgit