#include <CoordinateSystem.h>
Public Member Functions | |
VivaldiCoordsInfo (bool useHeightVector=false) | |
bool | isValid () |
double | getError () const |
void | setError (double err) |
double | getHeightVector () const |
void | setHeightVector (double height) |
Prox | getDistance (const AbstractNcsNodeInfo &node) const |
bool | update (const AbstractNcsNodeInfo &info) |
operator std::vector< double > () const | |
Protected Attributes | |
double | coordErr |
double | heightVector |
Definition at line 120 of file CoordinateSystem.h.
VivaldiCoordsInfo::VivaldiCoordsInfo | ( | bool | useHeightVector = false |
) | [inline] |
Definition at line 123 of file CoordinateSystem.h.
{ coordErr = 1.0; heightVector = (useHeightVector ? 0 : -1.0); };
Prox VivaldiCoordsInfo::getDistance | ( | const AbstractNcsNodeInfo & | node | ) | const [virtual] |
Reimplemented from EuclideanNcsNodeInfo.
Definition at line 88 of file CoordinateSystem.cc.
Referenced by Vivaldi::getCoordinateBasedProx(), and Vivaldi::processCoordinates().
{ if (!dynamic_cast<const VivaldiCoordsInfo*>(&abstractInfo)) { return Prox::PROX_UNKNOWN; } const VivaldiCoordsInfo& info = *(static_cast<const VivaldiCoordsInfo*>(&abstractInfo)); double dist = 0.0, accuracy = 0.0; for (uint8_t i = 0; i < info.getDimension(); ++i) { dist += pow(getCoords(i) - info.getCoords(i), 2); } dist = sqrt(dist); accuracy = 1 - ((info.getError() + getError()) / 2); if (info.getError() >= 1.0 || getError() >= 1.0) accuracy = 0.0; if (accuracy < 0) accuracy = 0.0; if (accuracy > 1) accuracy = 1; if (getHeightVector() != -1.0 && info.getHeightVector() != -1.0) { return Prox(dist + getHeightVector() + info.getHeightVector(), info.getError()); } return Prox(dist, accuracy); }
double VivaldiCoordsInfo::getError | ( | ) | const [inline] |
Definition at line 130 of file CoordinateSystem.h.
Referenced by Vivaldi::calcError(), SVivaldi::calcError(), Vivaldi::finishVivaldi(), getDistance(), Vivaldi::getOwnError(), operator<<(), and Vivaldi::processCoordinates().
{ return coordErr; };
double VivaldiCoordsInfo::getHeightVector | ( | ) | const [inline] |
Definition at line 135 of file CoordinateSystem.h.
Referenced by getDistance(), Vivaldi::getOwnHeightVector(), operator<<(), and Vivaldi::processCoordinates().
{ return heightVector; };
bool VivaldiCoordsInfo::isValid | ( | ) | [inline, virtual] |
Implements AbstractNcsNodeInfo.
Definition at line 128 of file CoordinateSystem.h.
VivaldiCoordsInfo::operator std::vector< double > | ( | ) | const [virtual] |
Implements AbstractNcsNodeInfo.
Definition at line 130 of file CoordinateSystem.cc.
{ std::vector<double> temp; for (uint8_t i = 0; i < coordinates.size(); ++i) { temp.push_back(coordinates[i]); } temp.push_back(coordErr); if (heightVector >= 0) temp.push_back(heightVector); return temp; }
void VivaldiCoordsInfo::setError | ( | double | err | ) | [inline] |
Definition at line 131 of file CoordinateSystem.h.
Referenced by Vivaldi::processCoordinates().
void VivaldiCoordsInfo::setHeightVector | ( | double | height | ) | [inline] |
Definition at line 136 of file CoordinateSystem.h.
Referenced by Vivaldi::init(), and Vivaldi::processCoordinates().
{ heightVector = ((height > 0.0) ? height : 0.0); };
bool VivaldiCoordsInfo::update | ( | const AbstractNcsNodeInfo & | info | ) | [virtual] |
Implements AbstractNcsNodeInfo.
Definition at line 115 of file CoordinateSystem.cc.
{ if (!dynamic_cast<const VivaldiCoordsInfo*>(&info)) return false; const VivaldiCoordsInfo& temp = static_cast<const VivaldiCoordsInfo&>(info); if (coordErr > temp.coordErr) { coordErr = temp.coordErr; coordinates = temp.coordinates; heightVector = temp.heightVector; return true; } return false; }
double VivaldiCoordsInfo::coordErr [protected] |
Definition at line 145 of file CoordinateSystem.h.
Referenced by getError(), isValid(), operator std::vector< double >(), setError(), update(), and VivaldiCoordsInfo().
double VivaldiCoordsInfo::heightVector [protected] |
Definition at line 146 of file CoordinateSystem.h.
Referenced by getHeightVector(), operator std::vector< double >(), setHeightVector(), update(), and VivaldiCoordsInfo().