-
Notifications
You must be signed in to change notification settings - Fork 0
/
julia_spline_emxAPI.c
124 lines (116 loc) · 2.84 KB
/
julia_spline_emxAPI.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/*
* File: julia_spline_emxAPI.c
*
* MATLAB Coder version : 5.4
* C/C++ source code generated on : 17-May-2022 16:48:18
*/
/* Include Files */
#include "julia_spline_emxAPI.h"
#include "julia_spline_emxutil.h"
#include "julia_spline_types.h"
#include "rt_nonfinite.h"
#include <stdlib.h>
/* Function Definitions */
/*
* Arguments : int numDimensions
* const int *size
* Return Type : emxArray_real_T *
*/
emxArray_real_T *emxCreateND_real_T(int numDimensions, const int *size)
{
emxArray_real_T *emx;
int i;
int numEl;
emxInit_real_T(&emx, numDimensions);
numEl = 1;
for (i = 0; i < numDimensions; i++) {
numEl *= size[i];
emx->size[i] = size[i];
}
emx->data = (double *)calloc((unsigned int)numEl, sizeof(double));
emx->numDimensions = numDimensions;
emx->allocatedSize = numEl;
return emx;
}
/*
* Arguments : double *data
* int numDimensions
* const int *size
* Return Type : emxArray_real_T *
*/
emxArray_real_T *emxCreateWrapperND_real_T(double *data, int numDimensions,
const int *size)
{
emxArray_real_T *emx;
int i;
int numEl;
emxInit_real_T(&emx, numDimensions);
numEl = 1;
for (i = 0; i < numDimensions; i++) {
numEl *= size[i];
emx->size[i] = size[i];
}
emx->data = data;
emx->numDimensions = numDimensions;
emx->allocatedSize = numEl;
emx->canFreeData = false;
return emx;
}
/*
* Arguments : double *data
* int rows
* int cols
* Return Type : emxArray_real_T *
*/
emxArray_real_T *emxCreateWrapper_real_T(double *data, int rows, int cols)
{
emxArray_real_T *emx;
emxInit_real_T(&emx, 2);
emx->size[0] = rows;
emx->size[1] = cols;
emx->data = data;
emx->numDimensions = 2;
emx->allocatedSize = rows * cols;
emx->canFreeData = false;
return emx;
}
/*
* Arguments : int rows
* int cols
* Return Type : emxArray_real_T *
*/
emxArray_real_T *emxCreate_real_T(int rows, int cols)
{
emxArray_real_T *emx;
int numEl;
emxInit_real_T(&emx, 2);
emx->size[0] = rows;
numEl = rows * cols;
emx->size[1] = cols;
emx->data = (double *)calloc((unsigned int)numEl, sizeof(double));
emx->numDimensions = 2;
emx->allocatedSize = numEl;
return emx;
}
/*
* Arguments : emxArray_real_T *emxArray
* Return Type : void
*/
void emxDestroyArray_real_T(emxArray_real_T *emxArray)
{
emxFree_real_T(&emxArray);
}
/*
* Arguments : emxArray_real_T **pEmxArray
* int numDimensions
* Return Type : void
*/
void emxInitArray_real_T(emxArray_real_T **pEmxArray, int numDimensions)
{
emxInit_real_T(pEmxArray, numDimensions);
}
/*
* File trailer for julia_spline_emxAPI.c
*
* [EOF]
*/