source: issm/oecreview/Archive/12161-12180/ISSM-12163-12164.diff

Last change on this file was 12325, checked in by Eric.Larour, 13 years ago

11990 to 12321 oec compliance

File size: 6.5 KB
  • proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/modules/modules.h

     
    6161#include "./Ll2xyx/Ll2xyx.h"
    6262#include "./Exp2Kmlx/Exp2Kmlx.h"
    6363#include "./Kml2Expx/Kml2Expx.h"
     64#include "./Krigingx/Krigingx.h"
    6465#include "./Shp2Kmlx/Shp2Kmlx.h"
    6566#include "./MassFluxx/MassFluxx.h"
    6667#include "./MaxAbsVxx/MaxAbsVxx.h"
  • proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp

     
     1/*!\file:  Kriging.cpp
     2 * \brief  "c" core code for Kriging
     3 */
     4
     5#include "./Krigingx.h"
     6#include "../../shared/shared.h"
     7#include "../../include/include.h"
     8#include "../../toolkits/toolkits.h"
     9#include "../../objects/objects.h"
     10#include "../modules.h"
     11
     12int Krigingx(double** ppredictions,double* x, double* y, double* observations, int n_obs,double* x_interp,double* y_interp,int n_interp){
     13
     14        /*output*/
     15        double *predictions = NULL;
     16
     17        /*Allocate output*/
     18        predictions=(double*)xmalloc(n_interp*sizeof(double));
     19
     20        /*Assign output pointer*/
     21        *ppredictions=predictions;
     22}
  • proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/modules/Krigingx/Krigingx.h

     
     1/*!\file Kriging.h
     2 * \brief: header file for Kriging
     3 */
     4
     5#ifndef _KRIGINGX_H
     6#define _KRIGINGX_H
     7
     8#include "../../objects/objects.h"
     9#include "../../toolkits/toolkits.h"
     10
     11
     12int Krigingx(double** ppredictions,double* x, double* y, double* observations, int n_obs,double* x_interp,double* y_interp,int n_interp);
     13
     14#endif /* _KRIGINGX_H */
     15
  • proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/Makefile.am

     
    819819                        ./modules/InterpFromMeshToGridx/InterpFromMeshToGridx.h\
    820820                        ./modules/HoleFillerx/HoleFillerx.cpp\
    821821                        ./modules/HoleFillerx/HoleFillerx.h\
     822                        ./modules/Krigingx/Krigingx.cpp\
     823                        ./modules/Krigingx/Krigingx.h\
    822824                        ./modules/AverageFilterx/AverageFilterx.cpp\
    823825                        ./modules/AverageFilterx/AverageFilterx.h\
    824826                        ./modules/MeshProfileIntersectionx/MeshProfileIntersectionx.cpp\
  • proj/ice/larour/issm-uci-clean/trunk-jpl/src/modules/Kriging/Kriging.h

     
     1/*
     2        KrigingUsage.h
     3*/
     4
     5#ifndef _KRIGING_H_
     6#define _KRIGING_H_
     7
     8/* local prototypes: */
     9void KrigingUsage(void);
     10
     11#include "../../c/include/globals.h"
     12#include "../../c/modules/modules.h"
     13#include "../../c/shared/shared.h"
     14#include "../../c/issm-binding.h"
     15
     16#undef __FUNCT__
     17#define __FUNCT__  "Kriging"
     18   
     19/* serial input macros: */
     20#define X            (mxArray *)prhs[0]
     21#define Y            (mxArray *)prhs[1]
     22#define OBSERVATIONS (mxArray *)prhs[2]
     23#define XINTERP      (mxArray *)prhs[3]
     24#define YINTERP      (mxArray *)prhs[4]
     25
     26/* serial output macros: */
     27#define PREDICTIONS (mxArray**)&plhs[0]
     28
     29/* serial arg counts: */
     30#undef NLHS
     31#define NLHS  1
     32#undef NRHS
     33#define NRHS  5
     34
     35#endif  /* _KRIGING_H_ */
  • proj/ice/larour/issm-uci-clean/trunk-jpl/src/modules/Kriging/Kriging.cpp

     
     1/*\file Kriging.c
     2 *\brief: best linear predictor
     3 */
     4#include "./Kriging.h"
     5
     6void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
     7
     8        /*Outputs*/
     9        double *x            = NULL;
     10        double *y            = NULL;
     11        double *observations = NULL;
     12        double *x_interp     = NULL;
     13        double *y_interp     = NULL;
     14        double *predictions  = NULL;
     15        int     n_interp,n,n_obs;
     16
     17        /*Boot module: */
     18        MODULEBOOT();
     19
     20        /*checks on arguments on the matlab side: */
     21        CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&KrigingUsage);
     22
     23        /*Fetch inputs: */
     24        FetchData(&x,&n_obs,X);
     25        FetchData(&y,&n,Y);                       if(n_obs!=n) _error_("x and y should have the same size");
     26        FetchData(&observations,&n,OBSERVATIONS); if(n_obs!=n) _error_("x and observations should have the same size");
     27        FetchData(&x_interp,&n_interp,XINTERP);
     28        FetchData(&y_interp,&n,YINTERP);          if(n_interp!=n) _error_("x_interp and y_interp should have the same size");
     29
     30        /*Call x layer*/
     31        Krigingx(&predictions,x,y,observations,n_obs,x_interp,y_interp,n_interp);
     32
     33        /*Generate output Matlab Structures*/
     34        WriteData(PREDICTIONS,predictions,n_interp);
     35
     36        /*Free ressources: */
     37        xfree((void**)&x);
     38        xfree((void**)&y);
     39        xfree((void**)&observations);
     40        xfree((void**)&x_interp);
     41        xfree((void**)&y_interp);
     42        xfree((void**)&predictions);
     43
     44        /*end module: */
     45        MODULEEND();
     46}
     47
     48void KrigingUsage(void){
     49        _printf_(true,"\n");
     50        _printf_(true,"   usage: predictions=%s(x,y,observations,x_interp,y_interp);\n",__FUNCT__);
     51        _printf_(true,"\n");
     52}
  • proj/ice/larour/issm-uci-clean/trunk-jpl/src/modules/matlab/Makefile.am

     
    2323                                KMLMeshWrite \
    2424                                KMLOverlay \
    2525                                Kml2Exp \
     26                                Kriging \
    2627                                Ll2xy \
    2728                                NodeConnectivity \
    2829                                MeshPartition\
     
    127128Kml2Exp_SOURCES = ../Kml2Exp/Kml2Exp.cpp\
    128129                          ../Kml2Exp/Kml2Exp.h
    129130
     131Kriging_SOURCES = ../Kriging/Kriging.cpp\
     132                                                ../Kriging/Kriging.h
     133
    130134MeshPartition_SOURCES = ../MeshPartition/MeshPartition.cpp\
    131135                          ../MeshPartition/MeshPartition.h
    132136
Note: See TracBrowser for help on using the repository browser.