Assignments Assignments

Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
Util::Point< Dim > Class Template Reference

`#include <geometry.h>`

Inheritance diagram for Util::Point< Dim >:

## Public Member Functions
| Point (void)
| Point (const Point &p)
template<typename ... Doubles>
| Point (Doubles ... values)
double & | operator[] (int index)
const double & | operator[] (int index) const
Point | operator* (const Point &p) const
Point & | operator*= (const Point &p)
Point | operator/ (const Point &p) const
Point & | operator/= (const Point &p)
Point | operator* (double s) const
Point | operator+ (const Point &p) const
double | dot (const Point &p) const
template<typename ... Points>
Point< Dim > | CrossProduct (Points ... points)
Public Member Functions inherited from Util::_InnerProductSpace< Point< Dim > >
double | squareNorm (void) const
double | length (void) const
Point< Dim > | unit (void) const

## Static Public Member Functions
template<typename ... Points>
static Point | CrossProduct (Points ... points)
static Point | CrossProduct (Point *points)
static Point | CrossProduct (const Point *points)
Static Public Member Functions inherited from Util::_InnerProductSpace< Point< Dim > >
static double | Dot (const Point< Dim > &e1, const Point< Dim > &e2)
static double | SquareNorm (const Point< Dim > &e)
static double | Length (const Point< Dim > &e)
static double | SquareDistance (const Point< Dim > &e1, const Point< Dim > &e2)
static double | Distance (const Point< Dim > &e1, const Point< Dim > &e2)

## Private Member Functions
void | _init (const double *values, unsigned int sz)

## Private Attributes
double | _p [Dim]

## Detailed Description

template<unsigned int Dim>
class Util::Point< Dim >

This templated class represents a Dim-dimenaional vector

## Constructor & Destructor Documentation

## ◆ Point() [1/3]

template<unsigned int Dim>

Util::Point< Dim >::Point | ( | void |  | ) |

Default constructor, initializes coefficients to zero.

## ◆ Point() [2/3]

template<unsigned int Dim>

Util::Point< Dim >::Point | ( | const Point< Dim > & | p | ) |

Copy constructor

## ◆ Point() [3/3]

template<unsigned int Dim>
template<typename ... Doubles>

Util::Point< Dim >::Point | ( | Doubles ... | values | ) |

Variadic constructor. Assumes the number of values is equal to the dimension and that all values are doubles.

## Member Function Documentation

## ◆ _init()

template<unsigned int Dim>

void Util::Point< Dim >::_init | ( | const double * | values,
|  | unsigned int | sz )
| private

Initializes coordinate values from an array

## ◆ CrossProduct() [1/4]

template<unsigned int Dim>

Point< Dim > Util::Point< Dim >::CrossProduct | ( | const Point< Dim > * | points | ) |
| static

This method returns the cross-product of Dim-1 points.

## ◆ CrossProduct() [2/4]

template<unsigned int Dim>

Point< Dim > Util::Point< Dim >::CrossProduct | ( | Point< Dim > * | points | ) |
| static

This method returns the cross-product of Dim-1 points.

## ◆ CrossProduct() [3/4]

template<unsigned int Dim>
template<typename ... Points>

static Point Util::Point< Dim >::CrossProduct | ( | Points ... | points | ) |
| static

This method returns the cross-product of Dim-1 points.

## ◆ CrossProduct() [4/4]

template<unsigned int Dim>
template<typename ... Points>

Point< Dim > Util::Point< Dim >::CrossProduct | ( | Points ... | points | ) |

## ◆ dot()

template<unsigned int Dim>

double Util::Point< Dim >::dot | ( | const Point< Dim > & | p | ) | const

Dot-product method for inner-product space

## ◆ operator*() [1/2]

template<unsigned int Dim>

Point< Dim > Util::Point< Dim >::operator* | ( | const Point< Dim > & | p | ) | const

This method performs a component-wise multiplication of two ponts and returns the product.

## ◆ operator*() [2/2]

template<unsigned int Dim>

Point< Dim > Util::Point< Dim >::operator* | ( | double | s | ) | const

Scaling method for vector space

## ◆ operator*=()

template<unsigned int Dim>

Point< Dim > & Util::Point< Dim >::operator*= | ( | const Point< Dim > & | p | ) |

This method multiplies the coefficients of the current point by the coefficients of the input point.

## ◆ operator+()

template<unsigned int Dim>

Point< Dim > Util::Point< Dim >::operator+ | ( | const Point< Dim > & | p | ) | const

Addition method for vector space

## ◆ operator/()

template<unsigned int Dim>

Point< Dim > Util::Point< Dim >::operator/ | ( | const Point< Dim > & | p | ) | const

This method performs a component-wise division of two ponts and returns the ratio.

## ◆ operator/=()

template<unsigned int Dim>

Point< Dim > & Util::Point< Dim >::operator/= | ( | const Point< Dim > & | p | ) |

This method divides the coefficients of the current point by the coefficients of the input point.

## ◆ operator[]() [1/2]

template<unsigned int Dim>

double & Util::Point< Dim >::operator[] | ( | int | index | ) |

This method returns a reference to the indexed coefficient.

## ◆ operator[]() [2/2]

template<unsigned int Dim>

const double & Util::Point< Dim >::operator[] | ( | int | index | ) | const

This method returns a reference to the indexed coefficient.

## Member Data Documentation

## ◆ _p

template<unsigned int Dim>

double Util::Point< Dim >::_p[Dim]
| private

The coordinates of the point

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

- Assignments/Util/geometry.h
- Assignments/Util/geometry.inl