ElfPSP_AntColony
Protein Structure Prediction using Ant Colony Optimization
Public Member Functions | List of all members
vec3< T > Struct Template Reference

Represents a triple (x, y, z) of any type. More...

#include <vec3.h>

Public Member Functions

 vec3 ()
 Internal coordinates are not initialized and may contain junk. More...
 
 vec3 (T a, T b, T c)
 Example v = vec3(1, 2, 3). More...
 
 vec3 (std::initializer_list< T > l)
 Example v = {1, 2, 3}. More...
 
vec3< T > operator+ (const vec3< T > other) const
 Element-wise sum. More...
 
vec3< T > operator- (const vec3< T > other) const
 Element-wise subtraction. More...
 
vec3< T > operator- () const
 Unary minus operation. More...
 
bool operator== (const vec3< T > other) const
 Returns true if both vectors have equal coordinates. More...
 
dot (const vec3< T > other) const
 Returns the dot product of two vectors. More...
 
dot () const
 Returns the dot product of the vector with itself. More...
 
norm1 () const
 Returns the norm1 of the vector (absolute value norm). More...
 
norm2 () const
 Returns the euclidean norm of the vector. More...
 

Public Attributes

x
 (x,y,z) coordinates. More...
 
y
 (x,y,z) coordinates. More...
 
z
 (x,y,z) coordinates. More...
 

Detailed Description

template<typename T>
struct vec3< T >

Represents a triple (x, y, z) of any type.

Constructor & Destructor Documentation

◆ vec3() [1/3]

template<typename T>
vec3< T >::vec3 ( )
inline

Internal coordinates are not initialized and may contain junk.

◆ vec3() [2/3]

template<typename T>
vec3< T >::vec3 ( a,
b,
c 
)
inline

Example v = vec3(1, 2, 3).

◆ vec3() [3/3]

template<typename T>
vec3< T >::vec3 ( std::initializer_list< T >  l)
inline

Example v = {1, 2, 3}.

Member Function Documentation

◆ dot() [1/2]

template<typename T >
T vec3< T >::dot ( const vec3< T >  other) const
inline

Returns the dot product of two vectors.

◆ dot() [2/2]

template<typename T >
T vec3< T >::dot ( ) const
inline

Returns the dot product of the vector with itself.

◆ norm1()

template<typename T >
T vec3< T >::norm1 ( ) const
inline

Returns the norm1 of the vector (absolute value norm).

◆ norm2()

template<typename T >
T vec3< T >::norm2 ( ) const
inline

Returns the euclidean norm of the vector.

TODO: There is something wrong here.

If T is int, an int should be returned?

◆ operator+()

template<typename T >
vec3< T > vec3< T >::operator+ ( const vec3< T >  other) const
inline

Element-wise sum.

◆ operator-() [1/2]

template<typename T >
vec3< T > vec3< T >::operator- ( const vec3< T >  other) const
inline

Element-wise subtraction.

◆ operator-() [2/2]

template<typename T >
vec3< T > vec3< T >::operator- ( ) const
inline

Unary minus operation.

Returns the opposite vector.

◆ operator==()

template<typename T >
bool vec3< T >::operator== ( const vec3< T >  other) const
inline

Returns true if both vectors have equal coordinates.

Member Data Documentation

◆ x

template<typename T>
T vec3< T >::x

(x,y,z) coordinates.

◆ y

template<typename T>
T vec3< T >::y

(x,y,z) coordinates.

◆ z

template<typename T>
T vec3< T >::z

(x,y,z) coordinates.


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