Public Member Functions | Private Attributes
vrender::Vector2 Class Reference

#include <Vector2.h>

List of all members.

Public Member Functions

double operator[] (int i) const
double & operator[] (int i)
Constructor(s) and destructor
 Vector2 ()
 Default constructor.
 ~Vector2 ()
 Default destructor.
 Vector2 (const Vector2 &)
 Copy constructor.
 Vector2 (const Vector3 &u)
 Vector2 (double, double)
 Create a vector from real values.
Access methods
double x () const
double y () const
void setX (double r)
void setY (double r)
void setXY (double x, double y)
Assignment
Vector2operator= (const Vector2 &u)
Metrics
double norm () const
 Norm.
double squareNorm () const
 Square norm (self dot product)
double infNorm () const
 Infinite norm.

Static Public Attributes

Constant
static const Vector2 inf

Private Attributes

double _xyz [2]
 The 3 vector components.

Friends

Comparisons
bool operator== (const Vector2 &, const Vector2 &)
bool operator!= (const Vector2 &, const Vector2 &)
Stream overrides

Should be used for most comparisons, for efficiency reasons.

std::ostream & operator<< (std::ostream &, const Vector2 &)
 Out stream override: prints the 3 vector components.

Algebraic operations

Vector2operator+= (const Vector2 &v)
Vector2operator-= (const Vector2 &v)
Vector2operator*= (double f)
Vector2operator/= (double f)
Vector2 operator+ (const Vector2 &u) const
Vector2 operator- (const Vector2 &u) const
double operator* (const Vector2 &u) const
double operator^ (const Vector2 &v) const
Vector2 operator/ (double v)
Vector2 operator* (double v)
Vector2 operator- (const Vector2 &)
Vector2 operator* (double, const Vector2 &)
 Left multiplication by a real value.
static Vector2 mini (const Vector2 &, const Vector2 &)
static Vector2 maxi (const Vector2 &, const Vector2 &)

Detailed Description

Definition at line 55 of file Vector2.h.


Constructor & Destructor Documentation

Default constructor.

Definition at line 59 of file Vector2.cpp.

Default destructor.

Definition at line 67 of file Vector2.cpp.

Vector2::Vector2 ( const Vector2 u)

Copy constructor.

Definition at line 73 of file Vector2.cpp.

Vector2::Vector2 ( const Vector3 u)

Definition at line 85 of file Vector2.cpp.

Vector2::Vector2 ( double  x,
double  y 
)

Create a vector from real values.

Definition at line 80 of file Vector2.cpp.


Member Function Documentation

double Vector2::infNorm ( ) const

Infinite norm.

Definition at line 123 of file Vector2.cpp.

Vector2 Vector2::maxi ( const Vector2 v1,
const Vector2 v2 
) [static]

Definition at line 142 of file Vector2.cpp.

Vector2 Vector2::mini ( const Vector2 v1,
const Vector2 v2 
) [static]

Definition at line 137 of file Vector2.cpp.

double Vector2::norm ( ) const

Norm.

Definition at line 109 of file Vector2.cpp.

double vrender::Vector2::operator* ( const Vector2 u) const [inline]

Definition at line 130 of file Vector2.h.

Vector2 vrender::Vector2::operator* ( double  v) [inline]

Definition at line 141 of file Vector2.h.

Vector2& vrender::Vector2::operator*= ( double  f) [inline]

Definition at line 114 of file Vector2.h.

Vector2 vrender::Vector2::operator+ ( const Vector2 u) const [inline]

Definition at line 121 of file Vector2.h.

Vector2& vrender::Vector2::operator+= ( const Vector2 v) [inline]

Definition at line 100 of file Vector2.h.

Vector2 vrender::Vector2::operator- ( const Vector2 u) const [inline]

Definition at line 125 of file Vector2.h.

Vector2& vrender::Vector2::operator-= ( const Vector2 v) [inline]

Definition at line 107 of file Vector2.h.

Vector2 vrender::Vector2::operator/ ( double  v) [inline]

Definition at line 140 of file Vector2.h.

Vector2& vrender::Vector2::operator/= ( double  f) [inline]

Definition at line 115 of file Vector2.h.

Vector2& vrender::Vector2::operator= ( const Vector2 u) [inline]

Definition at line 87 of file Vector2.h.

double vrender::Vector2::operator[] ( int  i) const [inline]

Definition at line 159 of file Vector2.h.

double& vrender::Vector2::operator[] ( int  i) [inline]

Definition at line 167 of file Vector2.h.

double vrender::Vector2::operator^ ( const Vector2 v) const [inline]

Definition at line 135 of file Vector2.h.

void vrender::Vector2::setX ( double  r) [inline]

Definition at line 79 of file Vector2.h.

void vrender::Vector2::setXY ( double  x,
double  y 
) [inline]

Definition at line 81 of file Vector2.h.

void vrender::Vector2::setY ( double  r) [inline]

Definition at line 80 of file Vector2.h.

double Vector2::squareNorm ( ) const

Square norm (self dot product)

Definition at line 116 of file Vector2.cpp.

double vrender::Vector2::x ( ) const [inline]

Definition at line 77 of file Vector2.h.

double vrender::Vector2::y ( ) const [inline]

Definition at line 78 of file Vector2.h.


Friends And Related Function Documentation

bool operator!= ( const Vector2 ,
const Vector2  
) [friend]
Vector2 operator* ( double  r,
const Vector2 u 
) [friend]

Left multiplication by a real value.

Definition at line 101 of file Vector2.cpp.

Vector2 operator- ( const Vector2 ) [friend]
std::ostream& operator<< ( std::ostream &  out,
const Vector2 u 
) [friend]

Out stream override: prints the 3 vector components.

Definition at line 131 of file Vector2.cpp.

bool operator== ( const Vector2 ,
const Vector2  
) [friend]

Member Data Documentation

double vrender::Vector2::_xyz[2] [private]

The 3 vector components.

Definition at line 176 of file Vector2.h.

const Vector2 Vector2::inf [static]

Definition at line 61 of file Vector2.h.


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


octovis
Author(s): Kai M. Wurm , Armin Hornung
autogenerated on Thu Feb 11 2016 23:51:21