Data Structures | Typedefs | Functions
3d/vector.hh File Reference
#include <typeinfo>
#include <assert.h>
#include <stdexcept>
#include <math.h>
#include <complex>
#include <iostream>
#include <type_traits>
#include <mia/core/defines.hh>
#include <mia/core/type_traits.hh>

Go to the source code of this file.

Data Structures

struct  less_then< T3DVector< T > >
 
class  T3DVector< T >
 A simple 3D vector type. More...
 

Typedefs

typedef T3DVector< unsigned int > C3DBounds
 A unsinged int 3D Vector (used for 3D field sizes) More...
 
typedef T3DVector< double > C3DDVector
 A double 3D Vector. More...
 
typedef T3DVector< float > C3DFVector
 A float 3D Vector. More...
 

Functions

template<typename T >
T3DVector< T > cross (const T3DVector< T > &a, const T3DVector< T > &b)
 
template<class T >
double dot (const T3DVector< T > &a, const T3DVector< T > &b)
 
template<class T >
double fabs (const T3DVector< T > &t)
 A way to get the norm of a T3DVector using faba syntax. More...
 
template<class T >
bool operator!= (const T3DVector< T > &a, const T3DVector< T > &b)
 comparison operator not equal More...
 
template<class T >
const T3DVector< T > operator* (const T3DVector< T > &a, const T3DVector< T > &b)
 vector scalar product More...
 
template<class T >
const T3DVector< T > operator* (const T3DVector< T > &a, double f)
 vector multiplication with scalar More...
 
template<class T >
const T3DVector< T > operator* (double f, const T3DVector< T > &a)
 vector multiplication with scalar reverse order More...
 
template<class T >
const T3DVector< T > operator+ (const T3DVector< T > &a, const T3DVector< T > &b)
 vector addition More...
 
template<typename T , typename S >
T3DVector< T > operator+ (const T3DVector< T > &a, const T3DVector< S > &b)
 
template<class T >
const T3DVector< T > operator- (const T3DVector< T > &a, const T3DVector< T > &b)
 vector subtraction More...
 
template<class T >
const T3DVector< T > operator/ (const T3DVector< T > &a, double f)
 vector division by scalar More...
 
template<class T >
const T3DVector< T > operator/ (const T3DVector< T > &a, const T3DVector< T > &b)
 
template<class T >
bool operator< (const T3DVector< T > &a, const T3DVector< T > &b)
 comparison less, returns true if all components of a are less then those of b More...
 
template<class T >
std::ostream & operator<< (std::ostream &os, const T3DVector< T > &v)
 stream output operator for 3DVector More...
 
template<class T >
bool operator<= (const T3DVector< T > &b, const T3DVector< T > &a)
 comparison less or equal, returns true if all components of a are less or equal then those of b More...
 
template<class T >
bool operator== (const T3DVector< T > &a, const T3DVector< T > &b)
 comparison operator equal More...
 
template<class T >
bool operator> (const T3DVector< T > &b, const T3DVector< T > &a)
 comparison greater, returns true if all components of a are greater then those of b More...
 
template<class T >
bool operator>= (const T3DVector< T > &b, const T3DVector< T > &a)
 comparison greater or equal, returns true if all components of a are greater or equal then those of b More...
 
template<class T >
std::istream & operator>> (std::istream &is, T3DVector< T > &v)
 stream input operator for 3DVector More...
 
template<class T >
const T3DVector< T > operator^ (const T3DVector< T > &a, const T3DVector< T > &b)
 3D vector cross product More...
 

Typedef Documentation

typedef T3DVector<unsigned int> C3DBounds

A unsinged int 3D Vector (used for 3D field sizes)

Definition at line 331 of file 3d/vector.hh.

typedef T3DVector<double> C3DDVector

A double 3D Vector.

Definition at line 328 of file 3d/vector.hh.

typedef T3DVector<float> C3DFVector

A float 3D Vector.

Definition at line 325 of file 3d/vector.hh.

Function Documentation

template<typename T >
T3DVector<T> cross ( const T3DVector< T > &  a,
const T3DVector< T > &  b 
)

Cross product of two 3D vectors

Parameters
a
b
Returns
cross product a x b

Definition at line 301 of file 3d/vector.hh.

References T3DVector< T >::x, T3DVector< T >::y, and T3DVector< T >::z.

template<class T >
double dot ( const T3DVector< T > &  a,
const T3DVector< T > &  b 
)
Returns
the dot product of input vectors a and b

Definition at line 318 of file 3d/vector.hh.

References T3DVector< T >::x, T3DVector< T >::y, and T3DVector< T >::z.

