[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[task #15109] Size of dataset as an Arithmetic operator

From: Mohammad Akhlaghi
Subject: [task #15109] Size of dataset as an Arithmetic operator
Date: Sat, 7 Mar 2020 10:44:18 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:73.0) Gecko/20100101 Firefox/73.0

Follow-up Comment #14, task #15109 (project gnuastro):

I recommend reading through the data.h documentation
with its subsections. All Gnuastro programs use this structure for
reading/writing datasets of any type and size, with some basic metadata.

The `gal_data_alloc' function does the allocation of the necessary space in
memory (for the given type and number of elements it has). You just have to
write into it. 

A simple/readable way to read/write to the datasets' arrays is similar to what
we discussed before about the `arg' dataset: once you know the dataset's size,
you define a pointer of that type, then set the pointer to point to the
dataset's allocated space for data. For example, if you want it to be `size_t'
(the type for "size"-related things that can never be negative), you can do

size_t *out_arr;

But please read the data.h documentation first to avoid future confusions ;-).


Reply to this item at:


  Message sent via Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]