Public Types | Public Member Functions | Static Public Attributes
Vector2D< Cmpt > Class Template Reference

Templated 2D Vector derived from VectorSpace adding construction from 2 components, element access using x() and y() member functions and the inner-product (dot-product). More...

Inheritance diagram for Vector2D< Cmpt >:
Inheritance graph
[legend]
Collaboration diagram for Vector2D< Cmpt >:
Collaboration graph
[legend]

Public Types

enum  { rank = 1 }
 
enum  components { X, Y }
 Component labeling enumeration. More...
 
- Public Types inherited from VectorSpace< Vector2D< Cmpt >, Cmpt, 2 >
enum  
 
typedef Cmpt cmptType
 Component type. More...
 

Public Member Functions

 Vector2D ()
 Construct null. More...
 
 Vector2D (const VectorSpace< Vector2D< Cmpt >, Cmpt, 2 > &)
 Construct given VectorSpace. More...
 
 Vector2D (const Cmpt &vx, const Cmpt &vy)
 Construct given two components. More...
 
 Vector2D (Istream &)
 Construct from Istream. More...
 
const Cmpt & x () const
 
const Cmpt & y () const
 
Cmpt & x ()
 
Cmpt & y ()
 
scalar perp (const Vector2D< Cmpt > &b) const
 Perp dot product (dot product with perpendicular vector) More...
 
- Public Member Functions inherited from VectorSpace< Vector2D< Cmpt >, Cmpt, 2 >
 VectorSpace ()
 Construct null. More...
 
 VectorSpace (Istream &)
 Construct from Istream. More...
 
 VectorSpace (const VectorSpace< Form, Cmpt, nCmpt > &)
 Construct as copy. More...
 
 VectorSpace (const VectorSpace< Form2, Cmpt2, nCmpt > &)
 Construct as copy of another VectorSpace type of the same rank. More...
 
label size () const
 Return the number of elements in the VectorSpace = nCmpt. More...
 
const Cmpt & component (const direction) const
 
Cmpt & component (const direction)
 
void component (Cmpt &, const direction) const
 
void replace (const direction, const Cmpt &)
 
const Cmpt & operator[] (const direction) const
 
Cmpt & operator[] (const direction)
 
void operator= (const VectorSpace< Form, Cmpt, nCmpt > &)
 
void operator+= (const VectorSpace< Form, Cmpt, nCmpt > &)
 
void operator-= (const VectorSpace< Form, Cmpt, nCmpt > &)
 
void operator*= (const scalar)
 
void operator/= (const scalar)
 

Static Public Attributes

static const char *const typeName
 
static const char * componentNames []
 
static const Vector2D zero
 
static const Vector2D one
 
static const Vector2D max
 
static const Vector2D min
 

Additional Inherited Members

- Data Fields inherited from VectorSpace< Vector2D< Cmpt >, Cmpt, 2 >
Cmpt v_ [nCmpt]
 The components of this vector space. More...
 

Detailed Description

template<class Cmpt>
class Foam::Vector2D< Cmpt >

Templated 2D Vector derived from VectorSpace adding construction from 2 components, element access using x() and y() member functions and the inner-product (dot-product).

Source files

Definition at line 51 of file Vector2D.H.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
rank 

Definition at line 60 of file Vector2D.H.

◆ components

enum components

Component labeling enumeration.

Enumerator

Definition at line 77 of file Vector2D.H.

Constructor & Destructor Documentation

◆ Vector2D() [1/4]

Vector2D
inline

Construct null.

Definition at line 35 of file Vector2DI.H.

◆ Vector2D() [2/4]

Vector2D ( const VectorSpace< Vector2D< Cmpt >, Cmpt, 2 > &  vs)
inline

Construct given VectorSpace.

Definition at line 41 of file Vector2DI.H.

◆ Vector2D() [3/4]

Vector2D ( const Cmpt &  vx,
const Cmpt &  vy 
)
inline

Construct given two components.

Definition at line 49 of file Vector2DI.H.

◆ Vector2D() [4/4]

Vector2D ( Istream is)
inline

Construct from Istream.

Definition at line 58 of file Vector2DI.H.

Member Function Documentation

◆ x() [1/2]

Cmpt & x
inline

Definition at line 67 of file Vector2DI.H.

Referenced by Foam::help::doTrianglesOverlap(), Foam::eigenVectors(), Foam::operator&(), Foam::operator*(), GAMGSolver::scale(), and Foam::sqr().

Here is the caller graph for this function:

◆ y() [1/2]

Cmpt & y
inline

Definition at line 73 of file Vector2DI.H.

Referenced by Foam::help::doTrianglesOverlap(), Foam::eigenVectors(), Foam::operator&(), Foam::operator*(), GAMGSolver::scale(), and Foam::sqr().

Here is the caller graph for this function:

◆ x() [2/2]

Cmpt& x ( )
inline

◆ y() [2/2]

Cmpt& y ( )
inline

◆ perp()

scalar perp ( const Vector2D< Cmpt > &  b) const
inline

Perp dot product (dot product with perpendicular vector)

Definition at line 103 of file Vector2DI.H.

Referenced by line::nearestDist().

Here is the caller graph for this function:

Field Documentation

◆ typeName

const char* const typeName
static

Definition at line 68 of file Vector2D.H.

◆ componentNames

const char* componentNames[]
static

Definition at line 69 of file Vector2D.H.

◆ zero

const Vector2D zero
static

Definition at line 70 of file Vector2D.H.

◆ one

const Vector2D one
static

Definition at line 71 of file Vector2D.H.

◆ max

const Vector2D max
static

Definition at line 72 of file Vector2D.H.

◆ min

const Vector2D min
static

Definition at line 73 of file Vector2D.H.


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