MINT2
|
#include <HyperPoint.h>
Public Member Functions | |
HyperPoint (int dimension) | |
HyperPoint (int dimension, double val) | |
HyperPoint (std::vector< double > coords) | |
HyperPoint (double x1) | |
HyperPoint (double x1, double x2) | |
HyperPoint (double x1, double x2, double x3) | |
HyperPoint (double x1, double x2, double x3, double x4) | |
HyperPoint (double x1, double x2, double x3, double x4, double x5) | |
HyperPoint (double x1, double x2, double x3, double x4, double x5, double x6) | |
HyperPoint (double x1, double x2, double x3, double x4, double x5, double x6, double x7) | |
const std::vector< double > & | getVector () |
HyperPoint | linearTransformation (const TMatrixD &matrix) |
virtual void | print (std::ostream &os=std::cout, int endline=1) const |
const double & | at (int i) const |
double & | at (int i) |
HyperPoint & | operator= (const HyperPoint &other) |
HyperPoint | operator+ (const HyperPoint &other) const |
HyperPoint | operator- (const HyperPoint &other) const |
HyperPoint | operator- (const double &other) const |
HyperPoint | operator+ (const double &other) const |
HyperPoint | operator/ (const double &other) const |
HyperPoint | operator * (const double &other) const |
bool | operator< (const HyperPoint &other) const |
bool | operator > (const HyperPoint &other) const |
bool | operator<= (const HyperPoint &other) const |
bool | operator >= (const HyperPoint &other) const |
bool | operator== (const HyperPoint &other) const |
bool | operator != (const HyperPoint &other) const |
bool | allLT (const HyperPoint &other) const |
bool | allGT (const HyperPoint &other) const |
bool | allLTOE (const HyperPoint &other) const |
bool | allGTOE (const HyperPoint &other) const |
bool | operator< (const double &other) const |
bool | operator > (const double &other) const |
bool | operator<= (const double &other) const |
bool | operator >= (const double &other) const |
bool | operator== (const double &other) const |
double | multiplyElements () const |
double | dotProduct (const HyperPoint &other) const |
void | fillRandom (double min=-1.0, double max=1.0) |
HyperPoint | project (const HyperPoint &other) const |
double | distanceTo (const HyperPoint &other) const |
double | norm () const |
double | norm2 () const |
int | size () const |
int | getDimension () const |
bool | compatible (const HyperPoint &other, bool printError=true) const |
~HyperPoint () | |
Public Member Functions inherited from Weights | |
Weights () | |
Weights (double weight) | |
int | numWeights () const |
const std::vector< double > & | getWeightsVector () |
void | printWeight (std::ostream &os=std::cout, int endline=1) const |
double | getWeight (int i=0) const |
void | setWeight (int i, double w) |
void | setWeight (double w) |
void | addWeight (const double &weight) |
virtual | ~Weights () |
Protected Attributes | |
std::vector< double > | _coords |
Protected Attributes inherited from Weights | |
std::vector< double > | _weights |
Friends | |
std::ostream & | operator<< (std::ostream &os, const HyperPoint &point) |
HyperPlot, Author: Sam Harnew, sam.h , Date: Dec 2015 arne w@gma il.c om
A point in multi-dimensional space
Definition at line 26 of file HyperPoint.h.
HyperPoint::HyperPoint | ( | int | dimension | ) |
Most basic constructor that makes a HyperPoint with a specified dimension, and filled with 0.0 for each element.
Definition at line 6 of file HyperPoint.cpp.
HyperPoint::HyperPoint | ( | int | dimension, |
double | val | ||
) |
Constructor that makes a HyperPoint with a specified dimension, and fills each element with a specified value.
Definition at line 14 of file HyperPoint.cpp.
HyperPoint::HyperPoint | ( | std::vector< double > | coords | ) |
HyperPoint::HyperPoint | ( | double | x1 | ) |
HyperPoint::HyperPoint | ( | double | x1, |
double | x2 | ||
) |
HyperPoint::HyperPoint | ( | double | x1, |
double | x2, | ||
double | x3 | ||
) |
HyperPoint::HyperPoint | ( | double | x1, |
double | x2, | ||
double | x3, | ||
double | x4 | ||
) |
HyperPoint::HyperPoint | ( | double | x1, |
double | x2, | ||
double | x3, | ||
double | x4, | ||
double | x5 | ||
) |
HyperPoint::HyperPoint | ( | double | x1, |
double | x2, | ||
double | x3, | ||
double | x4, | ||
double | x5, | ||
double | x6 | ||
) |
Definition at line 76 of file HyperPoint.cpp.
HyperPoint::HyperPoint | ( | double | x1, |
double | x2, | ||
double | x3, | ||
double | x4, | ||
double | x5, | ||
double | x6, | ||
double | x7 | ||
) |
Definition at line 87 of file HyperPoint.cpp.
HyperPoint::~HyperPoint | ( | ) |
bool HyperPoint::allGT | ( | const HyperPoint & | other | ) | const |
Checks if every element of v2 is greater than the
same element in v2. i.e. v1_0 > v2_0 && v1_1 > v2_1 && ...
Definition at line 347 of file HyperPoint.cpp.
bool HyperPoint::allGTOE | ( | const HyperPoint & | other | ) | const |
Checks if every element of v1 is greater than or equal to the
same element in v2. i.e. v1_0 >= v2_0 && v1_1 >= v2_1 && ...
Definition at line 369 of file HyperPoint.cpp.
bool HyperPoint::allLT | ( | const HyperPoint & | other | ) | const |
Checks if every element of v1 is less than the
same element in v2. i.e. v1_0 < v2_0 && v1_1 < v2_1 && ...
Definition at line 336 of file HyperPoint.cpp.
bool HyperPoint::allLTOE | ( | const HyperPoint & | other | ) | const |
Checks if every element of v1 is less than or equal to the
same element in v2. i.e. v1_0 <= v2_0 && v1_1 <= v2_1 && ...
Definition at line 358 of file HyperPoint.cpp.
const double & HyperPoint::at | ( | int | i | ) | const |
returns a const reference to a choosen element of the HyperPoint. Can be used for getting the value, but not setting
Definition at line 433 of file HyperPoint.cpp.
double & HyperPoint::at | ( | int | i | ) |
returns a reference to a choosen element of the HyperPoint. Can be used for getting or setting it's value.
Definition at line 443 of file HyperPoint.cpp.
bool HyperPoint::compatible | ( | const HyperPoint & | other, |
bool | printError = true |
||
) | const |
Check if two HyperPoints are compatible (of the same dimension)
Definition at line 111 of file HyperPoint.cpp.
double HyperPoint::distanceTo | ( | const HyperPoint & | other | ) | const |
Find the distance between this point and another
Definition at line 123 of file HyperPoint.cpp.
double HyperPoint::dotProduct | ( | const HyperPoint & | other | ) | const |
Find the dot product of two points
Definition at line 147 of file HyperPoint.cpp.
void HyperPoint::fillRandom | ( | double | min = -1.0 , |
double | max = 1.0 |
||
) |
Fill the point with random numbers, uniformly distributed between min and max. Uses gRandom for random number.
Definition at line 157 of file HyperPoint.cpp.
|
inline |
get the dimensionality of the HyperPoint
Definition at line 99 of file HyperPoint.h.
|
inline |
Get the std::vector<double> that contains the coordinates
Definition at line 48 of file HyperPoint.h.
HyperPoint HyperPoint::linearTransformation | ( | const TMatrixD & | matrix | ) |
Perform a linear transformation on the HyperPoint using a specified matrix. v_new = v_old M
Leave weights unchanged.
Definition at line 266 of file HyperPoint.cpp.
double HyperPoint::multiplyElements | ( | ) | const |
double HyperPoint::norm | ( | ) | const |
double HyperPoint::norm2 | ( | ) | const |
bool HyperPoint::operator != | ( | const HyperPoint & | other | ) | const |
Checks if two HyperPoints are not identical
Definition at line 389 of file HyperPoint.cpp.
HyperPoint HyperPoint::operator * | ( | const double & | other | ) | const |
Multiply all elements of a HyperPoint by one value. Leave weights unchanged.
Definition at line 253 of file HyperPoint.cpp.
bool HyperPoint::operator > | ( | const HyperPoint & | other | ) | const |
Compare two HyperPoints. First compares 0th element of each HyperPoint, if these are the same, compares the next, etc.
Definition at line 298 of file HyperPoint.cpp.
bool HyperPoint::operator > | ( | const double & | other | ) | const |
Checks if all elements of a HyperPoint are greater than a given value
Definition at line 405 of file HyperPoint.cpp.
bool HyperPoint::operator >= | ( | const HyperPoint & | other | ) | const |
Compare two HyperPoints. First compares 0th element of each HyperPoint, if these are the same, compares the next, etc.
Definition at line 324 of file HyperPoint.cpp.
bool HyperPoint::operator >= | ( | const double & | other | ) | const |
Checks if all elements of a HyperPoint are greater than or equal to a given value
Definition at line 419 of file HyperPoint.cpp.
HyperPoint HyperPoint::operator+ | ( | const HyperPoint & | other | ) | const |
Add elements of two HyperPoints together - leave weights unchanged.
Definition at line 189 of file HyperPoint.cpp.
HyperPoint HyperPoint::operator+ | ( | const double & | other | ) | const |
Add one value to all elements of the HyperPoint. Leave weights unchanged.
Definition at line 229 of file HyperPoint.cpp.
HyperPoint HyperPoint::operator- | ( | const HyperPoint & | other | ) | const |
Subtract one HyperPoint from another - leave weights unchanged.
Definition at line 203 of file HyperPoint.cpp.
HyperPoint HyperPoint::operator- | ( | const double & | other | ) | const |
Subtract one value from all elements of the HyperPoint. Leave weights unchanged.
Definition at line 217 of file HyperPoint.cpp.
HyperPoint HyperPoint::operator/ | ( | const double & | other | ) | const |
Divide all elements of a HyperPoint by one value. Leave weights unchanged.
Definition at line 241 of file HyperPoint.cpp.
bool HyperPoint::operator< | ( | const HyperPoint & | other | ) | const |
Perform a linear transformation on the HyperPoint using a specified matrix. v_new = v_old M
Leave weights unchanged.
Definition at line 285 of file HyperPoint.cpp.
bool HyperPoint::operator< | ( | const double & | other | ) | const |
Checks if all elements of a HyperPoint are smaller than a given value
Definition at line 398 of file HyperPoint.cpp.
bool HyperPoint::operator<= | ( | const HyperPoint & | other | ) | const |
Compare two HyperPoints. First compares 0th element of each HyperPoint, if these are the same, compares the next, etc.
Definition at line 311 of file HyperPoint.cpp.
bool HyperPoint::operator<= | ( | const double & | other | ) | const |
Checks if all elements of a HyperPoint are smaller than or equal to a given value
Definition at line 412 of file HyperPoint.cpp.
HyperPoint & HyperPoint::operator= | ( | const HyperPoint & | other | ) |
Copy all elements and weights from other HyperPoint to this. Only function that allows the dimensionality of a point to be changed after it is created. Should be careful with this, for instance a HyperPointSet only accepts HyperPoint's of the same dimension. If you change the dimensionality of a point after it has been added, this could cause big problems.
Definition at line 178 of file HyperPoint.cpp.
bool HyperPoint::operator== | ( | const HyperPoint & | other | ) | const |
Checks if two HyperPoints are identical
Definition at line 380 of file HyperPoint.cpp.
bool HyperPoint::operator== | ( | const double & | other | ) | const |
Checks if all elements of a HyperPoint are equal to a given value
Definition at line 426 of file HyperPoint.cpp.
|
virtual |
Print the HyperPoint to the given std::ostream (default is std::cout).
Definition at line 453 of file HyperPoint.cpp.
HyperPoint HyperPoint::project | ( | const HyperPoint & | other | ) | const |
Project this vector onto another = v1 (v1.v2/v1.v1)
Definition at line 164 of file HyperPoint.cpp.
|
inline |
get the dimensionality of the HyperPoint
Definition at line 96 of file HyperPoint.h.
|
friend |
Definition at line 471 of file HyperPoint.cpp.
|
protected |
The coordinates of the point in muli-dimensional spave
Definition at line 30 of file HyperPoint.h.