SOFA API  3ea83cbd
Open source framework for multi-physics simuation
vrender::Vector2 Class Reference

#include <Vector2.h>

Static Public Attributes

Constant
static const Vector2 inf
 

Public Member Functions

Constructor(s) and destructor
 Vector2 ()
 Default constructor. More...
 
 ~Vector2 ()
 Default destructor. More...
 
 Vector2 (const Vector2 &)
 Copy constructor. More...
 
 Vector2 (const Vector3 &u)
 
 Vector2 (double, double)
 Create a vector from real values. More...
 
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. More...
 
double squareNorm () const
 Square norm (self dot product) More...
 
double infNorm () const
 Infinite norm. More...
 

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.

double operator[] (int i) const
 
double & operator[] (int i)
 
std::ostream & operator<< (std::ostream &, const Vector2 &)
 Out stream override: prints the 3 vector components. More...
 

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. More...
 
static Vector2 mini (const Vector2 &, const Vector2 &)
 
static Vector2 maxi (const Vector2 &, const Vector2 &)
 

Attribute details

◆ inf

const Vector2 Vector2::inf
static

Constructor details

◆ Vector2() [1/4]

Vector2::Vector2 ( )

Default constructor.

◆ ~Vector2()

Vector2::~Vector2 ( )

Default destructor.

◆ Vector2() [2/4]

Vector2::Vector2 ( const Vector2 u)

Copy constructor.

◆ Vector2() [3/4]

Vector2::Vector2 ( const Vector3 u)

◆ Vector2() [4/4]

Vector2::Vector2 ( double  x,
double  y 
)

Create a vector from real values.

Function details

◆ infNorm()

double Vector2::infNorm ( ) const

Infinite norm.

◆ maxi()

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

◆ mini()

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

◆ norm()

double Vector2::norm ( ) const

Norm.

◆ operator*() [1/2]

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

◆ operator*() [2/2]

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

◆ operator*=()

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

◆ operator+()

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

◆ operator+=()

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

◆ operator-()

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

◆ operator-=()

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

◆ operator/()

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

◆ operator/=()

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

◆ operator=()

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

◆ operator[]() [1/2]

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

◆ operator[]() [2/2]

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

◆ operator^()

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

◆ setX()

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

◆ setXY()

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

◆ setY()

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

◆ squareNorm()

double Vector2::squareNorm ( ) const

Square norm (self dot product)

◆ x()

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

◆ y()

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

Related details

◆ operator!=

bool operator!= ( const Vector2 ,
const Vector2  
)
friend

◆ operator*

Vector2 operator* ( double  r,
const Vector2 u 
)
friend

Left multiplication by a real value.

◆ operator-

Vector2 operator- ( const Vector2 )
friend

◆ operator<<

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

Out stream override: prints the 3 vector components.

◆ operator==

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