Changeset 18914
- Timestamp:
- 12/03/14 12:01:11 (10 years ago)
- Location:
- issm/trunk-jpl/src/c/classes/kriging
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/kriging/Covertree.cpp
r18912 r18914 2 2 //#include <utility> 3 3 #include <set> 4 //#include <vector> 5 #include <algorithm> 4 6 5 7 /*Constructors/Destructors*/ … … 192 194 Observation q = (*it)->getObservation(); 193 195 double minDQ = 1.e+50; 194 CoverTreeNode* minDQNode = nullptr;196 CoverTreeNode* minDQNode = NULL; 195 197 double sep = pow(base,i); 196 198 bool br=false; … … 220 222 //std::cout << " is level " << i << " parent of "; 221 223 //(*it)->getObservation().print(); 222 if (minDQNode != nullptr)224 if (minDQNode != NULL) 223 225 minDQNode->addChild(i,*it); 224 226 } -
issm/trunk-jpl/src/c/classes/kriging/Observation.cpp
r18912 r18914 83 83 double Observation::distance(const Observation& ob) const 84 84 { 85 return std::sqrt( (std::pow( (ob. getXY().first - this->x), 2 ) + std::pow((ob.getXY().second- this->y), 2) ));85 return std::sqrt( (std::pow( (ob.x - this->x), 2 ) + std::pow((ob.y - this->y), 2) )); 86 86 } 87 87 88 const std::pair<double, double>& Observation::getXY() const89 {90 return std::make_pair(this->x, this->y);91 }92 88 bool Observation::operator==(const Observation& ob) const 93 89 { 94 return (ob. getXY().first == this->x && ob.getXY().second== this->y && ob.value == this->value);90 return (ob.x == this->x && ob.y == this->y && ob.value == this->value); 95 91 } 96 92 97 93 void Observation::WriteXYObs(const Observation& ob, double* px, double* py, double* pobs){ 98 *px = ob. getXY().first;99 *py = ob. getXY().second;94 *px = ob.x; 95 *py = ob.y; 100 96 *pobs = ob.value; 101 97 } -
issm/trunk-jpl/src/c/classes/kriging/Observation.h
r18912 r18914 25 25 /*Object virtual functions definitions*/ 26 26 double distance(const Observation& ob) const; 27 const std::pair<double, double>& getXY() const;28 27 29 28 void Echo();
Note:
See TracChangeset
for help on using the changeset viewer.