diff options
author | leochanj105 <leochanj@live.unc.edu> | 2020-10-19 23:09:30 -0400 |
---|---|---|
committer | leochanj105 <leochanj@live.unc.edu> | 2020-10-20 02:40:39 -0400 |
commit | f618466c25d43f3bae9e40920273bf77de1e1149 (patch) | |
tree | 460e739e2165b8a9c37a9c7ab1b60f5874903543 /SD-VBS/benchmarks/texture_synthesis/src/MEX/innerProd_main.c | |
parent | 47ced4e96bbb782b9e780e8f2cfc637b2c21ff44 (diff) |
initial sd-vbs
initial sd-vbs
add sd-vbs
sd-vbs
Diffstat (limited to 'SD-VBS/benchmarks/texture_synthesis/src/MEX/innerProd_main.c')
-rwxr-xr-x | SD-VBS/benchmarks/texture_synthesis/src/MEX/innerProd_main.c | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/SD-VBS/benchmarks/texture_synthesis/src/MEX/innerProd_main.c b/SD-VBS/benchmarks/texture_synthesis/src/MEX/innerProd_main.c new file mode 100755 index 0000000..3c828de --- /dev/null +++ b/SD-VBS/benchmarks/texture_synthesis/src/MEX/innerProd_main.c | |||
@@ -0,0 +1,103 @@ | |||
1 | /* | ||
2 | * MATLAB Compiler: 4.4 (R2006a) | ||
3 | * Date: Thu Jul 24 17:19:07 2008 | ||
4 | * Arguments: "-B" "macro_default" "-m" "-W" "main" "-T" "link:exe" "-d" | ||
5 | * "../MEX" "innerProd.m" | ||
6 | */ | ||
7 | |||
8 | #include <stdio.h> | ||
9 | #include "mclmcr.h" | ||
10 | #ifdef __cplusplus | ||
11 | extern "C" { | ||
12 | #endif | ||
13 | |||
14 | extern mclComponentData __MCC_innerProd_component_data; | ||
15 | |||
16 | #ifdef __cplusplus | ||
17 | } | ||
18 | #endif | ||
19 | |||
20 | static HMCRINSTANCE _mcr_inst = NULL; | ||
21 | |||
22 | |||
23 | static int mclDefaultPrintHandler(const char *s) | ||
24 | { | ||
25 | return fwrite(s, sizeof(char), strlen(s), stdout); | ||
26 | } | ||
27 | |||
28 | static int mclDefaultErrorHandler(const char *s) | ||
29 | { | ||
30 | int written = 0, len = 0; | ||
31 | len = strlen(s); | ||
32 | written = fwrite(s, sizeof(char), len, stderr); | ||
33 | if (len > 0 && s[ len-1 ] != '\n') | ||
34 | written += fwrite("\n", sizeof(char), 1, stderr); | ||
35 | return written; | ||
36 | } | ||
37 | |||
38 | |||
39 | /* This symbol is defined in shared libraries. Define it here | ||
40 | * (to nothing) in case this isn't a shared library. | ||
41 | */ | ||
42 | #ifndef LIB_innerProd_C_API | ||
43 | #define LIB_innerProd_C_API /* No special import/export declaration */ | ||
44 | #endif | ||
45 | |||
46 | LIB_innerProd_C_API | ||
47 | bool MW_CALL_CONV innerProdInitializeWithHandlers( | ||
48 | mclOutputHandlerFcn error_handler, | ||
49 | mclOutputHandlerFcn print_handler | ||
50 | ) | ||
51 | { | ||
52 | if (_mcr_inst != NULL) | ||
53 | return true; | ||
54 | if (!mclmcrInitialize()) | ||
55 | return false; | ||
56 | if (!mclInitializeComponentInstance(&_mcr_inst, | ||
57 | &__MCC_innerProd_component_data, | ||
58 | true, NoObjectType, ExeTarget, | ||
59 | error_handler, print_handler)) | ||
60 | return false; | ||
61 | return true; | ||
62 | } | ||
63 | |||
64 | LIB_innerProd_C_API | ||
65 | bool MW_CALL_CONV innerProdInitialize(void) | ||
66 | { | ||
67 | return innerProdInitializeWithHandlers(mclDefaultErrorHandler, | ||
68 | mclDefaultPrintHandler); | ||
69 | } | ||
70 | |||
71 | LIB_innerProd_C_API | ||
72 | void MW_CALL_CONV innerProdTerminate(void) | ||
73 | { | ||
74 | if (_mcr_inst != NULL) | ||
75 | mclTerminateInstance(&_mcr_inst); | ||
76 | } | ||
77 | |||
78 | int run_main(int argc, const char **argv) | ||
79 | { | ||
80 | int _retval; | ||
81 | /* Generate and populate the path_to_component. */ | ||
82 | char path_to_component[(PATH_MAX*2)+1]; | ||
83 | separatePathName(argv[0], path_to_component, (PATH_MAX*2)+1); | ||
84 | __MCC_innerProd_component_data.path_to_component = path_to_component; | ||
85 | if (!innerProdInitialize()) { | ||
86 | return -1; | ||
87 | } | ||
88 | _retval = mclMain(_mcr_inst, argc, argv, "innerProd", 1); | ||
89 | if (_retval == 0 /* no error */) mclWaitForFiguresToDie(NULL); | ||
90 | innerProdTerminate(); | ||
91 | mclTerminateApplication(); | ||
92 | return _retval; | ||
93 | } | ||
94 | |||
95 | int main(int argc, const char **argv) | ||
96 | { | ||
97 | if (!mclInitializeApplication( | ||
98 | __MCC_innerProd_component_data.runtime_options, | ||
99 | __MCC_innerProd_component_data.runtime_option_count)) | ||
100 | return 0; | ||
101 | |||
102 | return mclRunMain(run_main, argc, argv); | ||
103 | } | ||