Woolz Image Processing  Version 1.7.5
AlcArray.c File Reference

Provides functions for the allocation of 1, 2 and 3D arrays of types char, short, int, float and double. Extension to other types (including user defined types) should be straight formward through templates defined in AlcTemplates.h. More...

Functions

AlcErrno AlcBit1Calloc (unsigned char **dest, size_t mElem)
 Allocates a 1 dimensional zero'd bit array. More...
 
AlcErrno AlcPtr1Calloc (void ***dest, size_t mElem)
 Allocates a 1 dimensional zero'd array of pointers to void. More...
 
AlcErrno AlcChar1Calloc (char **dest, size_t mElem)
 Allocates a 1 dimensional zero'd array of chars. More...
 
AlcErrno AlcUnchar1Calloc (unsigned char **dest, size_t mElem)
 Allocates a 1 dimensional zero'd array of unsigned chars. More...
 
AlcErrno AlcShort1Calloc (short **dest, size_t mElem)
 Allocates a 1 dimensional zero'd array of shorts. More...
 
AlcErrno AlcInt1Calloc (int **dest, size_t mElem)
 Allocates a 1 dimensional zero'd array of ints. More...
 
AlcErrno AlcFloat1Calloc (float **dest, size_t mElem)
 Allocates a 1 dimensional zero'd array of floats. More...
 
AlcErrno AlcDouble1Calloc (double **dest, size_t mElem)
 Allocates a 1 dimensional zero'd array of doubles. More...
 
AlcErrno AlcBit1Malloc (unsigned char **dest, size_t mElem)
 Allocates a 1 dimensional non-zero'd bit array. More...
 
AlcErrno AlcPtr1Malloc (void ***dest, size_t mElem)
 Allocates a 1 dimensional non-zero'd array of pointers to void. More...
 
AlcErrno AlcChar1Malloc (char **dest, size_t mElem)
 Allocates a 1 dimensional non-zero'd array of chars. More...
 
AlcErrno AlcUnchar1Malloc (unsigned char **dest, size_t mElem)
 Allocates a 1 dimensional non-zero'd array of unsigned chars. More...
 
AlcErrno AlcShort1Malloc (short **dest, size_t mElem)
 Allocates a 1 dimensional non-zero'd array of shorts. More...
 
AlcErrno AlcInt1Malloc (int **dest, size_t mElem)
 Allocates a 1 dimensional non-zero'd array of ints. More...
 
AlcErrno AlcFloat1Malloc (float **dest, size_t mElem)
 Allocates a 1 dimensional non-zero'd array of floats. More...
 
AlcErrno AlcDouble1Malloc (double **dest, size_t mElem)
 Allocates a 1 dimensional non-zero'd array of doubles. More...
 
AlcErrno AlcBit2Calloc (unsigned char ***dest, size_t mElem, size_t nElem)
 Allocates a 2 dimensional zero'd bit array. More...
 
AlcErrno AlcPtr2Calloc (void ****dest, size_t mElem, size_t nElem)
 Allocates a 2 dimensional zero'd array of pointers to void. More...
 
AlcErrno AlcChar2Calloc (char ***dest, size_t mElem, size_t nElem)
 Allocates a 2 dimensional zero'd array of chars. More...
 
AlcErrno AlcUnchar2Calloc (unsigned char ***dest, size_t mElem, size_t nElem)
 Allocates a 2 dimensional zero'd array of unsigned chars. More...
 
AlcErrno AlcShort2Calloc (short ***dest, size_t mElem, size_t nElem)
 Allocates a 2 dimensional zero'd array of shorts. More...
 
AlcErrno AlcInt2Calloc (int ***dest, size_t mElem, size_t nElem)
 Allocates a 2 dimensional zero'd array of ints. More...
 
AlcErrno AlcFloat2Calloc (float ***dest, size_t mElem, size_t nElem)
 Allocates a 2 dimensional zero'd array of floats. More...
 
AlcErrno AlcDouble2Calloc (double ***dest, size_t mElem, size_t nElem)
 Allocates a 2 dimensional zero'd array of doubles. More...
 
