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

Submitted by:  Mohammad Akhlaghi <makhlaghi>
Submitted on:  Sun 30 Apr 2017 03:26:06 PM UTC  
 
Should Start On: Sat 29 Apr 2017 10:00:00 PM UTCShould be Finished on: Sat 29 Apr 2017 10:00:00 PM UTC
Category: LibrariesPriority: 5 - Normal
Item Group: EnhancementStatus: Postponed
Privacy: PublicPercent Complete: 0%
Assigned to: NoneOpen/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>
Project Administrator

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup1