Changeset 19153


Ignore:
Timestamp:
02/25/15 09:21:54 (10 years ago)
Author:
Mathieu Morlighem
Message:

BUG: fixed kriging for covertree

Location:
issm/trunk-jpl/src/c/classes/kriging
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/kriging/Covertree.cpp

    r18919 r19153  
    11#include "../classes.h"
    2 //#include <utility>
    32#include <set>
    4 //#include <vector>
    53#include <algorithm>
    64
    75        /*Constructors/Destructors*/
    8 Covertree::Covertree(int maxLevel,const std::vector<Observation>& points){
     6Covertree::Covertree(int maxLevel,const std::vector<Observation>& points){/*{{{*/
    97        this->base = 2.;
    108        _root=NULL;
     
    1614                this->insert(*it);//adds data to the covertree object
    1715        }
    18 }
    19 
    20 Covertree::~Covertree(){
     16}/*}}}*/
     17Covertree::~Covertree(){/*{{{*/
    2118        if(_root==NULL) return;
    2219        //Get all of the root's children (from any level),
     
    3128                delete byeNode;
    3229        }   
    33 }
     30}/*}}}*/
    3431
    35 /*Methods*/
    36 std::vector<Covertree::CoverTreeNode*> Covertree::kNearestNodes(const Observation& p, const unsigned int& k) const{
     32        /*Methods*/
     33std::vector<Covertree::CoverTreeNode*> Covertree::kNearestNodes(const Observation& p, const unsigned int& k) const{/*{{{*/
    3734        if(_root==NULL) return std::vector<CoverTreeNode*>();
    3835        //maxDist is the kth nearest known point to p, and also the farthest
     
    8077        }
    8178        return kNN;
    82 }
    83 bool Covertree::insert_rec(const Observation& p, const std::vector<distNodePair>& Qi, const int& level){
     79}/*}}}*/
     80bool   Covertree::insert_rec(const Observation& p, const std::vector<distNodePair>& Qi, const int& level){/*{{{*/
    8481        std::vector<std::pair<double, CoverTreeNode*> > Qj;
    8582        double sep = pow(base,level);
     
    119116                }
    120117        }
    121 }
    122 
    123 void Covertree::remove_rec(const Observation& p, std::map<int,std::vector<distNodePair> >& coverSets, int level, bool& multi){
     118}/*}}}*/
     119void   Covertree::remove_rec(const Observation& p, std::map<int,std::vector<distNodePair> >& coverSets, int level, bool& multi){/*{{{*/
    124120        std::vector<distNodePair>& Qi = coverSets[level];
    125121        std::vector<distNodePair>& Qj = coverSets[level-1];
     
    222218                }
    223219        }
    224 }
    225 
    226 int Covertree::get_numberofobs(){
     220}/*}}}*/
     221int Covertree::get_numberofobs(){/*{{{*/
    227222        return _numNodes;
    228 }
    229 
    230 std::pair<double, Covertree::CoverTreeNode*>
    231 Covertree::distance(const Observation& p,
    232                         const std::vector<CoverTreeNode*>& Q)
    233 {
     223}/*}}}*/
     224std::pair<double, Covertree::CoverTreeNode*> Covertree::distance(const Observation& p, const std::vector<CoverTreeNode*>& Q){/*{{{*/
    234225        double minDist = 1.e+50;
    235226        CoverTreeNode* minNode;
     
    243234        }
    244235        return std::make_pair(minDist,minNode); 
    245 }
    246 
    247 void Covertree::insert(const Observation& newObservation)
    248 {
     236}/*}}}*/
     237void   Covertree::insert(const Observation& newObservation){/*{{{*/
    249238        if(_root==NULL) {
    250239                _root = new CoverTreeNode(newObservation);
     
    265254                                        _maxLevel);
    266255        }
    267 }
    268 
    269 void Covertree::remove(const Observation& p)
    270 {
     256}/*}}}*/
     257void   Covertree::remove(const Observation& p){/*{{{*/
    271258        //Most of this function's code is for the special case of removing the root
    272259        if(_root==NULL) return;
     
    305292                _root=newRoot;
    306293        }
    307 }
    308 
    309 std::vector<Observation> Covertree::kNearestNeighbors(const Observation& p, const unsigned int& k) const{
     294}/*}}}*/
     295std::vector<Observation> Covertree::kNearestNeighbors(const Observation& p, const unsigned int& k) const{/*{{{*/
    310296        if(_root==NULL) return std::vector<Observation>();
    311297        std::vector<CoverTreeNode*> v = kNearestNodes(p, k);
     
    318304        }
    319305        return kNN;
    320 }
    321 
    322 void Covertree::print() const{
     306}/*}}}*/
     307void   Covertree::print() const{/*{{{*/
    323308        int d = _maxLevel-_minLevel+1;
    324309        std::vector<CoverTreeNode*> Q;
     
    346331                std::cout << "\n\n";
    347332        }
    348 }
     333}/*}}}*/
    349334
    350 Covertree::CoverTreeNode* Covertree::getRoot() const
    351 {
     335Covertree::CoverTreeNode* Covertree::getRoot() const{/*{{{*/
    352336        return _root;
    353 }
    354 
    355 Covertree::CoverTreeNode::CoverTreeNode(const Observation& p) {
     337}/*}}}*/
     338Covertree::CoverTreeNode::CoverTreeNode(const Observation& p) {/*{{{*/
    356339        _observations.push_back(p);
    357 }
    358 
    359 std::vector<Covertree::CoverTreeNode*>
    360 Covertree::CoverTreeNode::getChildren(int level) const
    361 {
     340}/*}}}*/
     341std::vector<Covertree::CoverTreeNode*> Covertree::CoverTreeNode::getChildren(int level) const{/*{{{*/
    362342        std::map<int,std::vector<CoverTreeNode*> >::const_iterator
    363343          it = _childMap.find(level);
     
    366346        }
    367347        return std::vector<CoverTreeNode*>();
    368 }
    369 
    370 void Covertree::CoverTreeNode::addChild(int level, CoverTreeNode* p)
    371 {
     348}/*}}}*/
     349void   Covertree::CoverTreeNode::addChild(int level, CoverTreeNode* p){/*{{{*/
    372350        _childMap[level].push_back(p);
    373 }
    374 
    375 void Covertree::CoverTreeNode::removeChild(int level, CoverTreeNode* p)
    376 {
     351}/*}}}*/
     352void   Covertree::CoverTreeNode::removeChild(int level, CoverTreeNode* p){/*{{{*/
    377353        std::vector<CoverTreeNode*>& v = _childMap[level];
    378354        for(unsigned int i=0;i<v.size();i++) {
     
    383359                }
    384360        }
    385 }
    386 
    387 void Covertree::CoverTreeNode::addObservation(const Observation& p)
    388 {
     361}/*}}}*/
     362void   Covertree::CoverTreeNode::addObservation(const Observation& p){/*{{{*/
    389363        if(find(_observations.begin(), _observations.end(), p) == _observations.end())
    390364         _observations.push_back(p);
    391 }
    392 
    393 void Covertree::CoverTreeNode::removeObservation(const Observation& p)
    394 {
     365}/*}}}*/
     366void   Covertree::CoverTreeNode::removeObservation(const Observation& p){/*{{{*/
    395367        std::vector<Observation>::iterator it =
    396368          find(_observations.begin(), _observations.end(), p);
    397369        if(it != _observations.end())
    398370         _observations.erase(it);
    399 }
    400 
    401 double Covertree::CoverTreeNode::distance(const CoverTreeNode& p) const
    402 {
     371}/*}}}*/
     372double Covertree::CoverTreeNode::distance(const CoverTreeNode& p) const{/*{{{*/
    403373        return _observations[0].distance(p.getObservation());
    404 }
    405 
    406 bool Covertree::CoverTreeNode::isSingle() const
    407 {
     374}/*}}}*/
     375bool   Covertree::CoverTreeNode::isSingle() const{/*{{{*/
    408376        return _observations.size() == 1;
    409 }
    410 
    411 bool Covertree::CoverTreeNode::hasObservation(const Observation& p) const
    412 {
     377}/*}}}*/
     378bool   Covertree::CoverTreeNode::hasObservation(const Observation& p) const{/*{{{*/
    413379        return find(_observations.begin(), _observations.end(), p) != _observations.end();
    414 }
    415 
    416 const Observation& Covertree::CoverTreeNode::getObservation() const { return _observations[0]; }
    417 
    418 std::vector<Covertree::CoverTreeNode*>
    419 Covertree::CoverTreeNode::getAllChildren() const
    420 {
     380}/*}}}*/
     381const Observation& Covertree::CoverTreeNode::getObservation() const{/*{{{*/
     382        return _observations[0];
     383}/*}}}*/
     384std::vector<Covertree::CoverTreeNode*> Covertree::CoverTreeNode::getAllChildren() const{/*{{{*/
    421385        std::vector<CoverTreeNode*> children;
    422386        std::map<int,std::vector<CoverTreeNode*> >::const_iterator it;
     
    425389        }
    426390        return children;
    427 }
    428 
    429 bool Covertree::isValidTree() const {
     391}/*}}}*/
     392bool   Covertree::isValidTree() const {/*{{{*/
    430393        if(_numNodes==0)
    431394         return _root==NULL;
     
    465428        }
    466429        return true;
    467 }
     430}/*}}}*/
  • issm/trunk-jpl/src/c/classes/kriging/Covertree.h

    r18919 r19153  
    88class Covertree{
    99
    10         /**
    11          * Cover tree node. Consists of arbitrarily many points P, as long as
    12          * they have distance 0 to each other. Keeps track of its children.
    13          */
     10        /* Cover tree node. Consists of arbitrarily many points P, as long as they
     11         * have distance 0 to each other. Keeps track of its children.  */
    1412        class CoverTreeNode{
    1513                private:
     
    3432                        const std::vector<Observation>& getObservations() { return _observations; }
    3533                        double distance(const CoverTreeNode& p) const;
    36 
    37                         bool isSingle() const;
    38                         bool hasObservation(const Observation& o) const;
    39 
     34                        bool   isSingle() const;
     35                        bool   hasObservation(const Observation& o) const;
    4036                        const Observation& getObservation() const;
    4137
     
    4945        typedef std::pair<double, CoverTreeNode*> distNodePair;
    5046
    51         CoverTreeNode* _root;
    52         unsigned int _numNodes;
    53         int _maxLevel;//base^_maxLevel should be the max distance
     47        CoverTreeNode *_root;
     48        unsigned int   _numNodes;
     49        int            _maxLevel;   //base^_maxLevel should be the max distance
    5450        //between any 2 points
    55         int _minLevel;//A level beneath which there are no more new nodes.
     51        int            _minLevel;   //A level beneath which there are no more new nodes.
    5652
    57         std::vector<CoverTreeNode*>
    58           kNearestNodes(const Observation& o, const unsigned int& k) const;
     53        std::vector<CoverTreeNode*> kNearestNodes(const Observation& o, const unsigned int& k) const;
    5954        /**
    6055         * Recursive implementation of the insert algorithm (see paper).
    6156         */
    62         bool insert_rec(const Observation& p,
    63                                 const std::vector<distNodePair>& Qi,
    64                                 const int& level);
     57        bool insert_rec(const Observation& p, const std::vector<distNodePair>& Qi,const int& level);
    6558
    66         /**
    67          * Finds the node in Q with the minimum distance to p. Returns a
    68          * pair consisting of this node and the distance.
    69          */
    70         distNodePair distance(const Observation& p,
    71                                 const std::vector<CoverTreeNode*>& Q);
     59        /* Finds the node in Q with the minimum distance to p. Returns a pair
     60         * consisting of this node and the distance.  */
     61        distNodePair distance(const Observation& p,const std::vector<CoverTreeNode*>& Q);
    7262
    7363
    74         void remove_rec(const Observation& p,
    75                                 std::map<int,std::vector<distNodePair> >& coverSets,
    76                                 int level,
    77                                 bool& multi);
     64        void remove_rec(const Observation& p, std::map<int,std::vector<distNodePair> >& coverSets, int level, bool& multi);
    7865
    7966        public:
     
    8976         */
    9077
    91         Covertree(int maxDist,
    92                                 const std::vector<Observation>& points=std::vector<Observation>());
     78        Covertree(int maxDist,const std::vector<Observation>& points=std::vector<Observation>());
    9379        ~Covertree();
    9480
  • issm/trunk-jpl/src/c/classes/kriging/Observations.cpp

    r18919 r19153  
    5959                        _error_("Tree type "<<this->treetype<<" not supported yet (1: quadtree, 2: covertree)");
    6060        }
    61 
    62 
    63 
    6461}
    6562/*}}}*/
     
    131128                if(observations_list[i]<mintrimming) continue;
    132129
    133                 /*First check that this observation is not too close from another one*/
     130                /*Second, check that this observation is not too close from another one*/
    134131                this->quadtree->ClosestObs(&index,x[i],y[i]);
    135132                if(index>=0){
     
    157154void Observations::InitCovertree(IssmPDouble* observations_list,IssmPDouble* x,IssmPDouble* y,int n,Options* options){/*{{{*/
    158155
    159     int maxdepth = 20;
     156        /*Intermediaries*/
     157    int          maxdepth = 20;
     158         IssmPDouble  minspacing,mintrimming,maxtrimming;
     159
     160        /*Checks*/
     161        _assert_(n);
     162
     163        /*Get trimming limits*/
     164        options->Get(&mintrimming,"mintrimming",-1.e+21);
     165        options->Get(&maxtrimming,"maxtrimming",+1.e+21);
     166        options->Get(&minspacing,"minspacing",0.01);
     167        if(minspacing<=0) _error_("minspacing must > 0");
     168
    160169         _printf0_("Generating covertree with a maximum depth " <<  maxdepth <<"... ");
    161170    this->covertree=new Covertree(maxdepth);
    162171
    163172    for(int i=0;i<n;i++){
    164                  this->covertree->insert(Observation(x[i],y[i],observations_list[i]));
     173
     174                /*First check limits*/
     175                if(observations_list[i]>maxtrimming) continue;
     176                if(observations_list[i]<mintrimming) continue;
     177
     178                /*Second, check that this observation is not too close from another one*/
     179                Observation newobs = Observation(x[i],y[i],observations_list[i]);
     180                if(i>0 && this->covertree->getRoot()){
     181                        /*Get closest obs and see if it is too close*/
     182                        std::vector<Observation> kNN=(this->covertree->kNearestNeighbors(newobs,1));
     183                        Observation oldobs = (*kNN.begin());
     184                        if(oldobs.distance(newobs)<minspacing) continue;
     185                }
     186
     187                this->covertree->insert(newobs);
    165188    }
    166189         _printf0_("done\n");
     
    170193/*Methods*/
    171194void Observations::ClosestObservation(IssmPDouble *px,IssmPDouble *py,IssmPDouble *pobs,IssmPDouble x_interp,IssmPDouble y_interp,IssmPDouble radius){/*{{{*/
     195
     196        switch(this->treetype){
     197                case 1:
     198                        this->ClosestObservationQuadtree(px,py,pobs,x_interp,y_interp,radius);
     199                        break;
     200                case 2:
     201                        this->ClosestObservationCovertree(px,py,pobs,x_interp,y_interp,radius);
     202                        break;
     203                default:
     204                        _error_("Tree type "<<this->treetype<<" not supported yet (1: quadtree, 2: covertree)");
     205        }
     206
     207}/*}}}*/
     208void Observations::ClosestObservationQuadtree(IssmPDouble *px,IssmPDouble *py,IssmPDouble *pobs,IssmPDouble x_interp,IssmPDouble y_interp,IssmPDouble radius){/*{{{*/
    172209
    173210        /*Output and Intermediaries*/
     
    220257
    221258}/*}}}*/
     259void Observations::ClosestObservationCovertree(IssmPDouble *px,IssmPDouble *py,IssmPDouble *pobs,IssmPDouble x_interp,IssmPDouble y_interp,IssmPDouble radius){/*{{{*/
     260
     261        IssmPDouble hmin  = UNDEF;
     262
     263        if(this->covertree->getRoot()){
     264                /*Get closest obs and see if it is too close*/
     265                Observation newobs = Observation(x_interp,y_interp,0.);
     266                std::vector<Observation> kNN=(this->covertree->kNearestNeighbors(newobs,1));
     267                Observation observation = (*kNN.begin());
     268                hmin = observation.distance(newobs);
     269                if(hmin<=radius){
     270                        *px   = observation.x;
     271                        *py   = observation.y;
     272                        *pobs = observation.value;
     273                        return;
     274                }
     275        }
     276
     277        *px   = UNDEF;
     278        *py   = UNDEF;
     279        *pobs = UNDEF;
     280}/*}}}*/
    222281void Observations::Distances(IssmPDouble* distances,IssmPDouble *x,IssmPDouble *y,int n,IssmPDouble radius){/*{{{*/
    223282
     
    234293        }
    235294}/*}}}*/
     295void Observations::ObservationList(IssmPDouble **px,IssmPDouble **py,IssmPDouble **pobs,int* pnobs){/*{{{*/
     296
     297        /*Output and Intermediaries*/
     298        int          nobs;
     299        IssmPDouble *x            = NULL;
     300        IssmPDouble *y            = NULL;
     301        IssmPDouble *obs          = NULL;
     302        Observation *observation  = NULL;
     303
     304        nobs = this->Size();
     305
     306        if(nobs){
     307                x   = xNew<IssmPDouble>(nobs);
     308                y   = xNew<IssmPDouble>(nobs);
     309                obs = xNew<IssmPDouble>(nobs);
     310                for(int i=0;i<this->Size();i++){
     311                        observation=xDynamicCast<Observation*>(this->GetObjectByOffset(i));
     312                        observation->WriteXYObs(&x[i],&y[i],&obs[i]);
     313                }
     314        }
     315
     316        /*Assign output pointer*/
     317        *px=x;
     318        *py=y;
     319        *pobs=obs;
     320        *pnobs=nobs;
     321}/*}}}*/
    236322void Observations::ObservationList(IssmPDouble **px,IssmPDouble **py,IssmPDouble **pobs,int* pnobs,IssmPDouble x_interp,IssmPDouble y_interp,IssmPDouble radius,int maxdata){/*{{{*/
    237323
    238         if(this->treetype==2){
    239                 this->ObservationList2(px,py,pobs,pnobs,x_interp,y_interp,radius,maxdata);
    240                 return;
    241         }
     324        switch(this->treetype){
     325                case 1:
     326                        this->ObservationListQuadtree(px,py,pobs,pnobs,x_interp,y_interp,radius,maxdata);
     327                        break;
     328                case 2:
     329                        this->ObservationListCovertree(px,py,pobs,pnobs,x_interp,y_interp,radius,maxdata);
     330                        break;
     331                default:
     332                        _error_("Tree type "<<this->treetype<<" not supported yet (1: quadtree, 2: covertree)");
     333        }
     334}/*}}}*/
     335void Observations::ObservationListQuadtree(IssmPDouble **px,IssmPDouble **py,IssmPDouble **pobs,int* pnobs,IssmPDouble x_interp,IssmPDouble y_interp,IssmPDouble radius,int maxdata){/*{{{*/
    242336
    243337        /*Output and Intermediaries*/
     
    321415        *pnobs=nobs;
    322416}/*}}}*/
    323 void Observations::ObservationList(IssmPDouble **px,IssmPDouble **py,IssmPDouble **pobs,int* pnobs){/*{{{*/
    324 
    325         /*Output and Intermediaries*/
    326         int          nobs;
    327         IssmPDouble *x            = NULL;
    328         IssmPDouble *y            = NULL;
    329         IssmPDouble *obs          = NULL;
    330         Observation *observation  = NULL;
    331 
    332         nobs = this->Size();
    333 
    334         if(nobs){
    335                 x   = xNew<IssmPDouble>(nobs);
    336                 y   = xNew<IssmPDouble>(nobs);
    337                 obs = xNew<IssmPDouble>(nobs);
    338                 for(int i=0;i<this->Size();i++){
    339                         observation=xDynamicCast<Observation*>(this->GetObjectByOffset(i));
    340                         observation->WriteXYObs(&x[i],&y[i],&obs[i]);
    341                 }
    342         }
    343 
    344         /*Assign output pointer*/
     417void Observations::ObservationListCovertree(double **px,double **py,double **pobs,int* pnobs,double x_interp,double y_interp,double radius,int maxdata){/*{{{*/
     418
     419        double *x            = NULL;
     420        double *y            = NULL;
     421        double *obs          = NULL;
     422        Observation observation=Observation(x_interp,y_interp,0.);
     423        std::vector<Observation> kNN;
     424
     425        kNN=(this->covertree->kNearestNeighbors(observation, maxdata));
     426        //cout << "kNN's size: " << kNN.size() << " (maxdata = " <<maxdata<<")"<<endl;
     427
     428        //kNN is sort from closest to farthest neighbor
     429        //searches for the first neighbor that is out of radius
     430        //deletes and resizes the kNN vector
     431        vector<Observation>::iterator it;
     432        if(radius>0.){
     433                for (it = kNN.begin(); it != kNN.end(); ++it) {
     434                        //(*it).print();
     435                        //cout << "\n" << (*it).distance(observation) << endl;
     436                        if ((*it).distance(observation) > radius) {
     437                                break;
     438                        }
     439                }
     440                kNN.erase(it, kNN.end());
     441        }
     442
     443        /*Allocate vectors*/
     444        x   = new double[kNN.size()];
     445        y   = new double[kNN.size()];
     446        obs = new double[kNN.size()];
     447
     448        /*Loop over all observations and fill in x, y and obs*/
     449        int i = 0;
     450        for(it = kNN.begin(); it != kNN.end(); ++it) {
     451                (*it).WriteXYObs((*it), &x[i], &y[i], &obs[i]);
     452                i++;
     453        }
     454
    345455        *px=x;
    346456        *py=y;
    347457        *pobs=obs;
    348         *pnobs=nobs;
     458        *pnobs = kNN.size();
    349459}/*}}}*/
    350460void Observations::InterpolationIDW(IssmPDouble *pprediction,IssmPDouble x_interp,IssmPDouble y_interp,IssmPDouble radius,int mindata,int maxdata,IssmPDouble power){/*{{{*/
     
    362472        _assert_(pprediction);
    363473        _assert_(power>0);
    364 
    365         /*If radius is not provided or is 0, return all observations*/
    366         if(radius==0) radius=this->quadtree->root->length;
    367474
    368475        /*Get list of observations for current point*/
     
    410517        _assert_(pprediction && perror);
    411518
    412         /*If radius is not provided or is 0, return all observations*/
    413         if(radius==0) radius=this->quadtree->root->length;
    414 
    415519        /*Get list of observations for current point*/
    416520        this->ObservationList(&x,&y,&obs,&n_obs,x_interp,y_interp,radius,maxdata);
     
    470574        xDelete<IssmPDouble>(B);
    471575        xDelete<IssmPDouble>(Lambda);
    472 
    473576}/*}}}*/
    474577void Observations::InterpolationNearestNeighbor(IssmPDouble *pprediction,IssmPDouble x_interp,IssmPDouble y_interp,IssmPDouble radius){/*{{{*/
     
    617720}/*}}}*/
    618721
    619 void Observations::ObservationList2(double **px,double **py,double **pobs,int* pnobs,double x_interp,double y_interp,double radius,int maxdata){/*{{{*/
    620    
    621 
    622     double *x            = NULL;
    623     double *y            = NULL;
    624     double *obs          = NULL;
    625     Observation observation=Observation(x_interp,y_interp,0.);
    626     std::vector<Observation> kNN;
    627 
    628          kNN=(this->covertree->kNearestNeighbors(observation, maxdata));
    629          //cout << "kNN's size: " << kNN.size() << " (maxdata = " <<maxdata<<")"<<endl;
    630        
    631         //kNN is sort from closest to farthest neighbor
    632         //searches for the first neighbor that is out of radius
    633         //deletes and resizes the kNN vector
    634         vector<Observation>::iterator it;
    635         if(radius>0.){
    636                 for (it = kNN.begin(); it != kNN.end(); ++it) {
    637                         //(*it).print();
    638                         //cout << "\n" << (*it).distance(observation) << endl;
    639                         if ((*it).distance(observation) > radius) {
    640                                 break;
    641                         }
    642                 }
    643                 kNN.erase(it, kNN.end());
    644         }
    645    
    646         /*Allocate vectors*/
    647         x   = new double[kNN.size()];
    648         y   = new double[kNN.size()];
    649         obs = new double[kNN.size()];
    650 
    651         /*Loop over all observations and fill in x, y and obs*/
    652         int i = 0;
    653         for(it = kNN.begin(); it != kNN.end(); ++it) {
    654                 (*it).WriteXYObs((*it), &x[i], &y[i], &obs[i]);
    655                 i++;
    656         }
    657    
    658     *px=x;
    659     *py=y;
    660     *pobs=obs;
    661          *pnobs = kNN.size();
    662 }/*}}}*/
  • issm/trunk-jpl/src/c/classes/kriging/Observations.h

    r18912 r19153  
    3434                /*Methods*/
    3535                void ClosestObservation(IssmDouble *px,IssmDouble *py,IssmDouble *pobs,IssmDouble x_interp,IssmDouble y_interp,IssmDouble radius);
     36                void ClosestObservationQuadtree(IssmDouble *px,IssmDouble *py,IssmDouble *pobs,IssmDouble x_interp,IssmDouble y_interp,IssmDouble radius);
     37                void ClosestObservationCovertree(IssmDouble *px,IssmDouble *py,IssmDouble *pobs,IssmDouble x_interp,IssmDouble y_interp,IssmDouble radius);
    3638                void Distances(IssmPDouble* distances,IssmPDouble *x,IssmPDouble *y,int n,IssmPDouble radius);
    3739                void InterpolationIDW(IssmDouble *pprediction,IssmDouble x_interp,IssmDouble y_interp,IssmDouble radius,int mindata,int maxdata,IssmDouble power);
     
    4143                void ObservationList(IssmDouble **px,IssmDouble **py,IssmDouble **pobs,int* pnobs);
    4244                void ObservationList(IssmDouble **px,IssmDouble **py,IssmDouble **pobs,int* pnobs,IssmDouble x_interp,IssmDouble y_interp,IssmDouble radius,int maxdata);
    43                 void ObservationList2(IssmDouble **px,IssmDouble **py,IssmDouble **pobs,int* pnobs,IssmDouble x_interp,IssmDouble y_interp,IssmDouble radius,int maxdata);
     45                void ObservationListQuadtree(IssmDouble **px,IssmDouble **py,IssmDouble **pobs,int* pnobs,IssmDouble x_interp,IssmDouble y_interp,IssmDouble radius,int maxdata);
     46                void ObservationListCovertree(IssmDouble **px,IssmDouble **py,IssmDouble **pobs,int* pnobs,IssmDouble x_interp,IssmDouble y_interp,IssmDouble radius,int maxdata);
    4447                void QuadtreeColoring(IssmDouble* A,IssmDouble *x,IssmDouble *y,int n);
    4548                void Variomap(IssmDouble* gamma,IssmDouble *x,int n);
Note: See TracChangeset for help on using the changeset viewer.