AlcErrno AlcBit2Malloc (unsigned char ***dest, size_t mElem, size_t nElem)
 Allocates a 2 dimensional non-zero'd bit array. More...
 
AlcErrno AlcPtr2Malloc (void ****dest, size_t mElem, size_t nElem)
 Allocates a 2 dimensional non-zero'd array of pointers to void. More...
 
AlcErrno AlcChar2Malloc (char ***dest, size_t mElem, size_t nElem)
 Allocates a 2 dimensional non-zero'd array of chars. More...
 
AlcErrno AlcUnchar2Malloc (unsigned char ***dest, size_t mElem, size_t nElem)
 Allocates a 2 dimensional non-zero'd array of unsigned chars. More...
 
AlcErrno AlcShort2Malloc (short ***dest, size_t mElem, size_t nElem)
 Allocates a 2 dimensional non-zero'd array of shorts. More...
 
AlcErrno AlcInt2Malloc (int ***dest, size_t mElem, size_t nElem)
 Allocates a 2 dimensional non-zero'd array of ints. More...
 
AlcErrno AlcFloat2Malloc (float ***dest, size_t mElem, size_t nElem)
 Allocates a 2 dimensional non-zero'd array of floats. More...
 
AlcErrno AlcDouble2Malloc (double ***dest, size_t mElem, size_t nElem)
 Allocates a 2 dimensional non-zero'd array of doubles. More...
 
AlcErrno AlcSymChar2Calloc (char ***dest, size_t nElem)
 Allocates a 2 dimensional zero'd symetric array of chars in which only the lower triangle of elements are stored. More...
 
AlcErrno AlcSymUnchar2Calloc (unsigned char ***dest, size_t nElem)
 Allocates a 2 dimensional zero'd symetric array of unsigned chars in which only the lower triangle of elements are stored. More...
 
AlcErrno AlcSymShort2Calloc (short ***dest, size_t nElem)
 Allocates a 2 dimensional zero'd symetric array of shorts in which only the lower triangle of elements are stored. More...
 
AlcErrno AlcSymInt2Calloc (int ***dest, size_t nElem)
 Allocates a 2 dimensional zero'd symetric array of ints in which only the lower triangle of elements are stored. More...
 
AlcErrno AlcSymFloat2Calloc (float ***dest, size_t nElem)
 Allocates a 2 dimensional zero'd symetric array of floats in which only the lower triangle of elements are stored. More...
 
AlcErrno AlcSymDouble2Calloc (double ***dest, size_t nElem)
 Allocates a 2 dimensional zero'd symetric array of doubles in which only the lower triangle of elements are stored. More...
 
AlcErrno AlcSymChar2Malloc (char ***dest, size_t nElem)
 Allocates a 2 dimensional non-zero'd symetric array of chars in which only the lower triangle of elements are stored. More...
 
AlcErrno AlcSymUnchar2Malloc (unsigned char ***dest, size_t nElem)
 Allocates a 2 dimensional non-zero'd symetric array of unsigned chars in which only the lower triangle of elements are stored. More...
 
AlcErrno AlcSymShort2Malloc (short ***dest, size_t nElem)
 Allocates a 2 dimensional non-zero'd symetric array of shorts in which only the lower triangle of elements are stored. More...
 
AlcErrno AlcSymInt2Malloc (int ***dest, size_t nElem)
 Allocates a 2 dimensional non-zero'd symetric array of ints in which only the lower triangle of elements are stored. More...
 
AlcErrno AlcSymFloat2Malloc (float ***dest, size_t nElem)
 Allocates a 2 dimensional non-zero'd symetric array of floats in which only the lower triangle of elements are stored. More...
 
AlcErrno AlcSymDouble2Malloc (double ***dest, size_t nElem)
 Allocates a 2 dimensional non-zero'd symetric array of doubles in which only the lower triangle of elements are stored. More...
 
AlcErrno Alc2Free (void **dat)
 Free's a 2 dimensional array allocated by one of the 2 dimensional array allocation functions. More...
 
AlcErrno AlcBit2Free (unsigned char **dat)
 
