Fermat
Public Types | Public Methods | Public Members | Static Public Members | Related Functions | List of all members
cugar::Vector< T, DIM > Struct Template Reference

Detailed description

template<typename T, uint32 DIM>
struct cugar::Vector< T, DIM >

A generic small vector class with the dimension set at compile-time

#include <vector.h>

Public Types

typedef T value_type
 

Public Methods

CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector (const T v)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector (const T *v)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE uint32 dimension () const
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE const T & operator[] (const uint32 i) const
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE T & operator[] (const uint32 i)
 

Public Members

data [DIM]
 

Static Public Members

static const uint32 DIMENSION = DIM
 

Related Functions

(Note that these are not member functions.)

template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > operator- (const Vector< T, DIM > &op)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > operator+ (const Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > & operator+= (Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > operator- (const Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > & operator-= (Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > operator* (const Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > & operator*= (Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > operator* (const T op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > operator* (const Vector< T, DIM > &op1, const T op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > & operator*= (Vector< T, DIM > &op1, const T op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > operator/ (const Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > & operator/= (Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > operator/ (const Vector< T, DIM > &op1, const T op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > & operator/= (Vector< T, DIM > &op1, const T op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > min (const Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > max (const Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > min (const Vector< T, DIM > &op1, const T op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > max (const Vector< T, DIM > &op1, const T op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > abs (const Vector< T, DIM > &op)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE T max_comp (const Vector< T, DIM > &op)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE T min_comp (const Vector< T, DIM > &op)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool any (const Vector< T, DIM > &op)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool all (const Vector< T, DIM > &op)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool operator== (const Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool operator!= (const Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool operator< (const Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool operator> (const Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool operator<= (const Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool operator>= (const Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE T dot (const Vector< T, DIM > &op1, const Vector< T, DIM > &op2)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE T length (const Vector< T, DIM > &op)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > normalize (const Vector< T, DIM > &op)
 
template<typename T >
CUGAR_HOST_DEVICE CUGAR_FORCEINLINE Vector< T, 3u > cross (const Vector< T, 3u > &op1, const Vector< T, 3u > &op2)
 
template<typename T >
CUGAR_HOST_DEVICE CUGAR_FORCEINLINE Vector< T, 3 > reflect (const Vector< T, 3 > I, const Vector< T, 3 > N)
 
template<typename T >
CUGAR_HOST_DEVICE CUGAR_FORCEINLINE Vector< T, 3 > refract (const Vector< T, 3 > I, const Vector< T, 3 > N, const float eta)
 
template<typename T >
CUGAR_HOST_DEVICE CUGAR_FORCEINLINE Vector< T, 3 > refraction_normal (const Vector< T, 3 > I, const Vector< T, 3 > T, const float eta)
 
template<typename T >
CUGAR_HOST_DEVICE CUGAR_FORCEINLINE Vector< T, 3 > faceforward (const Vector< T, 3 > N, const Vector< T, 3 > I)
 
template<typename T >
CUGAR_HOST_DEVICE Vector< T, 3 > orthogonal (const Vector< T, 3 > v)
 
template<typename T >
CUGAR_HOST_DEVICE void orthonormal_basis (const Vector< T, 3 > normal, Vector< T, 3 > &tangent, Vector< T, 3 > &bitangent)
 
template<typename T >
CUGAR_HOST_DEVICE uint32 pack_vector (const Vector< T, 2 > v, const uint32 n_bits_comp)
 
template<typename T >
CUGAR_HOST_DEVICE Vector< T, 2 > unpack_vector (const uint32 u, const uint32 n_bits_comp)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > mod (const Vector< T, DIM > &op, const T m)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > sqrt (const Vector< T, DIM > &op)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE bool is_finite (const Vector< T, DIM > &op)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE T L1_norm (const Vector< T, DIM > &op)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE T L2_norm (const Vector< T, DIM > &op)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE T L_inf_norm (const Vector< T, DIM > &op)
 
template<typename T , uint32 DIM, uint32 p>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE T L_norm (const Vector< T, DIM > &op)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float L1_norm (const float op)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE double L1_norm (const double op)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float L2_norm (const float op)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE double L2_norm (const double op)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float L_inf_norm (const float op)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE double L_inf_norm (const double op)
 
template<uint32 p>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float L_norm (const float op)
 
template<uint32 p>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE double L_norm (const double op)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE T average (const Vector< T, DIM > &op)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float average (const float op)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE double average (const double op)
 
template<typename T , uint32 DIM>
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Vector< T, DIM > lerp (const Vector< T, DIM > &op1, const Vector< T, DIM > &op2, const T u)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE float lerp (const float op1, const float op2, const float u)
 
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE double lerp (const double op1, const double op2, const double u)
 

The documentation for this struct was generated from the following file: