www.cemf.ir
triple< T > Struct Template Reference

A set of 3 variables that can be used for vector variables. More...

+ Inheritance diagram for triple< T >:

Public Member Functions

 TripleTypeInfoNV (T)
 Type info for triple. More...
 
INLINE_FUNCTION_HD triple ()=default
 Initilize to zero. More...
 
INLINE_FUNCTION_HD ~triple ()=default
 
INLINE_FUNCTION_HD triple (const T &x, const T &y, const T &z)
 Construct from x, y, z. More...
 
INLINE_FUNCTION_HD triple (const T &v)
 Construct from v. More...
 
template<typename T2 >
INLINE_FUNCTION_HD triple< T > & operator= (const triple< T2 > &rhs)
 Type conversion trough assignment. More...
 
template<typename T2 >
INLINE_FUNCTION_HD triple (const triple< T2 > &src)
 Type casting through copy constructor. More...
 
INLINE_FUNCTION_HD triple (const triple< T > &src)=default
 Copy construct. More...
 
INLINE_FUNCTION_HD triple (triple< T > &&src)=default
 Move construct. More...
 
INLINE_FUNCTION_HD triple< T > & operator= (const triple< T > &src)=default
 copy assignment More...
 
INLINE_FUNCTION_HD triple< T > & operator= (triple< T > &&src)=default
 move assignment More...
 
INLINE_FUNCTION uniquePtr< triple< T > > clone () const
 clone More...
 
INLINE_FUNCTION triple< T > * clonePtr () const
 
INLINE_FUNCTION_HD T & x ()
 access component More...
 
const INLINE_FUNCTION_HD T & x () const
 access component More...
 
INLINE_FUNCTION_HD T & y ()
 access component More...
 
const INLINE_FUNCTION_HD T & y () const
 access component More...
 
INLINE_FUNCTION_HD T & z ()
 access component More...
 
const INLINE_FUNCTION_HD T & z () const
 access component More...
 
INLINE_FUNCTION_HD T & comp1 ()
 access component More...
 
const INLINE_FUNCTION_HD T & comp1 () const
 access component More...
 
INLINE_FUNCTION_HD T & comp2 ()
 access component More...
 
const INLINE_FUNCTION_HD T & comp2 () const
 access component More...
 
INLINE_FUNCTION_HD T & comp3 ()
 access component More...
 
const INLINE_FUNCTION_HD T & comp3 () const
 access component More...
 
INLINE_FUNCTION_HDlength () const
 Length of the vector. More...
 
INLINE_FUNCTION_HD void normalize ()
 Normalize the vector. More...
 
INLINE_FUNCTION_HD void operator+= (const triple &oprnd2)
 
INLINE_FUNCTION_HD void operator-= (const triple &oprnd2)
 
INLINE_FUNCTION_HD void operator*= (const triple &oprnd2)
 
INLINE_FUNCTION_HD void operator/= (const triple &oprnd2)
 
INLINE_FUNCTION_HD triple operator- () const
 unary negate operator More...
 
INLINE_FUNCTION_HD triple operator+ () const
 unary plus operator More...
 

Public Attributes

x_
 data members More...
 
y_
 
z_
 

Friends

FUNCTION_HDdot (const triple< T > &oprnd1, const triple< T > &oprnd2)
 Dot product of two vectors. More...
 
FUNCTION_HD triple< T > cross (const triple< T > &v1, const triple< T > &v2)
 Cross product of two vectors. More...
 
FUNCTION_HD triple< T > operator+ (const triple< T > &oprnd1, const triple< T > &oprnd2)
 
FUNCTION_HD triple< T > operator+ (const triple< T > &oprnd1, const T &oprnd2)
 
FUNCTION_HD triple< T > operator+ (const T &oprnd1, const triple< T > &oprnd2)
 
FUNCTION_HD triple< T > operator- (const triple< T > &oprnd1, const triple< T > &oprnd2)
 
FUNCTION_HD triple< T > operator- (const triple< T > &oprnd1, const T &oprnd2)
 
FUNCTION_HD triple< T > operator- (const T &oprnd1, const triple< T > &oprnd2)
 
FUNCTION_HD triple< T > operator* (const triple< T > &oprnd1, const triple< T > &oprnd2)
 
FUNCTION_HD triple< T > operator* (const triple< T > &oprnd1, const T &oprnd2)
 
FUNCTION_HD triple< T > operator* (const T &oprnd1, const triple< T > &oprnd2)
 
FUNCTION_HD triple< T > operator/ (const triple< T > &oprnd1, const triple< T > &oprnd2)
 / operators More...
 
FUNCTION_HD triple< T > operator/ (const triple< T > &oprnd1, const T &oprnd2)
 
