2009-06-11 07:33:50 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <math.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <assert.h>
|
|
|
|
|
#include <mex.h>
|
|
|
|
|
|
2009-06-12 15:42:32 +00:00
|
|
|
#include "preprocess.h"
|
2009-06-11 07:33:50 +00:00
|
|
|
#include "mxgrdecl.h"
|
2009-06-11 23:35:19 +00:00
|
|
|
|
2009-06-11 07:33:50 +00:00
|
|
|
/* Gateway routine for Matlab mex function. */
|
|
|
|
|
/*-------------------------------------------------------*/
|
|
|
|
|
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
|
|
|
|
|
{
|
|
|
|
|
/* Set up data passed from Matlab */
|
2009-06-12 13:10:31 +00:00
|
|
|
struct grdecl g;
|
2009-06-12 12:40:38 +00:00
|
|
|
struct processed_grid out;
|
|
|
|
|
|
2009-06-11 07:33:50 +00:00
|
|
|
mxInitGrdecl(&g, prhs);
|
2009-06-12 12:40:38 +00:00
|
|
|
processGrdecl(&g, 0.0, &out);
|
|
|
|
|
|
|
|
|
|
|
2009-06-12 13:10:31 +00:00
|
|
|
if (plhs == 0){
|
|
|
|
|
;/* write to matlab struct */
|
|
|
|
|
}
|
|
|
|
|
|
2009-06-12 12:40:38 +00:00
|
|
|
/* Free whatever was allocated in initGrdecl. */
|
|
|
|
|
freeGrdecl(&g);
|
|
|
|
|
free_processed_grid(&out);
|
|
|
|
|
}
|