working on comples64

This commit is contained in:
2026-04-10 16:28:25 -04:00
parent a8ed51a904
commit f315dfb6f6
48 changed files with 551 additions and 2523 deletions

View File

@ -1,34 +1,34 @@
#ifndef __CUVECT3F_HPP__
#define __CUVECT3F_HPP__
#ifndef __cuvec3f_HPP__
#define __cuvec3f_HPP__
namespace amscuda
{
class cuvect3f
class cuvec3f
{
public:
float x;
float y;
float z;
__host__ __device__ cuvect3f();
__host__ __device__ ~cuvect3f();
__host__ __device__ cuvect3f(const float &_x, const float &_y, const float &_z);
__host__ __device__ cuvec3f();
__host__ __device__ ~cuvec3f();
__host__ __device__ cuvec3f(const float &_x, const float &_y, const float &_z);
__host__ __device__ float& operator[](const int &I);
__host__ __device__ const float& operator[](const int &I) const;
__host__ __device__ cuvect3f operator+(const cuvect3f &rhs);
__host__ __device__ cuvect3f operator-(const cuvect3f &rhs);
__host__ __device__ cuvect3f operator*(const float &rhs);
__host__ __device__ cuvect3f operator/(const float &rhs);
__host__ __device__ friend cuvect3f operator-(const cuvect3f &rhs);
__host__ __device__ cuvec3f operator+(const cuvec3f &rhs);
__host__ __device__ cuvec3f operator-(const cuvec3f &rhs);
__host__ __device__ cuvec3f operator*(const float &rhs);
__host__ __device__ cuvec3f operator/(const float &rhs);
__host__ __device__ friend cuvec3f operator-(const cuvec3f &rhs);
__host__ __device__ cuvect3f& operator+=(const cuvect3f &rhs);
__host__ __device__ cuvect3f& operator-=(const cuvect3f &rhs);
__host__ __device__ cuvect3f& operator/=(const float &rhs);
__host__ __device__ cuvect3f& operator*=(const float &rhs);
__host__ __device__ cuvec3f& operator+=(const cuvec3f &rhs);
__host__ __device__ cuvec3f& operator-=(const cuvec3f &rhs);
__host__ __device__ cuvec3f& operator/=(const float &rhs);
__host__ __device__ cuvec3f& operator*=(const float &rhs);
};
@ -59,7 +59,7 @@ namespace amscuda
__host__ __device__ cumat3f operator-(const cumat3f &rhs);
__host__ __device__ cumat3f operator*(const float &rhs);
__host__ __device__ cumat3f operator/(const float &rhs);
__host__ __device__ cuvect3f operator*(const cuvect3f &rhs);
__host__ __device__ cuvec3f operator*(const cuvec3f &rhs);
__host__ __device__ cumat3f operator*(const cumat3f &rhs);
__host__ __device__ friend cumat3f operator-(const cumat3f &rhs);
@ -79,15 +79,15 @@ namespace amscuda
};
__host__ __device__ float cuvect3f_dot(const cuvect3f &a,const cuvect3f &b);
__host__ __device__ cuvect3f cuvect3f_cross(const cuvect3f &a, const cuvect3f &b);
__host__ __device__ float cuvect3f_norm(const cuvect3f &a);
__host__ __device__ cuvect3f cuvect3f_normalize(const cuvect3f &a);
__host__ __device__ cuvect3f cuvect3f_proj(const cuvect3f &a, const cuvect3f &b);
__host__ __device__ float cuvec3f_dot(const cuvec3f &a,const cuvec3f &b);
__host__ __device__ cuvec3f cuvec3f_cross(const cuvec3f &a, const cuvec3f &b);
__host__ __device__ float cuvec3f_norm(const cuvec3f &a);
__host__ __device__ cuvec3f cuvec3f_normalize(const cuvec3f &a);
__host__ __device__ cuvec3f cuvec3f_proj(const cuvec3f &a, const cuvec3f &b);
__host__ __device__ cumat3f hodge_dual(const cuvect3f &vin);
__host__ __device__ cuvect3f hodge_dual(const cumat3f &min);
__host__ __device__ cumat3f rotmat_from_axisangle(const cuvect3f &axis, const float &angle);
__host__ __device__ cumat3f hodge_dual(const cuvec3f &vin);
__host__ __device__ cuvec3f hodge_dual(const cumat3f &min);
__host__ __device__ cumat3f rotmat_from_axisangle(const cuvec3f &axis, const float &angle);
//3x3 matrix operations
@ -105,14 +105,14 @@ namespace amscuda
//inverts a 3x3 (9 element) matrix
__host__ __device__ void mat3f_inverse(float *mat3inout);
__host__ __device__ cuvect3f mat3f_mult(float *mat3in, const cuvect3f &cvin);
__host__ __device__ cuvec3f mat3f_mult(float *mat3in, const cuvec3f &cvin);
__host__ __device__ void mat3f_mult(float *matina, float *matinb, float *matout);
__host__ __device__ void mat3f_hodgedual(const cuvect3f &vecin, float *matout);
__host__ __device__ void mat3f_hodgedual(float *matin, cuvect3f &vecout);
__host__ __device__ void mat3f_hodgedual(const cuvec3f &vecin, float *matout);
__host__ __device__ void mat3f_hodgedual(float *matin, cuvec3f &vecout);
//returns direction cosine rotation matrix from axis and angle
__host__ __device__ void mat3f_rot_from_axisangle(cuvect3f axis, float angle, float *matout);
__host__ __device__ void mat3f_rot_from_axisangle(cuvec3f axis, float angle, float *matout);
__host__ void test_cudavectf_logic1();