#include <cmath>
#include <cassert>
#include <stdexcept>
#include <ostream>
#include <istream>
#include <iomanip>
#include <type_traits>
#include <mia/core/type_traits.hh>
#include <mia/core/errormacro.hh>
#include <mia/core/attributetype.hh>
Go to the source code of this file.
Data Structures | |
struct | attribute_type< T2DVector< T > > |
struct | cross_product< T, Vector > |
struct | EAttributeType_2d |
struct | less_then< T2DVector< T > > |
class | T2DVector< T > |
a 2D vector More... | |
Typedefs | |
typedef T2DVector< unsigned int > | C2DBounds |
unsigned int valued 2D vector - used as 2D size parameter More... | |
typedef T2DVector< double > | C2DDVector |
double valued 2D vector More... | |
typedef T2DVector< float > | C2DFVector |
float valued 2D vector More... | |
Functions | |
template<typename T > | |
T | cross (const T2DVector< T > &a, const T2DVector< T > &b) |
template<typename T > | |
T | dot (const T2DVector< T > &a, const T2DVector< T > &b) |
template<typename T > | |
T2DVector< T > | operator* (const T2DVector< T > &a, const T2DVector< T > &b) |
template<typename T > | |
T2DVector< T > | operator* (const T2DVector< T > &a, double f) |
template<typename T > | |
T2DVector< T > | operator* (double f, const T2DVector< T > &a) |
template<typename T > | |
T2DVector< T > | operator+ (const T2DVector< T > &a, const T2DVector< T > &b) |
template<typename T , typename S > | |
T2DVector< T > | operator+ (const T2DVector< T > &a, const T2DVector< S > &b) |
template<typename T > | |
T2DVector< T > | operator- (const T2DVector< T > &a, const T2DVector< T > &b) |
template<typename T > | |
T2DVector< T > | operator/ (const T2DVector< T > &a, const T2DVector< T > &b) |
template<typename T > | |
T2DVector< T > | operator/ (const T2DVector< T > &a, double f) |
template<typename T , typename S > | |
bool | operator< (const T2DVector< T > &a, const T2DVector< S > &b) |
template<typename T > | |
std::ostream & | operator<< (std::ostream &os, const T2DVector< T > &a) |
template<typename T > | |
std::istream & | operator>> (std::istream &is, T2DVector< T > &a) |
unsigned int valued 2D vector - used as 2D size parameter
Definition at line 496 of file 2d/vector.hh.
typedef T2DVector<double> C2DDVector |
double valued 2D vector
Definition at line 493 of file 2d/vector.hh.
typedef T2DVector<float> C2DFVector |
float valued 2D vector
Definition at line 490 of file 2d/vector.hh.
Cross product of two 2D vectors. Technically it's the 3D cross product with the z-elements set to zero and ignoring all zero elements of the output vector
a | |
b |
Definition at line 475 of file 2d/vector.hh.
References cross_product< T, Vector >::apply().
Referenced by TPolyTriangulator< VertexVector, Polygon >::triangulate().
dot product for two 2D vectors that hold the same data type.
type | of the vector values |
a | |
b |
Definition at line 395 of file 2d/vector.hh.
References T2DVector< T >::x, and T2DVector< T >::y.
Element wise multiplication operator for two 2D vectors that hold the same data type
type | of the vector values |
a | |
b |
Definition at line 347 of file 2d/vector.hh.
Multiplication of a vector with a scalar.
type | of the vector values |
a | vector |
f | scalar |
Definition at line 425 of file 2d/vector.hh.
Multiplication of a scalar with a vector.
type | of the vector values |
f | scalar |
a | vector |
Definition at line 440 of file 2d/vector.hh.
Add operator for two 2D vectors that hold the same data type
type | of the vector values |
a | |
b |
Definition at line 318 of file 2d/vector.hh.
T2DVector<T> operator+ | ( | const T2DVector< T > & | a, |
const T2DVector< S > & | b | ||
) |
Add operator for two 2D vectors that hold different data types Target type is taken from the lhs operator
type | of the vector values |
a | |
b |
Definition at line 334 of file 2d/vector.hh.
References T2DVector< T >::x, and T2DVector< T >::y.
Element wise subtraction operator for two 2D vectors that hold the same data type.
type | of the vector values |
a | |
b |
Definition at line 379 of file 2d/vector.hh.
Element wise division operator for two 2D vectors that hold the same data type. Throws a std::invalid_argument exception if b.x=== or b.y==0.
type | of the vector values |
a | |
b |
Definition at line 363 of file 2d/vector.hh.
Division of a vector by a scalar. Throws a std::invalid_argument exception if f==0.
type | of the vector values |
a | |
f |
Definition at line 410 of file 2d/vector.hh.
bool operator< | ( | const T2DVector< T > & | a, |
const T2DVector< S > & | b | ||
) |
Comparison of a vector. Not the this less operator does not define an order, since it is possible that a =/= b and !a<b && !b<a.
a | |
b |
Definition at line 453 of file 2d/vector.hh.
References T2DVector< T >::x.
std::ostream& operator<< | ( | std::ostream & | os, |
const T2DVector< T > & | a | ||
) |
operator to write a 2D vector to a stream
type | of the vector values |
os | output stream |
a | vector |
Definition at line 290 of file 2d/vector.hh.
References T2DVector< T >::print().
std::istream& operator>> | ( | std::istream & | is, |
T2DVector< T > & | a | ||
) |
operator to read a 2D vector from a stream
type | of the vector values |
is | input stream |
a | vector |
Definition at line 304 of file 2d/vector.hh.
References T2DVector< T >::read().