g4tools  5.4.0
Public Member Functions | List of all members
tools::vec4d Class Reference
Inheritance diagram for tools::vec4d:
Inheritance graph
[legend]
Collaboration diagram for tools::vec4d:
Collaboration graph
[legend]

Public Member Functions

 vec4d ()
 
 vec4d (const double a_vec[4])
 
 vec4d (const double &a0, const double &a1, const double &a2, const double &a3)
 
virtual ~vec4d ()
 
 vec4d (const vec4d &a_from)
 
vec4doperator= (const vec4d &a_from)
 
vec4d operator* (double a_v) const
 
vec4d operator+ (const vec4d &a_v) const
 
vec4d operator- (const vec4d &a_v) const
 
vec4doperator+= (const vec4d &a_v)
 
vec4doperator*= (double a_v)
 
vec4d operator- () const
 
double length () const
 
double normalize ()
 
- Public Member Functions inherited from tools::vec4< double >
unsigned int dimension () const
 
 vec4 ()
 
 vec4 (const double a_vec[4])
 
 vec4 (const double &a0, const double &a1, const double &a2, const double &a3)
 
 vec4 (const vec4 &a_from)
 
virtual ~vec4 ()
 
vec4operator= (const vec4 &a_from)
 
const double & v0 () const
 
void v0 (const double &a_value)
 
const double & v1 () const
 
void v1 (const double &a_value)
 
const double & v2 () const
 
void v2 (const double &a_value)
 
const double & v3 () const
 
void v3 (const double &a_value)
 
const double & x () const
 
const double & y () const
 
const double & z () const
 
const double & t () const
 
void set_value (const double &a0, const double &a1, const double &a2, const double &a3)
 
void set_value (const double aV[4])
 
bool set_value (unsigned int a_index, const double &a_value)
 
void value (double &a0, double &a1, double &a2, double &a3) const
 
double length (double(*a_sqrt)(double)) const
 
double normalize (double(*a_sqrt)(double))
 
bool equal (const vec4 &a_vec) const
 
bool equal (const vec4 &a_vec, const double &a_epsil) const
 
bool is_proportional (const vec4 &a_vec, double &a_factor) const
 
void multiply (const double &a_T)
 
bool divide (const double &a_T)
 
void add (const vec4 &a_v)
 
void add (const double &a0, const double &a1, const double &a2, const double &a3)
 
void subtract (const vec4 &a_v)
 
void subtract (const double &a0, const double &a1, const double &a2, const double &a3)
 
double & operator[] (size_t a_index)
 
const double & operator[] (size_t a_index) const
 
vec4 operator+ (const vec4 &a_v) const
 
vec4 operator- (const vec4 &a_v) const
 
vec4 operator* (const double &a_v) const
 
bool operator== (const vec4 &a_v) const
 
bool operator!= (const vec4 &a_v) const
 
size_type size () const
 
const double * data () const
 

Additional Inherited Members

- Public Types inherited from tools::vec4< double >
typedef double elem_t
 
typedef unsigned int size_type
 
- Static Protected Member Functions inherited from tools::vec4< double >
static double zero ()
 
static double minus_one ()
 
- Protected Attributes inherited from tools::vec4< double >
double m_data [4]
 

Detailed Description

Definition at line 12 of file vec4d.

Constructor & Destructor Documentation

◆ vec4d() [1/4]

tools::vec4d::vec4d ( )
inline

Definition at line 15 of file vec4d.

15 :parent() {}

◆ vec4d() [2/4]

tools::vec4d::vec4d ( const double  a_vec[4])
inline

Definition at line 16 of file vec4d.

16 :parent(a_vec) {}

◆ vec4d() [3/4]

tools::vec4d::vec4d ( const double &  a0,
const double &  a1,
const double &  a2,
const double &  a3 
)
inline

Definition at line 20 of file vec4d.

20 :parent(a0,a1,a2,a3){}

◆ ~vec4d()

virtual tools::vec4d::~vec4d ( )
inlinevirtual

Definition at line 22 of file vec4d.

22 {}

◆ vec4d() [4/4]

tools::vec4d::vec4d ( const vec4d a_from)
inline

Definition at line 24 of file vec4d.

24 :parent(a_from){}

Member Function Documentation

◆ length()

double tools::vec4d::length ( ) const
inline

Definition at line 63 of file vec4d.

63 {return parent::length(::sqrt);}

◆ normalize()

double tools::vec4d::normalize ( )
inline

Definition at line 64 of file vec4d.

64 {return parent::normalize(::sqrt);}

◆ operator*()

vec4d tools::vec4d::operator* ( double  a_v) const
inline

Definition at line 27 of file vec4d.

27  {
28  return vec4d(m_data[0]*a_v,
29  m_data[1]*a_v,
30  m_data[2]*a_v,
31  m_data[3]*a_v);
32  }

◆ operator*=()

vec4d& tools::vec4d::operator*= ( double  a_v)
inline

Definition at line 52 of file vec4d.

52  {
53  m_data[0] *= a_v;
54  m_data[1] *= a_v;
55  m_data[2] *= a_v;
56  m_data[3] *= a_v;
57  return *this;
58  }

◆ operator+()

vec4d tools::vec4d::operator+ ( const vec4d a_v) const
inline

Definition at line 33 of file vec4d.

33  {
34  return vec4d(m_data[0]+a_v.m_data[0],
35  m_data[1]+a_v.m_data[1],
36  m_data[2]+a_v.m_data[2],
37  m_data[3]+a_v.m_data[3]);
38  }

◆ operator+=()

vec4d& tools::vec4d::operator+= ( const vec4d a_v)
inline

Definition at line 45 of file vec4d.

45  {
46  m_data[0] += a_v.m_data[0];
47  m_data[1] += a_v.m_data[1];
48  m_data[2] += a_v.m_data[2];
49  m_data[3] += a_v.m_data[3];
50  return *this;
51  }

◆ operator-() [1/2]

vec4d tools::vec4d::operator- ( ) const
inline

Definition at line 59 of file vec4d.

59  {
60  return vec4d(-m_data[0],-m_data[1],-m_data[2],-m_data[3]);
61  }

◆ operator-() [2/2]

vec4d tools::vec4d::operator- ( const vec4d a_v) const
inline

Definition at line 39 of file vec4d.

39  {
40  return vec4d(m_data[0]-a_v.m_data[0],
41  m_data[1]-a_v.m_data[1],
42  m_data[2]-a_v.m_data[2],
43  m_data[3]-a_v.m_data[3]);
44  }

◆ operator=()

vec4d& tools::vec4d::operator= ( const vec4d a_from)
inline

Definition at line 25 of file vec4d.

25 {parent::operator=(a_from);return *this;}

The documentation for this class was generated from the following file:
tools::vec4< double >::m_data
double m_data[4]
Definition: vec4:262
tools::vec4< double >::operator=
vec4 & operator=(const vec4 &a_from)
Definition: vec4:77
tools::vec4d::vec4d
vec4d()
Definition: vec4d:15
tools::vec4< double >::length
double length(double(*a_sqrt)(double)) const
Definition: vec4:125
tools::vec4< double >::normalize
double normalize(double(*a_sqrt)(double))
Definition: vec4:129