TBTK
Need a break? Support the development by playing Polarity Puzzles
TBTK::VectorNd Class Reference

Public Member Functions

 VectorNd ()
 
 VectorNd (unsigned int size)
 
 VectorNd (std::initializer_list< double > components)
 
 VectorNd (const std::vector< double > &components)
 
double & operator[] (unsigned int n)
 
const double & operator[] (unsigned int n) const
 
const VectorNd operator+ (const VectorNd &rhs) const
 
const VectorNd operator- (const VectorNd &rhs) const
 
const VectorNd operator- () const
 
const VectorNd operator* (double rhs) const
 
const VectorNd operator/ (double rhs) const
 
const VectorNd unit () const
 
const VectorNd parallel (const VectorNd &v) const
 
double norm () const
 
const std::vector< double > getStdVector () const
 
unsigned int getSize () const
 

Static Public Member Functions

static double dotProduct (const VectorNd &lhs, const VectorNd &rhs)
 

Friends

const friend VectorNd operator* (double lhs, const VectorNd &rhs)
 
std::ostream & operator<< (std::ostream &stream, const VectorNd &v)
 

Constructor & Destructor Documentation

◆ VectorNd() [1/4]

TBTK::VectorNd::VectorNd ( )

Constructor.

◆ VectorNd() [2/4]

TBTK::VectorNd::VectorNd ( unsigned int  size)

Constructor.

◆ VectorNd() [3/4]

TBTK::VectorNd::VectorNd ( std::initializer_list< double >  components)

Constructor.

◆ VectorNd() [4/4]

TBTK::VectorNd::VectorNd ( const std::vector< double > &  components)

Constructor.

Member Function Documentation

◆ dotProduct()

double TBTK::VectorNd::dotProduct ( const VectorNd lhs,
const VectorNd rhs 
)
inlinestatic

Dot product.

◆ getSize()

unsigned int TBTK::VectorNd::getSize ( ) const
inline

Get size.

◆ getStdVector()

const std::vector< double > TBTK::VectorNd::getStdVector ( ) const
inline

Get a std::vector<double> representation of the vector.

◆ norm()

double TBTK::VectorNd::norm ( ) const
inline

Norm.

◆ operator*()

const VectorNd TBTK::VectorNd::operator* ( double  rhs) const
inline

Multiplication operator (vector*scalar).

◆ operator+()

const VectorNd TBTK::VectorNd::operator+ ( const VectorNd rhs) const
inline

Addition operator.

◆ operator-() [1/2]

const VectorNd TBTK::VectorNd::operator- ( ) const
inline

Inversion operator.

◆ operator-() [2/2]

const VectorNd TBTK::VectorNd::operator- ( const VectorNd rhs) const
inline

Subtraction operator.

◆ operator/()

const VectorNd TBTK::VectorNd::operator/ ( double  rhs) const
inline

Division operator.

◆ operator[]() [1/2]

double & TBTK::VectorNd::operator[] ( unsigned int  n)
inline

Accessor operator.

◆ operator[]() [2/2]

const double & TBTK::VectorNd::operator[] ( unsigned int  n) const
inline

Accessor operator.

◆ parallel()

const VectorNd TBTK::VectorNd::parallel ( const VectorNd v) const
inline

Returns a vector that is the component of the vector that is parallel to the argument.

◆ unit()

const VectorNd TBTK::VectorNd::unit ( ) const
inline

Returns a unit vector pointing in the same direction as the original vector.

Friends And Related Function Documentation

◆ operator*

const friend VectorNd operator* ( double  lhs,
const VectorNd rhs 
)
friend

Multiplication operator (scalar*vector).

◆ operator<<

std::ostream& operator<< ( std::ostream &  stream,
const VectorNd v 
)
friend

operator<< for ostream.


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