taskGNU Astronomy Utilities - Tasks: task #14497, GSL extension for type-agnostic...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

task #14497: GSL extension for type-agnostic permutation

Submitter:  Mohammad Akhlaghi <makhlaghi>
Submitted:  Sun 30 Apr 2017 03:26:06 PM UTC
   
 
Should Start On:  Sat 29 Apr 2017 10:00:00 PM UTC Should be Finished on:  Sat 29 Apr 2017 10:00:00 PM UTC
Category:  Libraries Priority:  5 - Normal
Item Group:  Enhancement Status:  Postponed
Privacy:  Public Assigned to:  None
Percent Complete:  0% Open/Closed:  Open
Effort:  0.00

Sun 30 Apr 2017 03:26:06 PM UTC, original submission:  

Gnuastro has to deal directly with file input/output, so to make the code as generic and less buggy as possible, Gnuastro uses the fixed width types of `stdint.h' (for example `uin8_t' or `int32_t') rather than the standard subjective types (like `short', `int', or `long') which don't have guaranteed widths.

As part of Gnuastro's tessellation facilities, we needed permutations and fortunately the GNU Scientific Library (GSL) has some good functions for this job. But unfortunately, those functions were based on the subjective types not the fixed width types. Writing wrappers to find the proper type based on the system would be buggy and make the code hard to read.

So after reviewing GSL's implementation of the forward and reverse permutations (based on Knuth's "Art of computer programming"), a type-agnostic implementation of permutations were written for Gnuastro (in lib/permutation.c). It uses `memcpy' and can work on any type only with the knowledge of its width (in number of bytes). It is now used in several Gnuastro programs and it works nicely.

So, I thus got in touch with Patrick Alken (maintainer of GSL) to share these functions with him and see if they can be moved into GSL. He was supportive and suggested preparing them as a GSL Extension (a simple library which can be linked together with GSL in your application and uses the GSL coding conventions), so it can be further tested and possibly later be integrated into GSL.

So I am defining this task to write a GSL extension based on these functions and submitting it to GSL.

GSL deals with the different types by heavy usage of macros which make the code hard to read. Since Gnuastro's implementation accepts `void *' (of any type) and just needs the number of bytes in the type, type-specific functions (that are just wrappers over the type-agnostic implementation with a `sizeof(int)' for example) can also be written to replace the currently macro-heavy implementations in GSL. So in our suggested GSL extension, we can also include these wrappers for different types.

Mohammad Akhlaghi <makhlaghi>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by makhlaghi (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code