AlcErrno AlcChar2Free (char **dat)
 
AlcErrno AlcUnchar2Free (unsigned char **dat)
 
AlcErrno AlcShort2Free (short **dat)
 
AlcErrno AlcInt2Free (int **dat)
 
AlcErrno AlcFloat2Free (float **dat)
 
AlcErrno AlcDouble2Free (double **dat)
 
AlcErrno AlcBit3Calloc (unsigned char ****dest, size_t mElem, size_t nElem, size_t oElem)
 Allocates a 3 dimensional zero'd bit array. More...
 
AlcErrno AlcPtr3Calloc (void *****dest, size_t mElem, size_t nElem, size_t oElem)
 Allocates a 3 dimensional array of pointers to void. More...
 
AlcErrno AlcChar3Calloc (char ****dest, size_t mElem, size_t nElem, size_t oElem)
 Allocates a 3 dimensional array of chars. More...
 
AlcErrno AlcUnchar3Calloc (unsigned char ****dest, size_t mElem, size_t nElem, size_t oElem)
 Allocates a 3 dimensional array of unsigned chars. More...
 
AlcErrno AlcShort3Calloc (short ****dest, size_t mElem, size_t nElem, size_t oElem)
 Allocates a 3 dimensional array of chars. More...
 
AlcErrno AlcInt3Calloc (int ****dest, size_t mElem, size_t nElem, size_t oElem)
 Allocates a 3 dimensional array of chars. More...
 
AlcErrno AlcFloat3Calloc (float ****dest, size_t mElem, size_t nElem, size_t oElem)
 Allocates a 3 dimensional array of chars. More...
 
AlcErrno AlcDouble3Calloc (double ****dest, size_t mElem, size_t nElem, size_t oElem)
 Allocates a 3 dimensional zero'd array of doubles. More...
 
AlcErrno AlcBit3Malloc (unsigned char ****dest, size_t mElem, size_t nElem, size_t oElem)
 Allocates a 3 dimensional non-zero'd bit array. More...
 
AlcErrno AlcPtr3Malloc (void *****dest, size_t mElem, size_t nElem, size_t oElem)
 Allocates a 3 dimensional non-zero'd array of pointers to void. More...
 
AlcErrno AlcChar3Malloc (char ****dest, size_t mElem, size_t nElem, size_t oElem)
 Allocates a 3 dimensional non-zero'd array of chars. More...
 
AlcErrno AlcUnchar3Malloc (unsigned char ****dest, size_t mElem, size_t nElem, size_t oElem)
 Allocates a 3 dimensional non-zero'd array of unsigned chars. More...
 
AlcErrno AlcShort3Malloc (short ****dest, size_t mElem, size_t nElem, size_t oElem)
 Allocates a 3 dimensional non-zero'd array of shorts. More...
 
AlcErrno AlcInt3Malloc (int ****dest, size_t mElem, size_t nElem, size_t oElem)
 Allocates a 3 dimensional non-zero'd array of ints. More...
 
AlcErrno AlcFloat3Malloc (float ****dest, size_t mElem, size_t nElem, size_t oElem)
 Allocates a 3 dimensional non-zero'd array of floats. More...
 
AlcErrno AlcDouble3Malloc (double ****dest, size_t mElem, size_t nElem, size_t oElem)
 Allocates a 3 dimensional non-zero'd array of doubles. More...
 
AlcErrno Alc3Free (void ***dest)
 Free's any 3 dimensional array allocated by one of the 3 dimensional array allocation functions. More...
 
AlcErrno AlcBit3Free (unsigned char ***dest)
 
AlcErrno AlcChar3Free (char ***dest)
 
AlcErrno AlcUnchar3Free (unsigned char ***dest)
 
AlcErrno AlcShort3Free (short ***dest)
 
AlcErrno AlcInt3Free (int ***dest)
 
AlcErrno AlcFloat3Free (float ***dest)
 
AlcErrno AlcDouble3Free (double ***dest)
 
AlcErrno AlcDouble1ReadAsci (FILE *fP, double **dstA, size_t *dstNElem)
 Reads a 1D double array from the given numeric ASCI file. Each value should be on a seperate line. More...
 
