Changeset 12251


Ignore:
Timestamp:
05/16/12 11:03:19 (13 years ago)
Author:
Mathieu Morlighem
Message:

Added Error calculation

Location:
issm/trunk-jpl/src/modules/Kriging
Files:
2 edited

Legend:

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

    r12219 r12251  
    1313        double  *y_interp     = NULL;
    1414        double  *predictions  = NULL;
     15        double  *error        = NULL;
    1516        Options *options      = NULL;
    1617        int      N_interp,M_interp,M,N,n_obs;
     
    2021
    2122        /*checks on arguments on the matlab side: */
    22         if (nrhs<NRHS || nlhs!=NLHS){
     23        if (nrhs<NRHS || nlhs>NLHS){
    2324                KrigingUsage(); _error_("Kriging usage error");
    2425        }
     
    3334
    3435        /*Call x layer*/
    35         Krigingx(&predictions,x,y,observations,n_obs,x_interp,y_interp,M_interp*N_interp,options);
     36        Krigingx(&predictions,&error,x,y,observations,n_obs,x_interp,y_interp,M_interp*N_interp,options);
    3637
    3738        /*Generate output Matlab Structures*/
    38         WriteData(PREDICTIONS,predictions,M_interp,N_interp);
     39        if(nlhs>=1) WriteData(PREDICTIONS,predictions,M_interp,N_interp);
     40        if(nlhs==2) WriteData(ERROR,error,M_interp,N_interp);
    3941
    4042        /*Free ressources: */
     
    4547        xfree((void**)&y_interp);
    4648        xfree((void**)&predictions);
     49        xfree((void**)&error);
    4750
    4851        /*end module: */
  • issm/trunk-jpl/src/modules/Kriging/Kriging.h

    r12164 r12251  
    2626/* serial output macros: */
    2727#define PREDICTIONS (mxArray**)&plhs[0]
     28#define ERROR       (mxArray**)&plhs[1]
    2829
    2930/* serial arg counts: */
    3031#undef NLHS
    31 #define NLHS  1
     32#define NLHS  2
    3233#undef NRHS
    3334#define NRHS  5
Note: See TracChangeset for help on using the changeset viewer.