Skip to content

Commit 8041e0d

Browse files
committed
removed unused func nmToScalar
1 parent f1a92de commit 8041e0d

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

src/utils/mknix.cc

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,6 @@ void check_arg_type(const mxArray *arr, nix::DataType dtype) {
2020
}
2121
}
2222

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-
3323
// extractors
3424

3525
nix::NDSize mx_to_ndsize(const mxArray *arr) {
@@ -189,14 +179,12 @@ std::vector<nix::Value> mx_to_values(const mxArray *arr) {
189179
if (mxGetClassID(cell_element_ptr) == mxSTRUCT_CLASS) {
190180
// assume values are given as matlab structs
191181
vals.push_back(mx_to_value_from_struct(cell_element_ptr));
192-
}
193-
else {
182+
} else {
194183
// assume just a scalar value given
195184
vals.push_back(mx_to_value_from_scalar(cell_element_ptr));
196185
}
197186
}
198-
}
199-
else {
187+
} else {
200188
throw std::invalid_argument("Values must be given as cell array");
201189
}
202190

src/utils/mknix.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
void check_arg_type(const mxArray *arr, nix::DataType dtype);
99

10-
mxArray *nmCreateScalar(uint32_t val);
11-
1210
nix::NDSize mx_to_ndsize(const mxArray *arr);
1311

1412
std::vector<std::string> mx_to_strings(const mxArray *arr);

0 commit comments

Comments
 (0)