summaryrefslogtreecommitdiffstats
path: root/SD-VBS/benchmarks/sift/src/matlab/mexutils.c
diff options
context:
space:
mode:
authorleochanj <jbakita@cs.unc.edu>2020-10-21 01:52:54 -0400
committerleochanj <jbakita@cs.unc.edu>2020-10-21 01:52:54 -0400
commit25d94aa8aabb8ac3e8bbea0bc439ea6148444cc8 (patch)
treeba80e76d25d9ca9486092e2f6b6d76f0e3352bf7 /SD-VBS/benchmarks/sift/src/matlab/mexutils.c
parente2b50015cebdfba68699abd6e8575e38230f5a78 (diff)
debug libextra and remove matlab
Diffstat (limited to 'SD-VBS/benchmarks/sift/src/matlab/mexutils.c')
-rw-r--r--SD-VBS/benchmarks/sift/src/matlab/mexutils.c98
1 files changed, 0 insertions, 98 deletions
diff --git a/SD-VBS/benchmarks/sift/src/matlab/mexutils.c b/SD-VBS/benchmarks/sift/src/matlab/mexutils.c
deleted file mode 100644
index 45843cf..0000000
--- a/SD-VBS/benchmarks/sift/src/matlab/mexutils.c
+++ /dev/null
@@ -1,98 +0,0 @@
1/* file: mexutils.c
2** author: Andrea Vedaldi
3** description: Utility functions to write MEX files.
4**/
5
6#include"mex.h"
7#include<math.h>
8
9#undef M_PI
10#define M_PI 3.14159265358979
11
12/** @biref Is real scalar?
13 **
14 ** @return @c true if the array @a A is a real scalar.
15 **/
16int
17uIsRealScalar(const mxArray* A)
18{
19 return
20 mxIsDouble(A) &&
21 !mxIsComplex(A) &&
22 mxGetNumberOfDimensions(A) == 2 &&
23 mxGetM(A) == 1 &&
24 mxGetN(A) == 1 ;
25}
26
27/** @brief Is real matrix?
28 **
29 ** The function checks wether the argument @a A is a real matrix. In
30 ** addition, if @a M >= 0, it checks wether the number of rows is
31 ** equal to @a M and, if @a N >= 0, if the number of columns is equal
32 ** to @a N.
33 **
34 ** @param M number of rows.
35 ** @param N number of columns.
36 ** @return @c true if the array is a real matrix with the specified format.
37 **/
38int
39uIsRealMatrix(const mxArray* A, int M, int N)
40{
41 return
42 mxIsDouble(A) &&
43 !mxIsComplex(A) &&
44 mxGetNumberOfDimensions(A) == 2 &&
45 ((M>=0)?(mxGetM(A) == M):1) &&
46 ((N>=0)?(mxGetN(A) == N):1) ;
47}
48
49/** @brief Is real vector?
50 **
51 ** The function checks wether the argument @a V is a real vector. By
52 ** definiton, a matrix is a vector if one of its dimension is one.
53 ** In addition, if @a D >= 0, it checks wether the dimension of the
54 ** vecotr is equal to @a D.
55 **
56 ** @param D lenght of the vector.
57 ** @return @c true if the array is a real vector of the specified dimension.
58 **/
59int
60uIsRealVector(const mxArray* V, int D)
61{
62 int M = mxGetM(V) ;
63 int N = mxGetN(V) ;
64 int is_vector = (N == 1) || (M == 1) ;
65
66 return
67 mxIsDouble(V) &&
68 !mxIsComplex(V) &&
69 mxGetNumberOfDimensions(V) == 2 &&
70 is_vector &&
71 ( D < 0 || N == D || M == D) ;
72}
73
74
75/** @brief Is a string?
76 **
77 ** The function checks wether the array @a S is a string. If
78 ** @a L is non-negative, it also check wether the strign has
79 ** length @a L.
80 **
81 ** @return @a c true if S is a string of the specified length.
82 **/
83int
84uIsString(const mxArray* S, int L)
85{
86 int M = mxGetM(S) ;
87 int N = mxGetN(S) ;
88
89 return
90 mxIsChar(S) &&
91 M == 1 &&
92 (L < 0 || N == L) ;
93}
94
95/**
96 **
97 **/
98