Changeset 18919


Ignore:
Timestamp:
12/03/14 15:56:54 (10 years ago)
Author:
Mathieu Morlighem
Message:

BUG: input argument is now the max depth level and not the max ditance

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  
    66
    77        /*Constructors/Destructors*/
    8 Covertree::Covertree(const double& maxDist,const std::vector<Observation>& points){
     8Covertree::Covertree(int maxLevel,const std::vector<Observation>& points){
    99        this->base = 2.;
    1010        _root=NULL;
    1111        _numNodes=0;
    12         _maxLevel=ceilf(log(maxDist)/log(base));
     12        _maxLevel=maxLevel;//ceilf(log(maxDist)/log(base));
    1313        _minLevel=_maxLevel-1;
    1414        std::vector<Observation>::const_iterator it;
  • issm/trunk-jpl/src/c/classes/kriging/Covertree.h

    r18912 r18919  
    8989         */
    9090
    91         Covertree(const double& maxDist,
     91        Covertree(int maxDist,
    9292                                const std::vector<Observation>& points=std::vector<Observation>());
    9393        ~Covertree();
  • issm/trunk-jpl/src/c/classes/kriging/Observations.cpp

    r18915 r18919  
    157157void Observations::InitCovertree(IssmPDouble* observations_list,IssmPDouble* x,IssmPDouble* y,int n,Options* options){/*{{{*/
    158158
    159     int maxdepth = 10;
     159    int maxdepth = 20;
    160160         _printf0_("Generating covertree with a maximum depth " <<  maxdepth <<"... ");
    161161    this->covertree=new Covertree(maxdepth);
    162162
    163163    for(int i=0;i<n;i++){
    164                  if(i%1000) printf("progress = %g \n",double(i)/double(n)*100.);
    165164                 this->covertree->insert(Observation(x[i],y[i],observations_list[i]));
    166165    }
    167 
    168166         _printf0_("done\n");
    169167}
     
    619617}/*}}}*/
    620618
    621 
    622619void Observations::ObservationList2(double **px,double **py,double **pobs,int* pnobs,double x_interp,double y_interp,double radius,int maxdata){/*{{{*/
    623620   
     
    630627
    631628         kNN=(this->covertree->kNearestNeighbors(observation, maxdata));
    632          //cout << "kNN's size: " << kNN.size() << endl;
     629         //cout << "kNN's size: " << kNN.size() << " (maxdata = " <<maxdata<<")"<<endl;
    633630       
    634631        //kNN is sort from closest to farthest neighbor
Note: See TracChangeset for help on using the changeset viewer.