FUNCTION_HD triple< T > operator/ (const T &oprnd1, const triple< T > &oprnd2)
 
FUNCTION_HD bool operator== (const triple< T > &opr1, const triple< T > &opr2)
 
FUNCTION_HD bool operator (const triple< T > &opr1, const triple< T > &opr2)
 
FUNCTION_HD bool operator> (const triple< T > &opr1, const triple< T > &opr2)
 
FUNCTION_HD bool operator>= (const triple< T > &opr1, const triple< T > &opr2)
 
FUNCTION_HD bool operator (const triple< T > &opr1, const triple< T > &opr2)
 
iOstreamoperator (iOstream &str, const triple< T > &ov)
 << operator More...
 
iIstreamoperator>> (iIstream &str, triple< T > &iv)
 

operator

More...
 
void readIstream (iIstream &str, triple< T > &iv)
 same as >> operator, but faster, good for mass read More...
 

Detailed Description

template<typename T>
struct pFlow::triple< T >

A set of 3 variables that can be used for vector variables.

  • Forward

The template parameter should be numeric type only.

Definition at line 36 of file triple.hpp.

Constructor & Destructor Documentation

◆ triple() [1/6]

Initilize to zero.

◆ ~triple()

INLINE_FUNCTION_HD ~triple ( )
default

◆ triple() [2/6]

INLINE_FUNCTION_HD triple ( const T &  x,
const T &  y,
const T &  z 
)
inline

Construct from x, y, z.

Definition at line 67 of file triple.hpp.

◆ triple() [3/6]

INLINE_FUNCTION_HD triple ( const T &  v)
inline

Construct from v.

Definition at line 76 of file triple.hpp.

◆ triple() [4/6]

INLINE_FUNCTION_HD triple ( const triple< T2 > &  src)
inline

Type casting through copy constructor.

Definition at line 93 of file triple.hpp.

◆ triple() [5/6]

INLINE_FUNCTION_HD triple ( const triple< T > &  src)
default

Copy construct.

◆ triple() [6/6]

INLINE_FUNCTION_HD triple ( triple< T > &&  src)
default

Move construct.

Member Function Documentation

◆ TripleTypeInfoNV()

TripleTypeInfoNV ( )

Type info for triple.

◆ operator=() [1/3]

INLINE_FUNCTION_HD triple<T>& operator= ( const triple< T2 > &  rhs)
inline

Type conversion trough assignment.

Definition at line 83 of file triple.hpp.

◆ operator=() [2/3]

INLINE_FUNCTION_HD triple<T>& operator= ( const triple< T > &  src)
default

copy assignment

◆ operator=() [3/3]

INLINE_FUNCTION_HD triple<T>& operator= ( triple< T > &&  src)
default

move assignment

◆ clone()

INLINE_FUNCTION uniquePtr<triple<T> > clone ( ) const
inline

clone

Definition at line 118 of file triple.hpp.

◆ clonePtr()

INLINE_FUNCTION triple<T>* clonePtr ( ) const
inline

Definition at line 124 of file triple.hpp.

◆ x() [1/2]

◆ x() [2/2]

const INLINE_FUNCTION_HD T& x ( ) const
inline

access component

Definition at line 138 of file triple.hpp.

◆ y() [1/2]

◆ y() [2/2]

const INLINE_FUNCTION_HD T& y ( ) const
inline

access component

Definition at line 150 of file triple.hpp.

◆ z() [1/2]

◆ z() [2/2]

const INLINE_FUNCTION_HD T& z ( ) const
inline

access component

Definition at line 162 of file triple.hpp.

◆ comp1() [1/2]

INLINE_FUNCTION_HD T& comp1 ( )
inline

access component

Definition at line 168 of file triple.hpp.

Referenced by pFlow::convertToTriSurfaceComponents().

+ Here is the caller graph for this function:

◆ comp1() [2/2]

const INLINE_FUNCTION_HD T& comp1 ( ) const
inline

access component

Definition at line 174 of file triple.hpp.

◆ comp2() [1/2]

INLINE_FUNCTION_HD T& comp2 ( )
inline

access component

Definition at line 180 of file triple.hpp.

Referenced by pFlow::convertToTriSurfaceComponents().

+ Here is the caller graph for this function:

◆ comp2() [2/2]

const INLINE_FUNCTION_HD T& comp2 ( ) const
inline

access component

Definition at line 186 of file triple.hpp.

◆ comp3() [1/2]

INLINE_FUNCTION_HD T& comp3 ( )
inline

access component

Definition at line 192 of file triple.hpp.

Referenced by pFlow::convertToTriSurfaceComponents().

+ Here is the caller graph for this function:

◆ comp3() [2/2]

const INLINE_FUNCTION_HD T& comp3 ( ) const
inline

