[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-devel] [task #14254] Type conversion operators in Arithmetic
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-devel] [task #14254] Type conversion operators in Arithmetic |
Date: |
Tue, 29 Nov 2016 15:14:36 +0000 (UTC) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0 |
URL:
<http://savannah.gnu.org/task/?14254>
Summary: Type conversion operators in Arithmetic
Project: GNU Astronomy Utilities
Submitted by: makhlaghi
Submitted on: Wed 30 Nov 2016 12:14:34 AM JST
Should Start On: Tue 29 Nov 2016 12:00:00 AM JST
Should be Finished on: Tue 29 Nov 2016 12:00:00 AM JST
Category: Arithmetic
Priority: 5 - Normal
Item Group: Enhancement
Status: Postponed
Privacy: Public
Percent Complete: 20%
Assigned to: makhlaghi
Open/Closed: Open
Discussion Lock: Any
Effort: 0.00
_______________________________________________________
Details:
In task #14245, we are working on a root data structure to facilitate the
manipulation of input, output and generally internal data processing. In
particular, a data array pointer is generally stored as a `void *' and there
is an element in the structure to keep its type. This will enable a high-level
usage of the data structure independent of the actual type of the data. As
discussed in task #14245, work is ongoing to implement it in all the
utilities/libraries.
Until now, Arithmetic would convert all input numbers and arrays into double
precision floating point numbers and do the processing on them. But as the
datasets get larger, this process (both the conversion and the processing) can
make things slow when the input data aren't `double' (most astronomical images
are stored in single precision floating point types).
Thanks to the new data type, it is now possible to actually do the arithmetic
on arrays and numbers with their original input types and I am now working on
it. When necessary, there is also a new gal_data_copy_to_new_type
<https://gitlab.com/makhlaghi/gnuastro/blob/datastruct/lib/data.c#L886>
function that can convert between any of the known numerical types.
Since the original types are preserved in Arithmetic now, in some cases (for
example division of two integer arrays), it might be necessary to change the
input types to another type before some operation. So with this task, we will
add an operator for each type that popd one operand from the stack, and
converts it to the type it represents.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/task/?14254>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnuastro-devel] [task #14254] Type conversion operators in Arithmetic,
Mohammad Akhlaghi <=