You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For neatness, I suggest two more changes. Maybe not really necessary for now during the hack week, but nice to think about in the future:
The initialize method can return function pointers to the other functions. That way, the only function call you need to know about is the initialization function. These functions pointers can be stored in what is currently the 'purify_domain_data_format' structure, but maybe rename it. So, Purify would do something like this:
wsclean_initialize(&userdata, &dinfo, &formatinfo);
read_function=formatinfo.read_function
deinitialize_function=formatinfo.deinitializate_function
...
(_read_function) (userdata, parameters)
...
(_deinitialize_function) (userdata)
The measurement operator functions (for wsclean; wsclean_operator_A and wsclean_operator_At) should be fully typed, be const correct and for consistency start with the userdata parameter:
void wsclean_operator_A(void* userData, const double* dataIn, double complex* dataOut);
void wsclean_operator_At(void* userData, const double complex* dataIn, double* dataOut);
Purify should cast the function pointers when necessary to e.g. support double->double measurement operators, instead of casting the parameters everytime in both the callee and caller.
The text was updated successfully, but these errors were encountered:
Thanks @aroffringa . We can continue with this after we get the first version up and running. This is a purify interface issue, so I'm closing this on sopt. (Github doesn't yet have the feature to move issues to other repositories).
Currently WSClean exposes these functions:
void wsclean_initialize(void** userData, const struct purify_domain_info* domain_info, struct purify_domain_data_format* data_info);
void wsclean_read(void* userData, DCOMPLEX* data, double* weights);
void wsclean_write(void* userData, const double* image);
void wsclean_deinitialize(void* userData);
void wsclean_operator_A(void* dataIn, void* dataOut, void* userData);
void wsclean_operator_At(void* dataIn, void* dataOut, void* userData);
For neatness, I suggest two more changes. Maybe not really necessary for now during the hack week, but nice to think about in the future:
wsclean_initialize(&userdata, &dinfo, &formatinfo);
read_function=formatinfo.read_function
deinitialize_function=formatinfo.deinitializate_function
...
(_read_function) (userdata, parameters)
...
(_deinitialize_function) (userdata)
void wsclean_operator_A(void* userData, const double* dataIn, double complex* dataOut);
void wsclean_operator_At(void* userData, const double complex* dataIn, double* dataOut);
Purify should cast the function pointers when necessary to e.g. support double->double measurement operators, instead of casting the parameters everytime in both the callee and caller.
The text was updated successfully, but these errors were encountered: