Changeset 12219


Ignore:
Timestamp:
05/07/12 10:59:20 (13 years ago)
Author:
Mathieu Morlighem
Message:

Added support for matrices

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/modules/Kriging/Kriging.cpp

    r12184 r12219  
    1414        double  *predictions  = NULL;
    1515        Options *options      = NULL;
    16         int      n_interp,n,n_obs;
     16        int      N_interp,M_interp,M,N,n_obs;
    1717
    1818        /*Boot module: */
     
    2626        /*Fetch inputs: */
    2727        FetchData(&x,&n_obs,X);
    28         FetchData(&y,&n,Y);                       if(n_obs!=n) _error_("x and y should have the same size");
    29         FetchData(&observations,&n,OBSERVATIONS); if(n_obs!=n) _error_("x and observations should have the same size");
    30         FetchData(&x_interp,&n_interp,XINTERP);
    31         FetchData(&y_interp,&n,YINTERP);          if(n_interp!=n) _error_("x_interp and y_interp should have the same size");
     28        FetchData(&y,&N,Y);                       if(n_obs!=N) _error_("x and y should have the same size");
     29        FetchData(&observations,&N,OBSERVATIONS); if(n_obs!=N) _error_("x and observations should have the same size");
     30        FetchData(&x_interp,&M_interp,&N_interp,XINTERP);
     31        FetchData(&y_interp,&M,&N,YINTERP);       if(N!=N_interp || M!=M_interp) _error_("x_interp and y_interp should have the same size");
    3232        FetchData(&options,NRHS,nrhs,prhs);
    3333
    3434        /*Call x layer*/
    35         Krigingx(&predictions,x,y,observations,n_obs,x_interp,y_interp,n_interp,options);
     35        Krigingx(&predictions,x,y,observations,n_obs,x_interp,y_interp,M_interp*N_interp,options);
    3636
    3737        /*Generate output Matlab Structures*/
    38         WriteData(PREDICTIONS,predictions,n_interp);
     38        WriteData(PREDICTIONS,predictions,M_interp,N_interp);
    3939
    4040        /*Free ressources: */
Note: See TracChangeset for help on using the changeset viewer.