This commit is contained in:
2026-02-20 11:51:36 -05:00
parent 3128d5dd19
commit f09503abed
24 changed files with 32 additions and 0 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -22,6 +22,7 @@ namespace amscuda
__host__ __device__ cuvect2 operator-(cuvect2 lhs); __host__ __device__ cuvect2 operator-(cuvect2 lhs);
__host__ __device__ cuvect2 operator*(double lhs); __host__ __device__ cuvect2 operator*(double lhs);
__host__ __device__ cuvect2 operator/(double lhs); __host__ __device__ cuvect2 operator/(double lhs);
__host__ __device__ friend cuvect2 operator-(cuvect2 rhs);
}; };
class cumat2 class cumat2

View File

@ -23,6 +23,7 @@ namespace amscuda
__host__ __device__ cuvect3 operator-(cuvect3 lhs); __host__ __device__ cuvect3 operator-(cuvect3 lhs);
__host__ __device__ cuvect3 operator*(double lhs); __host__ __device__ cuvect3 operator*(double lhs);
__host__ __device__ cuvect3 operator/(double lhs); __host__ __device__ cuvect3 operator/(double lhs);
__host__ __device__ friend cuvect3 operator-(cuvect3 rhs);
}; };
class cumat3 class cumat3

View File

@ -23,6 +23,7 @@ namespace amscuda
__host__ __device__ cuvect4 operator-(cuvect4 lhs); __host__ __device__ cuvect4 operator-(cuvect4 lhs);
__host__ __device__ cuvect4 operator*(double lhs); __host__ __device__ cuvect4 operator*(double lhs);
__host__ __device__ cuvect4 operator/(double lhs); __host__ __device__ cuvect4 operator/(double lhs);
__host__ __device__ friend cuvect4 operator-(cuvect4 rhs);
}; };
class cumat4 class cumat4

View File

@ -351,6 +351,14 @@ __host__ __device__ cuvect2 mat2_mult(double *mat2a, cuvect2 b)
return ret; return ret;
} }
__host__ __device__ cuvect2 operator-(cuvect2 rhs)
{
cuvect2 ret;
ret[0] = -rhs[0];
ret[1] = -rhs[1];
return ret;
}
void test_cuvect2_1() void test_cuvect2_1()
{ {

View File

@ -578,4 +578,15 @@ __host__ __device__ cumat3 cumat3::inverse()
return q; return q;
} }
__host__ __device__ cuvect3 operator-(cuvect3 rhs)
{
cuvect3 ret;
ret[0] = -rhs[0];
ret[1] = -rhs[1];
ret[2] = -rhs[2];
return ret;
}
}; };

View File

@ -410,5 +410,15 @@ __host__ __device__ cuvect4 cuvect4_proj(cuvect4 a, cuvect4 b)
return ret; return ret;
} }
__host__ __device__ cuvect4 operator-(cuvect4 rhs)
{
cuvect4 ret;
ret[0] = -rhs[0];
ret[1] = -rhs[1];
ret[2] = -rhs[2];
ret[3] = -rhs[3];
return ret;
}
}; };