Point Class Reference

#include <Point.h>

List of all members.

Public Member Functions

 Point (int dimension)
 Point (vector< double > &toCopy)
unsigned int getDimension () const
double getCoordinate (const int index) const
void setCoordinate (const int index, const double value)
void setCoordinates (vector< double > values)
Pointoperator- (const Point other) const
string toString () const

Private Attributes

vector< double > m_coordinates


Detailed Description

Represents a point in n dimensions.

Definition at line 21 of file Point.h.


Constructor & Destructor Documentation

Point::Point ( int  dimension  ) 

Base point constructor.

Parameters:
dimension The dimensionality of the newly created point.

Definition at line 13 of file Point.cpp.

References m_coordinates.

Referenced by operator-().

Point::Point ( vector< double > &  toCopy  ) 

Point 'copy' constructor.

Parameters:
toCopy Converts a STL vector< double > to a point object.

Definition at line 15 of file Point.cpp.

References m_coordinates.


Member Function Documentation

unsigned int Point::getDimension (  )  const

Gets the dimension of the current node.

Returns:
The current dimension.

Definition at line 23 of file Point.cpp.

References m_coordinates.

Referenced by Cubic_Bounding_Box::contains(), Polytope::getDimension(), and Cart::Norm().

double Point::getCoordinate ( const int  index  )  const

Gets the coordinate on a given dimension.

Parameters:
index The dimension we wish to know the coordinate on
Returns:
The requested coordinate value

Definition at line 17 of file Point.cpp.

References m_coordinates.

Referenced by Cubic_Bounding_Box::contains(), Cart::Norm(), and operator-().

void Point::setCoordinate ( const int  index,
const double  value 
)

Sets the coordinate on a given dimension.

Parameters:
index The dimension we wish to set the coordinate on
value The coordinate value we wish to set

void Point::setCoordinates ( vector< double >  values  ) 

Sets the coordinate to match that of a given STL vector.

Parameters:
values The STL vector< double > we wish to copy

Definition at line 21 of file Point.cpp.

References m_coordinates.

Referenced by operator-().

Point * Point::operator- ( const Point  other  )  const

Convenience method for dimension-by-dimension substraction of point coordinates.

Beware to not call this method instead of Metric.subtract(), where appropiate!

Parameters:
other The other point
Returns:
A point which equals this-other, in the euclidian sense

Definition at line 25 of file Point.cpp.

References getCoordinate(), m_coordinates, Point(), and setCoordinates().

string Point::toString (  )  const

Prints a point nicely to string format.

Returns:
String representation of the current point

Definition at line 47 of file Point.cpp.

References m_coordinates.

Referenced by operator<<().


Member Data Documentation

vector<double> Point::m_coordinates [private]

Vector used to store the point coordinates.

Definition at line 24 of file Point.h.

Referenced by getCoordinate(), getDimension(), operator-(), Point(), setCoordinates(), and toString().


The documentation for this class was generated from the following files:
Generated on Sat Oct 13 17:34:43 2007 for R-Tree by  doxygen 1.5.2