summaryrefslogtreecommitdiffstats
path: root/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/MEX/range2.c
diff options
context:
space:
mode:
authorleochanj105 <leochanj@live.unc.edu>2020-10-20 03:47:33 -0400
committerleochanj105 <leochanj@live.unc.edu>2020-10-20 03:47:33 -0400
commita32f220f06cc463e5b56e7fa0b1b1334d94d08f3 (patch)
tree4af4caa60074465d85fc2ef5cc1b23e74c064329 /SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/MEX/range2.c
parent79f30887129145e15e5172e36a7d7602859fc932 (diff)
matlab removed
Diffstat (limited to 'SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/MEX/range2.c')
-rwxr-xr-xSD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/MEX/range2.c56
1 files changed, 0 insertions, 56 deletions
diff --git a/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/MEX/range2.c b/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/MEX/range2.c
deleted file mode 100755
index b84f4e1..0000000
--- a/SD-VBS/benchmarks/texture_synthesis/src/matlabPyrTools/MEX/range2.c
+++ /dev/null
@@ -1,56 +0,0 @@
1/*
2[MIN, MAX] = range2(MTX)
3 >>> See range2.m for documentation <<<
4 EPS, 3/97.
5*/
6
7#define V4_COMPAT
8#include <matrix.h> /* Matlab matrices */
9#include <mex.h>
10
11#include <stddef.h> /* NULL */
12
13#define notDblMtx(it) (!mxIsNumeric(it) || !mxIsDouble(it) || mxIsSparse(it) || mxIsComplex(it))
14
15void mexFunction(int nlhs, /* Num return vals on lhs */
16 mxArray *plhs[], /* Matrices on lhs */
17 int nrhs, /* Num args on rhs */
18 const mxArray *prhs[] /* Matrices on rhs */
19 )
20 {
21 register double temp, mn, mx;
22 register double *mtx;
23 register int i, size;
24 mxArray *arg;
25
26 if (nrhs != 1) mexErrMsgTxt("requires 1 argument.");
27
28 /* ARG 1: MATRIX */
29 arg = prhs[0];
30 if notDblMtx(arg) mexErrMsgTxt("MTX arg must be a real non-sparse matrix.");
31 mtx = mxGetPr(arg);
32 size = (int) mxGetM(arg) * mxGetN(arg);
33
34 /* FIND min, max values of MTX */
35 mn = *mtx; mx = *mtx;
36 for (i=1; i<size; i++)
37 {
38 temp = mtx[i];
39 if (temp < mn)
40 mn = temp;
41 else if (temp > mx)
42 mx = temp;
43 }
44
45 plhs[0] = (mxArray *) mxCreateDoubleMatrix(1,1,mxREAL);
46 if (plhs[0] == NULL) mexErrMsgTxt("Error allocating result matrix");
47 plhs[1] = (mxArray *) mxCreateDoubleMatrix(1,1,mxREAL);
48 if (plhs[1] == NULL) mexErrMsgTxt("Error allocating result matrix");
49 mtx = mxGetPr(plhs[0]);
50 mtx[0] = mn;
51 mtx = mxGetPr(plhs[1]);
52 mtx[0] = mx;
53
54 return;
55 }
56