access component

Definition at line 198 of file triple.hpp.

◆ length()

Length of the vector.

Definition at line 56 of file tripleI.hpp.

Referenced by Wall::checkTrianlge().

+ Here is the caller graph for this function:

◆ normalize()

INLINE_FUNCTION_HD void normalize

Normalize the vector.

Definition at line 63 of file tripleI.hpp.

◆ operator+=()

INLINE_FUNCTION_HD void operator+= ( const triple< T > &  oprnd2)

Definition at line 178 of file tripleI.hpp.

◆ operator-=()

INLINE_FUNCTION_HD void operator-= ( const triple< T > &  oprnd2)

Definition at line 187 of file tripleI.hpp.

◆ operator*=()

INLINE_FUNCTION_HD void operator*= ( const triple< T > &  oprnd2)

Definition at line 196 of file tripleI.hpp.

◆ operator/=()

INLINE_FUNCTION_HD void operator/= ( const triple< T > &  oprnd2)

Definition at line 205 of file tripleI.hpp.

◆ operator-()

unary negate operator

Definition at line 214 of file tripleI.hpp.

◆ operator+()

unary plus operator

Definition at line 221 of file tripleI.hpp.

Friends And Related Function Documentation

◆ dot

FUNCTION_HD T dot ( const triple< T > &  oprnd1,
const triple< T > &  oprnd2 
)
friend

Dot product of two vectors.

◆ cross

FUNCTION_HD triple<T> cross ( const triple< T > &  v1,
const triple< T > &  v2 
)
friend

Cross product of two vectors.

◆ operator+ [1/3]

FUNCTION_HD triple<T> operator+ ( const triple< T > &  oprnd1,
const triple< T > &  oprnd2 
)
friend
  • operator

◆ operator+ [2/3]

FUNCTION_HD triple<T> operator+ ( const triple< T > &  oprnd1,
const T &  oprnd2 
)
friend

◆ operator+ [3/3]

FUNCTION_HD triple<T> operator+ ( const T &  oprnd1,
const triple< T > &  oprnd2 
)
friend

◆ operator- [1/3]

FUNCTION_HD triple<T> operator- ( const triple< T > &  oprnd1,
const triple< T > &  oprnd2 
)
friend
  • operator

◆ operator- [2/3]

FUNCTION_HD triple<T> operator- ( const triple< T > &  oprnd1,
const T &  oprnd2 
)
friend

◆ operator- [3/3]

FUNCTION_HD triple<T> operator- ( const T &  oprnd1,
const triple< T > &  oprnd2 
)
friend

◆ operator* [1/3]

FUNCTION_HD triple<T> operator* ( const triple< T > &  oprnd1,
const triple< T > &  oprnd2 
)
friend
  • operators

◆ operator* [2/3]

FUNCTION_HD triple<T> operator* ( const triple< T > &  oprnd1,
const T &  oprnd2 
)
friend

◆ operator* [3/3]

FUNCTION_HD triple<T> operator* ( const T &  oprnd1,
const triple< T > &  oprnd2 
)
friend

◆ operator/ [1/3]

FUNCTION_HD triple<T> operator/ ( const triple< T > &  oprnd1,
const triple< T > &  oprnd2 
)
friend

/ operators

◆ operator/ [2/3]

FUNCTION_HD triple<T> operator/ ( const triple< T > &  oprnd1,
const T &  oprnd2 
)
friend

◆ operator/ [3/3]

FUNCTION_HD triple<T> operator/ ( const T &  oprnd1,
const triple< T > &  oprnd2 
)
friend

◆ operator==

FUNCTION_HD bool operator== ( const triple< T > &  opr1,
const triple< T > &  opr2 
)
friend

◆ operator [1/3]

FUNCTION_HD bool operator ( const triple< T > &  opr1,
const triple< T > &  opr2 
)
friend

◆ operator>

FUNCTION_HD bool operator> ( const triple< T > &  opr1,
const triple< T > &  opr2 
)
friend

◆ operator>=

FUNCTION_HD bool operator>= ( const triple< T > &  opr1,
const triple< T > &  opr2 
)
friend

◆ operator [2/3]

FUNCTION_HD bool operator ( const triple< T > &  opr1,
const triple< T > &  opr2 
)
friend

◆ operator [3/3]

iOstream& operator ( iOstream str,
const triple< T > &  ov 
)
friend

<< operator

◆ operator>>

iIstream& operator>> ( iIstream str,
triple< T > &  iv 
)
friend

operator

◆ readIstream

void readIstream ( iIstream str,
triple< T > &  iv 
)
friend

same as >> operator, but faster, good for mass read

Member Data Documentation

◆ x_

◆ y_

◆ z_


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