Public Types | Public Member Functions | Data Fields | Friends
VectorSpace Class Reference

Templated vector space. More...

Inheritance diagram for VectorSpace:
Inheritance graph
[legend]

Public Types

enum  { dim = 3, nComponents = nCmpt }
 
typedef Cmpt cmptType
 Component type. More...
 

Public Member Functions

 VectorSpace ()
 Construct null. More...
 
 VectorSpace (Istream &)
 Construct from Istream. More...
 
 VectorSpace (const VectorSpace< Form, Cmpt, nCmpt > &)
 Construct as copy. More...
 
template<class Form2 , class Cmpt2 >
 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)
 

Data Fields

Cmpt v_ [nCmpt]
 The components of this vector space. More...
 

Friends

Istreamoperator>> (Istream &, VectorSpace< Form, Cmpt, nCmpt > &)
 
Ostreamoperator (Ostream &, const VectorSpace< Form, Cmpt, nCmpt > &)
 

Detailed Description

Templated vector space.

Template arguments are the Form the vector space will be used to create, the type of the elements and the number of elements.

Source files

Definition at line 52 of file VectorSpace.H.

Member Typedef Documentation

◆ cmptType

typedef Cmpt cmptType

Component type.

Definition at line 80 of file VectorSpace.H.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
dim 

Dimensionality of space.

nComponents 

Number of components in this vector space.

Definition at line 85 of file VectorSpace.H.

Constructor & Destructor Documentation

◆ VectorSpace() [1/4]

VectorSpace ( )
inline

Construct null.

Definition at line 39 of file VectorSpaceI.H.

◆ VectorSpace() [2/4]

Construct from Istream.

◆ VectorSpace() [3/4]

VectorSpace ( const VectorSpace< Form, Cmpt, nCmpt > &  )
inline

Construct as copy.

◆ VectorSpace() [4/4]

VectorSpace ( const VectorSpace< Form2, Cmpt2, nCmpt > &  vs)
inline

Construct as copy of another VectorSpace type of the same rank.

Definition at line 56 of file VectorSpaceI.H.

Member Function Documentation

◆ size()

label size ( ) const
inline

Return the number of elements in the VectorSpace = nCmpt.

Definition at line 67 of file VectorSpaceI.H.

◆ component() [1/3]

const Cmpt& component ( const  direction) const
inline

◆ component() [2/3]

Cmpt& component ( const  direction)
inline

◆ component() [3/3]

void component ( Cmpt &  ,
const  direction 
) const
inline

◆ replace()

void replace ( const direction  d,
const Cmpt &  c 
)
inline

Definition at line 133 of file VectorSpaceI.H.

◆ operator[]() [1/2]

const Cmpt& operator[] ( const  direction) const
inline

◆ operator[]() [2/2]

Cmpt& operator[] ( const  direction)
inline

◆ operator=()

void operator= ( const VectorSpace< Form, Cmpt, nCmpt > &  vs)
inline

Definition at line 193 of file VectorSpaceI.H.

◆ operator+=()

void operator+= ( const VectorSpace< Form, Cmpt, nCmpt > &  vs)
inline

Definition at line 203 of file VectorSpaceI.H.

◆ operator-=()

void operator-= ( const VectorSpace< Form, Cmpt, nCmpt > &  vs)
inline

Definition at line 213 of file VectorSpaceI.H.

◆ operator*=()

void operator*= ( const scalar  s)
inline

Definition at line 223 of file VectorSpaceI.H.

◆ operator/=()

void operator/= ( const scalar  s)
inline

Definition at line 233 of file VectorSpaceI.H.

Friends And Related Function Documentation

◆ operator>>

Istream& operator>> ( Istream ,
VectorSpace< Form, Cmpt, nCmpt > &   
)
friend

◆ operator

Ostream& operator ( Ostream ,
const VectorSpace< Form, Cmpt, nCmpt > &   
)
friend

Field Documentation

◆ v_

Cmpt v_[nCmpt]

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