summaryrefslogtreecommitdiff
path: root/linalg.h
diff options
context:
space:
mode:
authorAnthony LaTorre <telatorre@gmail.com>2011-05-05 16:28:09 -0400
committerAnthony LaTorre <telatorre@gmail.com>2011-05-05 16:28:09 -0400
commit7a4c43ed53fe0f6a61484be3e082a1d21dbd2ece (patch)
treee32fee7d8da724b64ba0bcbc9ed4026cccd04feb /linalg.h
parent48cb6fc276143567e13bfec6846721beb4ca2f46 (diff)
downloadchroma-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.h10
1 files changed, 5 insertions, 5 deletions
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;