Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Future improvements to interface #11

Closed
aroffringa opened this issue Mar 26, 2015 · 1 comment
Closed

Future improvements to interface #11

aroffringa opened this issue Mar 26, 2015 · 1 comment
Assignees

Comments

@aroffringa
Copy link

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:

  • 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.
@vijaykartik vijaykartik self-assigned this Mar 26, 2015
@vijaykartik
Copy link

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants