Changeset 14250


Ignore:
Timestamp:
01/15/13 11:40:54 (12 years ago)
Author:
Mathieu Morlighem
Message:

CHG: fixed issues when hmin~=0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/Container/Observations.cpp

    r14241 r14250  
    150150                if(i==0){
    151151                        hmin2 = h2;
    152                         index = i;
     152                        index = indices[i];
    153153                }
    154154                else{
    155155                        if(h2<hmin2){
    156156                                hmin2 = h2;
    157                                 index = i;
     157                                index = indices[i];
    158158                        }
    159159                }
     
    161161
    162162        /*Assign output pointer*/
    163         if(!nobs){
     163        if(index>=0){
     164                observation=dynamic_cast<Observation*>(this->GetObjectByOffset(index));
     165                *px=observation->x;
     166                *py=observation->y;
     167                *pobs=observation->value;
     168        }
     169        else{
     170
    164171                *px=UNDEF;
    165172                *py=UNDEF;
    166173                *pobs=UNDEF;
    167         }
    168         else{
    169                 observation=dynamic_cast<Observation*>(this->GetObjectByOffset(indices[index]));
    170                 *px=observation->x;
    171                 *py=observation->y;
    172                 *pobs=observation->value;
    173174        }
    174175        xDelete<int>(indices);
Note: See TracChangeset for help on using the changeset viewer.