init
This commit is contained in:
62
old/9apr26_prerefactor/include/amsculib2/cuvect4f.hpp
Normal file
62
old/9apr26_prerefactor/include/amsculib2/cuvect4f.hpp
Normal file
@ -0,0 +1,62 @@
|
||||
#ifndef __CUVECT4F_HPP__
|
||||
#define __CUVECT4F_HPP__
|
||||
|
||||
namespace amscuda
|
||||
{
|
||||
|
||||
class cuvect4f
|
||||
{
|
||||
public:
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
float w;
|
||||
|
||||
__host__ __device__ cuvect4f();
|
||||
__host__ __device__ ~cuvect4f();
|
||||
__host__ __device__ cuvect4f(float _x, float _y, float _z, float _w);
|
||||
|
||||
__host__ __device__ float& operator[](const int I);
|
||||
__host__ __device__ const float& operator[](const int I) const;
|
||||
|
||||
__host__ __device__ cuvect4f operator+(cuvect4f lhs);
|
||||
__host__ __device__ cuvect4f operator-(cuvect4f lhs);
|
||||
__host__ __device__ cuvect4f operator*(float lhs);
|
||||
__host__ __device__ cuvect4f operator/(float lhs);
|
||||
__host__ __device__ friend cuvect4f operator-(cuvect4f rhs);
|
||||
};
|
||||
|
||||
class cumat4f
|
||||
{
|
||||
public:
|
||||
float dat[16];
|
||||
|
||||
__host__ __device__ cumat4f();
|
||||
__host__ __device__ ~cumat4f();
|
||||
__host__ __device__ float& operator[](const int I);
|
||||
__host__ __device__ float& operator()(const int I, const int J);
|
||||
__host__ __device__ float& at(const int I, const int J);
|
||||
|
||||
__host__ __device__ cumat4f operator+(cumat4f lhs);
|
||||
__host__ __device__ cumat4f operator-(cumat4f lhs);
|
||||
__host__ __device__ cumat4f operator*(float lhs);
|
||||
__host__ __device__ cumat4f operator/(float lhs);
|
||||
__host__ __device__ cuvect4f operator*(cuvect4f lhs);
|
||||
__host__ __device__ cumat4f operator*(cumat4f lhs);
|
||||
__host__ __device__ friend cumat4f operator-(cumat4f rhs);
|
||||
|
||||
__host__ __device__ float det();
|
||||
__host__ __device__ cumat4f transpose();
|
||||
__host__ __device__ cumat4f inverse();
|
||||
};
|
||||
|
||||
__host__ __device__ float cuvect4f_dot(cuvect4f a, cuvect4f b);
|
||||
__host__ __device__ float cuvect4f_norm(cuvect4f a);
|
||||
__host__ __device__ cuvect4f cuvect4f_normalize(cuvect4f a);
|
||||
__host__ __device__ cuvect4f cuvect4f_proj(cuvect4f a, cuvect4f b);
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user