AlcErrno AlcDouble2ReadAsci (FILE *fP, double ***dstA, size_t *dstMElem, size_t *dstNElem)
 Reads a 2D double array from the given numeric ASCI file. Fields in the file must be white space saperated and records must be on separate lines. The number of fields per record must be the same for all records. More...
 
AlcErrno AlcDouble1WriteAsci (FILE *fP, double *ar, size_t nElem)
 Writes a 1D double array in numeric ASCI format to the given file file. Elements are on separate lines. More...
 
AlcErrno AlcDouble2WriteAsci (FILE *fP, double **ar, size_t mElem, size_t nElem)
 Writes a 2D double array in numeric ASCI format to the given file file. Fields in the file are white space seperated and records are on separate lines. More...
 

Detailed Description

Provides functions for the allocation of 1, 2 and 3D arrays of types char, short, int, float and double. Extension to other types (including user defined types) should be straight formward through templates defined in AlcTemplates.h.

Author
Bill Hill
Date
April 2001
Version
Id
fce45eaa48f4cdf2cbd5c154e7506fd30b055f4e
Address: MRC Human Genetics Unit, MRC Institute of Genetics and Molecular Medicine, University of Edinburgh, Western General Hospital, Edinburgh, EH4 2XU, UK.
Copyright (C), [2012], The University Court of the University of Edinburgh, Old College, Edinburgh, UK.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Function Documentation

AlcErrno AlcBit2Free ( unsigned char **  dat)

References AlcUnchar2Free().

Referenced by WlzFromBArray1D().

AlcErrno AlcChar2Free ( char **  dat)

References ALC_TEMPLATE_F2D.

Referenced by AlcUnchar2Free().

AlcErrno AlcUnchar2Free ( unsigned char **  dat)

References AlcChar2Free().

Referenced by AlcBit2Free().

AlcErrno AlcShort2Free ( short **  dat)

References ALC_TEMPLATE_F2D.

AlcErrno AlcInt2Free ( int **  dat)

References ALC_TEMPLATE_F2D.

Referenced by WlzSampleObj(), and WlzSampleObjPoint2D().

AlcErrno AlcFloat2Free ( float **  dat)

References ALC_TEMPLATE_F2D.

AlcErrno AlcDouble3Calloc ( double ****  dest,
size_t  mElem,
size_t  nElem,
size_t  oElem 
)

Allocates a 3 dimensional zero'd array of doubles.

Returns
Error code.
Note
Should be free'd using Alc3Free().
Array size is limited only by address space.
Parameters
destDestination for allocated array pointer.
mElemNumber of 2D arrays.
nElemNumber of 1D arrays.
oElemNumber of elements in each 1D array.

References ALC_TEMPLATE_C3D.

Referenced by WlzRegICPVerticesWSD2D().

AlcErrno AlcBit3Malloc ( unsigned char ****  dest,
size_t  mElem,
size_t  nElem,
size_t  oElem 
)

Allocates a 3 dimensional non-zero'd bit array.

Returns
Error code.
Note
Should be free'd using Alc3Free().
Array size is limited only by address space.
Parameters
destDestination for allocated array pointer.
mElemNumber of 2D arrays.
nElemNumber of 1D arrays.
oElemNumber of elements in each 1D array.

References AlcUnchar3Malloc().

Referenced by WlzRsvFilterBuffer(), and WlzToArray3D().

AlcErrno AlcBit3Free ( unsigned char ***  dest)

References AlcUnchar3Free().

AlcErrno AlcChar3Free ( char ***  dest)

References ALC_TEMPLATE_F3D.

Referenced by AlcUnchar3Free().

AlcErrno AlcShort3Free ( short ***  dest)

References ALC_TEMPLATE_F3D.

AlcErrno AlcInt3Free ( int ***  dest)

References ALC_TEMPLATE_F3D.

AlcErrno AlcFloat3Free ( float ***  dest)

References ALC_TEMPLATE_F3D.

AlcErrno AlcDouble3Free ( double ***  dest)

References ALC_TEMPLATE_F3D.