summaryrefslogtreecommitdiff
path: root/linalg.h
diff options
context:
space:
mode:
Diffstat (limited to 'linalg.h')
-rw-r--r--linalg.h116
1 files changed, 0 insertions, 116 deletions
diff --git a/linalg.h b/linalg.h
deleted file mode 100644
index 593aa9d..0000000
--- a/linalg.h
+++ /dev/null
@@ -1,116 +0,0 @@
-#ifndef __LINALG_H__
-#define __LINALG_H__
-
-__device__ __host__ float3 operator- (const float3 &a)
-{
- return make_float3(-a.x, -a.y, -a.z);
-}
-
-__device__ __host__ float3 operator+ (const float3 &a, const float3 &b)
-{
- return make_float3(a.x+b.x, a.y+b.y, a.z+b.z);
-}
-
-__device__ __host__ void operator+= (float3 &a, const float3 &b)
-{
- a.x += b.x;
- a.y += b.y;
- a.z += b.z;
-}
-
-__device__ __host__ float3 operator- (const float3 &a, const float3 &b)
-{
- return make_float3(a.x-b.x, a.y-b.y, a.z-b.z);
-}
-
-__device__ __host__ void operator-= (float3 &a, const float3 &b)
-{
- a.x -= b.x;
- a.y -= b.y;
- a.z -= b.z;
-}
-
-__device__ __host__ float3 operator+ (const float3 &a, const float &c)
-{
- return make_float3(a.x+c, a.y+c, a.z+c);
-}
-
-__device__ __host__ void operator+= (float3 &a, const float &c)
-{
- a.x += c;
- a.y += c;
- a.z += c;
-}
-
-__device__ __host__ float3 operator+ (const float &c, const float3 &a)
-{
- return make_float3(c+a.x, c+a.y, c+a.z);
-}
-
-__device__ __host__ float3 operator- (const float3 &a, const float &c)
-{
- return make_float3(a.x-c, a.y-c, a.z-c);
-}
-
-__device__ __host__ void operator-= (float3 &a, const float &c)
-{
- a.x -= c;
- a.y -= c;
- a.z -= c;
-}
-
-__device__ __host__ float3 operator- (const float &c, const float3& a)
-{
- return make_float3(c-a.x, c-a.y, c-a.z);
-}
-
-__device__ __host__ float3 operator* (const float3 &a, const float &c)
-{
- return make_float3(a.x*c, a.y*c, a.z*c);
-}
-
-__device__ __host__ void operator*= (float3 &a, const float &c)
-{
- a.x *= c;
- a.y *= c;
- a.z *= c;
-}
-
-__device__ __host__ float3 operator* (const float &c, const float3& a)
-{
- return make_float3(c*a.x, c*a.y, c*a.z);
-}
-
-__device__ __host__ float3 operator/ (const float3 &a, const float &c)
-{
- return make_float3(a.x/c, a.y/c, a.z/c);
-}
-
-__device__ __host__ void operator/= (float3 &a, const float &c)
-{
- a.x /= c;
- a.y /= c;
- a.z /= c;
-}
-
-__device__ __host__ float3 operator/ (const float &c, const float3 &a)
-{
- return make_float3(c/a.x, c/a.y, c/a.z);
-}
-
-__device__ __host__ float dot(const float3 &a, const float3 &b)
-{
- return a.x*b.x + a.y*b.y + a.z*b.z;
-}
-
-__device__ __host__ float3 cross(const float3 &a, const float3 &b)
-{
- return make_float3(a.y*b.z-a.z*b.y, a.z*b.x-a.x*b.z, a.x*b.y-a.y*b.x);
-}
-
-__device__ __host__ float norm(const float3 &a)
-{
- return sqrtf(dot(a,a));
-}
-
-#endif