Changeset 18919
- Timestamp:
- 12/03/14 15:56:54 (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
r18916 r18919 6 6 7 7 /*Constructors/Destructors*/ 8 Covertree::Covertree( const double& maxDist,const std::vector<Observation>& points){8 Covertree::Covertree(int maxLevel,const std::vector<Observation>& points){ 9 9 this->base = 2.; 10 10 _root=NULL; 11 11 _numNodes=0; 12 _maxLevel= ceilf(log(maxDist)/log(base));12 _maxLevel=maxLevel;//ceilf(log(maxDist)/log(base)); 13 13 _minLevel=_maxLevel-1; 14 14 std::vector<Observation>::const_iterator it; -
issm/trunk-jpl/src/c/classes/kriging/Covertree.h
r18912 r18919 89 89 */ 90 90 91 Covertree( const double&maxDist,91 Covertree(int maxDist, 92 92 const std::vector<Observation>& points=std::vector<Observation>()); 93 93 ~Covertree(); -
issm/trunk-jpl/src/c/classes/kriging/Observations.cpp
r18915 r18919 157 157 void Observations::InitCovertree(IssmPDouble* observations_list,IssmPDouble* x,IssmPDouble* y,int n,Options* options){/*{{{*/ 158 158 159 int maxdepth = 10;159 int maxdepth = 20; 160 160 _printf0_("Generating covertree with a maximum depth " << maxdepth <<"... "); 161 161 this->covertree=new Covertree(maxdepth); 162 162 163 163 for(int i=0;i<n;i++){ 164 if(i%1000) printf("progress = %g \n",double(i)/double(n)*100.);165 164 this->covertree->insert(Observation(x[i],y[i],observations_list[i])); 166 165 } 167 168 166 _printf0_("done\n"); 169 167 } … … 619 617 }/*}}}*/ 620 618 621 622 619 void Observations::ObservationList2(double **px,double **py,double **pobs,int* pnobs,double x_interp,double y_interp,double radius,int maxdata){/*{{{*/ 623 620 … … 630 627 631 628 kNN=(this->covertree->kNearestNeighbors(observation, maxdata)); 632 //cout << "kNN's size: " << kNN.size() << endl;629 //cout << "kNN's size: " << kNN.size() << " (maxdata = " <<maxdata<<")"<<endl; 633 630 634 631 //kNN is sort from closest to farthest neighbor
Note:
See TracChangeset
for help on using the changeset viewer.