Skip to content

Commit 376cb97

Browse files
committed
debug remove
1 parent ad54241 commit 376cb97

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

src/nixdataarray.cc

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,29 @@ namespace nixdataarray {
4343
void read_all(const extractor &input, infusor &output)
4444
{
4545
//nix::DataArray da = input.entity<nix::DataArray>(1);
46-
46+
mexPrintf("[PURGE_ME] DA.cc read_all 01\n");
4747
nix::DataArray da = input.entity<nix::DataArray>(1);
48+
mexPrintf("[PURGE_ME] DA.cc read_all 02\n");
4849
mxArray *data = make_mx_array_from_ds(da);
50+
mexPrintf("[PURGE_ME] DA.cc read_all 03\n");
4951
output.set(0, data);
5052
}
5153

5254
void write_all(const extractor &input, infusor &output)
5355
{
56+
mexPrintf("[PURGE_ME] DA.cc write_all 01\n");
5457
nix::DataArray da = input.entity<nix::DataArray>(1);
55-
58+
mexPrintf("[PURGE_ME] DA.cc write_all 02\n");
5659
nix::DataType dtype = input.dtype(2);
60+
mexPrintf("[PURGE_ME] DA.cc write_all 03\n");
5761
nix::NDSize count = input.ndsize(2);
62+
mexPrintf("[PURGE_ME] DA.cc write_all 04\n");
5863
nix::NDSize offset(0);
64+
mexPrintf("[PURGE_ME] DA.cc write_all 05\n");
5965
double *ptr = input.get_raw(2);
60-
66+
mexPrintf("[PURGE_ME] DA.cc write_all 06\n");
6167
da.setData(dtype, ptr, count, offset);
68+
mexPrintf("[PURGE_ME] DA.cc write_all 07\n");
6269
}
6370

6471
void delete_dimension(const extractor &input, infusor &output) {

src/utils/mkarray.cc

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@
33
#include <nix.hpp>
44

55
mxArray* make_mx_array_from_ds(const nix::DataSet &da) {
6+
mexPrintf("[PURGE_ME] mkArray.cc 01\n");
67
nix::NDSize size = da.dataExtent();
8+
mexPrintf("[PURGE_ME] mkArray.cc 02\n");
79
const size_t len = size.size();
10+
mexPrintf("[PURGE_ME] mkArray.cc 03\n");
811
std::vector<mwSize> dims(len);
12+
mexPrintf("[PURGE_ME] mkArray.cc 03\n");
913

1014
//NB: matlab is column-major, while HDF5 is row-major
1115
// data is correct with this, but dimensions don't
@@ -14,19 +18,26 @@ mxArray* make_mx_array_from_ds(const nix::DataSet &da) {
1418
for (size_t i = 0; i < len; i++) {
1519
dims[len - (i + 1)] = static_cast<mwSize>(size[i]);
1620
}
17-
21+
mexPrintf("[PURGE_ME] mkArray.cc 04\n");
1822
nix::DataType da_type = da.dataType();
23+
mexPrintf("[PURGE_ME] mkArray.cc 05\n");
1924
DType2 dtype = dtype_nix2mex(da_type);
25+
mexPrintf("[PURGE_ME] mkArray.cc 06\n");
2026

2127
if (!dtype.is_valid) {
28+
mexPrintf("[PURGE_ME] mkArray.cc 07\n");
2229
throw std::domain_error("Unsupported data type");
2330
}
2431

32+
mexPrintf("[PURGE_ME] mkArray.cc 08\n");
2533
mxArray *data = mxCreateNumericArray(dims.size(), dims.data(), dtype.cid, dtype.clx);
34+
mexPrintf("[PURGE_ME] mkArray.cc 09\n");
2635
double *ptr = mxGetPr(data);
27-
36+
mexPrintf("[PURGE_ME] mkArray.cc 10\n");
2837
nix::NDSize offset(size.size(), 0);
38+
mexPrintf("[PURGE_ME] mkArray.cc 11\n");
2939
da.getData(da_type, ptr, size, offset);
40+
mexPrintf("[PURGE_ME] mkArray.cc 12\n");
3041

3142
return data;
3243
}

0 commit comments

Comments
 (0)