template<class T >
double fabs ( const T3DVector< T > &  t)

A way to get the norm of a T3DVector using faba syntax.

Definition at line 312 of file 3d/vector.hh.

References T3DVector< T >::norm().

Referenced by T3DMatrix< T >::get_eigenvalues(), and kmeans_step().

template<class T >
bool operator!= ( const T3DVector< T > &  a,
const T3DVector< T > &  b 
)
inline

comparison operator not equal

Definition at line 448 of file 3d/vector.hh.

template<class T >
const T3DVector<T> operator* ( const T3DVector< T > &  a,
const T3DVector< T > &  b 
)
inline

vector scalar product

Definition at line 385 of file 3d/vector.hh.

References T3DVector< T >::x, T3DVector< T >::y, and T3DVector< T >::z.

template<class T >
const T3DVector<T> operator* ( const T3DVector< T > &  a,
double  f 
)
inline

vector multiplication with scalar

Definition at line 414 of file 3d/vector.hh.

template<class T >
const T3DVector<T> operator* ( double  f,
const T3DVector< T > &  a 
)
inline

vector multiplication with scalar reverse order

Definition at line 424 of file 3d/vector.hh.

template<class T >
const T3DVector<T> operator+ ( const T3DVector< T > &  a,
const T3DVector< T > &  b 
)
inline

vector addition

Definition at line 354 of file 3d/vector.hh.

template<typename T , typename S >
T3DVector<T> operator+ ( const T3DVector< T > &  a,
const T3DVector< S > &  b 
)

Add operator for two 3D vectors that hold different data types Target type is taken from the lhs operator

Template Parameters
typeof the vector values
Parameters
a
b
Returns
a+b

Definition at line 369 of file 3d/vector.hh.

References T3DVector< T >::x, T3DVector< T >::y, and T3DVector< T >::z.

template<class T >
const T3DVector<T> operator- ( const T3DVector< T > &  a,
const T3DVector< T > &  b 
)
inline

vector subtraction

Definition at line 377 of file 3d/vector.hh.

template<class T >
const T3DVector<T> operator/ ( const T3DVector< T > &  a,
double  f 
)
inline

vector division by scalar

Definition at line 392 of file 3d/vector.hh.

template<class T >
const T3DVector<T> operator/ ( const T3DVector< T > &  a,
const T3DVector< T > &  b 
)
inline

component wise division of two vectors

Definition at line 405 of file 3d/vector.hh.

References T3DVector< T >::x, T3DVector< T >::y, and T3DVector< T >::z.

template<class T >
bool operator< ( const T3DVector< T > &  a,
const T3DVector< T > &  b 
)

comparison less, returns true if all components of a are less then those of b

Definition at line 455 of file 3d/vector.hh.

template<class T >
std::ostream& operator<< ( std::ostream &  os,
const T3DVector< T > &  v 
)

stream output operator for 3DVector

Definition at line 337 of file 3d/vector.hh.

References T3DVector< T >::write().

template<class T >
bool operator<= ( const T3DVector< T > &  b,
const T3DVector< T > &  a 
)

comparison less or equal, returns true if all components of a are less or equal then those of b

Definition at line 461 of file 3d/vector.hh.

template<class T >
bool operator== ( const T3DVector< T > &  a,
const T3DVector< T > &  b 
)
inline

comparison operator equal

Definition at line 441 of file 3d/vector.hh.

References T3DVector< T >::x, T3DVector< T >::y, and T3DVector< T >::z.

template<class T >
bool operator> ( const T3DVector< T > &  b,
const T3DVector< T > &  a 
)

comparison greater, returns true if all components of a are greater then those of b

Definition at line 467 of file 3d/vector.hh.

References T3DVector< T >::x, T3DVector< T >::y, and T3DVector< T >::z.

template<class T >
bool operator>= ( const T3DVector< T > &  b,
const T3DVector< T > &  a 
)

comparison greater or equal, returns true if all components of a are greater or equal then those of b

Definition at line 473 of file 3d/vector.hh.

References T3DVector< T >::x, T3DVector< T >::y, and T3DVector< T >::z.

template<class T >
std::istream& operator>> ( std::istream &  is,
T3DVector< T > &  v 
)

stream input operator for 3DVector

Definition at line 345 of file 3d/vector.hh.

References T3DVector< T >::read().

template<class T >
const T3DVector<T> operator^ ( const T3DVector< T > &  a,
const T3DVector< T > &  b 
)
inline

3D vector cross product

Definition at line 432 of file 3d/vector.hh.

References T3DVector< T >::x, T3DVector< T >::y, and T3DVector< T >::z.