source:
issm/oecreview/Archive/12161-12180/ISSM-12163-12164.diff
Last change on this file was 12325, checked in by , 13 years ago | |
---|---|
File size: 6.5 KB |
-
proj/ice/larour/issm-uci-clean/trunk-jpl/src/c/modules/modules.h
61 61 #include "./Ll2xyx/Ll2xyx.h" 62 62 #include "./Exp2Kmlx/Exp2Kmlx.h" 63 63 #include "./Kml2Expx/Kml2Expx.h" 64 #include "./Krigingx/Krigingx.h" 64 65 #include "./Shp2Kmlx/Shp2Kmlx.h" 65 66 #include "./MassFluxx/MassFluxx.h" 66 67 #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 12 int 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 12 int 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
819 819 ./modules/InterpFromMeshToGridx/InterpFromMeshToGridx.h\ 820 820 ./modules/HoleFillerx/HoleFillerx.cpp\ 821 821 ./modules/HoleFillerx/HoleFillerx.h\ 822 ./modules/Krigingx/Krigingx.cpp\ 823 ./modules/Krigingx/Krigingx.h\ 822 824 ./modules/AverageFilterx/AverageFilterx.cpp\ 823 825 ./modules/AverageFilterx/AverageFilterx.h\ 824 826 ./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: */ 9 void 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 6 void 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 48 void 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
23 23 KMLMeshWrite \ 24 24 KMLOverlay \ 25 25 Kml2Exp \ 26 Kriging \ 26 27 Ll2xy \ 27 28 NodeConnectivity \ 28 29 MeshPartition\ … … 127 128 Kml2Exp_SOURCES = ../Kml2Exp/Kml2Exp.cpp\ 128 129 ../Kml2Exp/Kml2Exp.h 129 130 131 Kriging_SOURCES = ../Kriging/Kriging.cpp\ 132 ../Kriging/Kriging.h 133 130 134 MeshPartition_SOURCES = ../MeshPartition/MeshPartition.cpp\ 131 135 ../MeshPartition/MeshPartition.h 132 136
Note:
See TracBrowser
for help on using the repository browser.