File tree Expand file tree Collapse file tree 2 files changed +2
-16
lines changed Expand file tree Collapse file tree 2 files changed +2
-16
lines changed Original file line number Diff line number Diff line change @@ -20,16 +20,6 @@ void check_arg_type(const mxArray *arr, nix::DataType dtype) {
20
20
}
21
21
}
22
22
23
-
24
-
25
- // TODO move this to mkarray
26
- mxArray *nmCreateScalar (uint32_t val) {
27
- mxArray *arr = mxCreateNumericMatrix (1 , 1 , mxUINT32_CLASS, mxREAL);
28
- void *data = mxGetData (arr);
29
- memcpy (data, &val, sizeof (uint32_t ));
30
- return arr;
31
- }
32
-
33
23
// extractors
34
24
35
25
nix::NDSize mx_to_ndsize (const mxArray *arr) {
@@ -189,14 +179,12 @@ std::vector<nix::Value> mx_to_values(const mxArray *arr) {
189
179
if (mxGetClassID (cell_element_ptr) == mxSTRUCT_CLASS) {
190
180
// assume values are given as matlab structs
191
181
vals.push_back (mx_to_value_from_struct (cell_element_ptr));
192
- }
193
- else {
182
+ } else {
194
183
// assume just a scalar value given
195
184
vals.push_back (mx_to_value_from_scalar (cell_element_ptr));
196
185
}
197
186
}
198
- }
199
- else {
187
+ } else {
200
188
throw std::invalid_argument (" Values must be given as cell array" );
201
189
}
202
190
Original file line number Diff line number Diff line change 7
7
8
8
void check_arg_type (const mxArray *arr, nix::DataType dtype);
9
9
10
- mxArray *nmCreateScalar (uint32_t val);
11
-
12
10
nix::NDSize mx_to_ndsize (const mxArray *arr);
13
11
14
12
std::vector<std::string> mx_to_strings (const mxArray *arr);
You can’t perform that action at this time.
0 commit comments