das2C
das core C utilities (v3)
Data Structures | Functions
Data Model

Classes and functions for storing and manipulating correlated data values. More...

Data Structures

struct  DasAry
 Dynamic recursive ragged arrays. More...
 
struct  DasDs
 Das Datasets. More...
 
struct  DasDim
 Das Physical Dimensions. More...
 
struct  DasFrame
 Stores the definitions for a directional coordinate frame. More...
 
struct  DasProp
 Individual properties of a desciptor. More...
 
struct  DasStream
 Describes the stream itself, in particular the compression used, current packetDescriptors, etc. More...
 
struct  DasVar
 Das2 fexible variables. More...
 

Functions

int das_rng2shape (int nRngRank, const ptrdiff_t *pMin, const ptrdiff_t *pMax, size_t *pShape)
 Calculate a strided array shape from a min/max range. More...
 

Detailed Description

Classes and functions for storing and manipulating correlated data values.

Function Documentation

◆ das_rng2shape()

int das_rng2shape ( int  nRngRank,
const ptrdiff_t *  pMin,
const ptrdiff_t *  pMax,
size_t *  pShape 
)

Calculate a strided array shape from a min/max range.

Used to calculate the memory requirements for a subset of a strided array range. The output range will often have fewer axes than the the input shape. This is common when slicing.

Parameters
nRngRankThe length of the min an max location arrays
pMinThe inclusive lower bound for the range in each array dimension.
pMaxThe exclusive upper bound for the range in each array dimension. For each element of pMax that is just 1 value larger than pMin the output shape is collapsed by one dimension.
[out]pShapeThe output range. Not that if the return rank is 0 then this has no usable elements. At most nRngRank elements will be written into pShape.
Returns
The rank of the shape. This can be 0 if the given range collapses to a single value. Returns -1 if pMin or pMax are invalid (also calls das_error, so the function may not return at all).