PDLA
view release on metacpan or search on metacpan
Basic/Core/pdl.h.PL view on Meta::CPAN
void* sv; /* (optional) pointer back to original sv.
ALWAYS check for non-null before use.
We cannot inc refcnt on this one or we'd
never get destroyed */
void *datasv; /* Pointer to SV containing data. We own one inc of refcnt */
void *data; /* Pointer to actual data (in SV), or NULL if we have no data */
/* bad value stored as double, since get_badvalue returns a double */
PDLA_Anyval badvalue; /* BAD value is stored as a PDLA_Anyval for portability */
int has_badvalue; /* flag is required by pdlapi.c (compare to PDLA_BADVAL above -- why two? --CED) */
PDLA_Indx nvals; /* Actual size of data (not quite nelem in case of dummy) */
int datatype; /* One of the usual suspects (PDLA_L, PDLA_D, etc.) */
PDLA_Indx *dims; /* Array of data dimensions - could point below or to an allocated array */
PDLA_Indx *dimincs; /* Array of data default increments, aka strides through memory for each dim (0 for dummies) */
short ndims; /* Number of data dimensions in dims and dimincs */
unsigned char *threadids; /* Starting index of the thread index set n */
unsigned char nthreadids;
pdl_children children;
PDLA_Indx def_dims[PDLA_NDIMS]; /* Preallocated space for efficiency */
PDLA_Indx def_dimincs[PDLA_NDIMS]; /* Preallocated space for efficiency */
unsigned char def_threadids[PDLA_NTHREADIDS];
struct pdl_magic *magic;
void *hdrsv; /* "header", settable from Perl */
};
/*************
* Some macros for looping over the children of a given PDLA
*/
#define PDLA_DECL_CHILDLOOP(p) \
int p##__i; pdl_children *p##__c;
#define PDLA_START_CHILDLOOP(p) \
p##__c = &p->children; \
do { \
for(p##__i=0; p##__i<PDLA_NCHILDREN; p##__i++) { \
if(p##__c->trans[p##__i]) {
#define PDLA_CHILDLOOP_THISCHILD(p) p##__c->trans[p##__i]
#define PDLA_END_CHILDLOOP(p) \
} \
} \
if(!p##__c) break; \
if(!p##__c->next) break; \
p##__c=p##__c->next; \
} while(1);
#define PDLAMAX(a,b) ((a) > (b) ? (a) : (b))
/***************
* Some macros to guard against dataflow infinite recursion.
*/
#define DECL_RECURSE_GUARD static int __nrec=0;
#define START_RECURSE_GUARD __nrec++; if(__nrec > 1000) {__nrec=0; die("PDLA:Internal Error: data structure recursion limit exceeded (max 1000 levels)\n\tThis could mean that you have found an infinite-recursion error in PDLA, or\n\tthat you are buil...
#define ABORT_RECURSE_GUARD __nrec=0;
#define END_RECURSE_GUARD __nrec--;
#define PDLA_ENSURE_ALLOCATED(it) ( (void)((it->state & PDLA_ALLOCATED) || ((pdl_allocdata(it)),1)) )
#define PDLA_ENSURE_VAFFTRANS(it) \
( ((!it->vafftrans) || (it->vafftrans->ndims < it->ndims)) && \
(pdl_vafftrans_alloc(it),1) )
/* __PDLA_H */
#endif
!NO!SUBS!
( run in 0.696 second using v1.01-cache-2.11-cpan-39bf76dae61 )