7 _coords(dimension, 0.0)
15 _coords(dimension, val)
105 for (
int i = 0; i <
size(); i++) total *= this->
at(i);
114 if (printError ==
true)
ERROR_LOG <<
"HyperPoints are of different dimension i.e. not compatible!!!";
132 double normVal = 0.0;
133 for (
int i = 0; i <
size(); i++) normVal +=
at(i)*
at(i);
134 return sqrt(normVal);
140 double normVal = 0.0;
141 for (
int i = 0; i <
size(); i++) normVal +=
at(i)*
at(i);
151 for (
int i = 0; i <
size(); i++) val +=
at(i)*other.
at(i);
159 for(
int i = 0; i <
size(); i++)
at(i) = gRandom->Uniform(min,max);
165 if (this->
compatible(other) == 0)
return *
this;
169 return (projection * scale);
191 if (this->
compatible(other) == 0)
return *
this;
195 for (
int i = 0; i <
size(); i++) temp.
at(i) = this->
at(i) + other.
at(i);
205 if (this->
compatible(other) == 0)
return *
this;
209 for (
int i = 0; i <
size(); i++) temp.
at(i) = this->
at(i) - other.
at(i);
221 for (
int i = 0; i <
size(); i++) temp.
at(i) = this->
at(i) - other;
233 for (
int i = 0; i <
size(); i++) temp.
at(i) = this->
at(i) + other;
245 for (
int i = 0; i <
size(); i++) temp.
at(i) = this->
at(i) / other;
257 for (
int i = 0; i <
size(); i++) temp.
at(i) = this->
at(i) * other;
273 val +=
at(j)*matrix(i,j);
286 if (this->
compatible(other) == 0)
return false;
288 for (
int i = 0; i <
size(); i++) {
289 if (this->
at(i) < other.
at(i))
return true;
290 if (this->
at(i) > other.
at(i))
return false;
299 if (this->
compatible(other) == 0)
return false;
301 for (
int i = 0; i <
size(); i++) {
302 if (this->
at(i) < other.
at(i))
return false;
303 if (this->
at(i) > other.
at(i))
return true;
312 if (this->
compatible(other) == 0)
return false;
314 for (
int i = 0; i <
size(); i++) {
315 if (this->
at(i) < other.
at(i))
return true;
316 if (this->
at(i) > other.
at(i))
return false;
325 if (this->
compatible(other) == 0)
return false;
327 for (
int i = 0; i <
size(); i++) {
328 if (this->
at(i) < other.
at(i))
return false;
329 if (this->
at(i) > other.
at(i))
return true;
337 if (this->
compatible(other) == 0)
return false;
339 for (
int i = 0; i <
size(); i++) {
340 if (this->
at(i) >= other.
at(i))
return false;
348 if (this->
compatible(other) == 0)
return false;
350 for (
int i = 0; i <
size(); i++) {
351 if (this->
at(i) <= other.
at(i))
return false;
359 if (this->
compatible(other) == 0)
return false;
361 for (
int i = 0; i <
size(); i++) {
362 if (this->
at(i) > other.
at(i))
return false;
370 if (this->
compatible(other) == 0)
return false;
372 for (
int i = 0; i <
size(); i++) {
373 if (this->
at(i) < other.
at(i))
return false;
381 if (this->
compatible(other) == 0)
return false;
383 for (
int i = 0; i <
size(); i++)
if (this->
at(i) != other.
at(i))
return false;
390 if (this->
compatible(other) == 0)
return false;
392 for (
int i = 0; i <
size(); i++)
if (this->
at(i) != other.
at(i))
return true;
399 for (
int i = 0; i <
size(); i++)
if ((this->
at(i) < other)==0)
return false;
406 for (
int i = 0; i <
size(); i++)
if ((this->
at(i) > other)==0)
return false;
413 for (
int i = 0; i <
size(); i++)
if ((this->
at(i) <= other)==0)
return false;
420 for (
int i = 0; i <
size(); i++)
if ((this->
at(i) >= other)==0)
return false;
427 for (
int i = 0; i <
size(); i++)
if ((this->
at(i) == other)==0)
return false;
434 if (i >= this->
size()) {
435 ERROR_LOG <<
"The component of this HyperPoint you have selected is out of range";
445 ERROR_LOG <<
"The component of this HyperPoint you have selected is out of range";
455 std::ostringstream oss;
458 for(
int i = 0; i < (
size() - 1); i++){
459 oss << std::setw(10) << std::left <<
_coords.at(i) <<
", ";
461 if (
size() != 0) oss << std::setw(10) << std::left <<
_coords.at(
size() - 1);
466 if (endline) oss << std::endl;
void fillRandom(double min=-1.0, double max=1.0)
bool allLTOE(const HyperPoint &other) const
bool allGT(const HyperPoint &other) const
HyperPoint(int dimension)
virtual void print(std::ostream &os=std::cout, int endline=1) const
double dotProduct(const HyperPoint &other) const
HyperPoint operator *(const double &other) const
bool allLT(const HyperPoint &other) const
bool operator >(const HyperPoint &other) const
HyperPoint & operator=(const HyperPoint &other)
std::ostream & operator<<(std::ostream &os, const HyperPoint &point)
bool operator==(const HyperPoint &other) const
bool operator !=(const HyperPoint &other) const
HyperPoint operator-(const HyperPoint &other) const
std::vector< double > _coords
bool compatible(const HyperPoint &other, bool printError=true) const
double multiplyElements() const
HyperPoint operator+(const HyperPoint &other) const
bool operator >=(const HyperPoint &other) const
const double & at(int i) const
std::vector< double > _weights
bool operator<=(const HyperPoint &other) const
HyperPoint project(const HyperPoint &other) const
void printWeight(std::ostream &os=std::cout, int endline=1) const
bool operator<(const HyperPoint &other) const
HyperPoint operator/(const double &other) const
double distanceTo(const HyperPoint &other) const
HyperPoint linearTransformation(const TMatrixD &matrix)
bool allGTOE(const HyperPoint &other) const