Changeset 247
- Timestamp:
- Mar 15, 2004, 3:20:03 PM (22 years ago)
- Location:
- trunk/archive/pslib/include
- Files:
-
- 19 edited
-
psAstrom.h (modified) (1 diff)
-
psBitMask.h (modified) (1 diff)
-
psDateTime.h (modified) (1 diff)
-
psDlist.h (modified) (1 diff)
-
psFFT.h (modified) (1 diff)
-
psFunctions.h (modified) (1 diff)
-
psHash.h (modified) (1 diff)
-
psLogMsg.h (modified) (1 diff)
-
psMath.h (modified) (4 diffs)
-
psMatrix.h (modified) (1 diff)
-
psMemory.h (modified) (6 diffs)
-
psMetaData.h (modified) (6 diffs)
-
psMinimize.h (modified) (2 diffs)
-
psMisc.h (modified) (2 diffs)
-
psPosition.h (modified) (1 diff)
-
psSort.h (modified) (2 diffs)
-
psStats.h (modified) (2 diffs)
-
psStdArrays.h (modified) (2 diffs)
-
psTrace.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/archive/pslib/include/psAstrom.h
r230 r247 2 2 #define PS_ASTROM_H 3 3 4 /* Include array declaration macros */ 5 #include "psArray.h" 6 /* Include standard array definitions */ 7 #include "psStdArrays.h" 8 /* Include position definitions */ 9 #include "psPosition.h" 10 /* Include colour definitions */ 11 #include "psColour.h" 12 /* Include matrix definitions */ 13 #include "psMatrix.h" 14 /* Include polynomial definitions */ 15 #include "psFunctions.h" 16 4 /** \file psAstrom.h 5 * \brief Astrometric transformations 6 * \ingroup AstroGroup 7 */ 17 8 18 9 /***********************************************************************************************************/ -
trunk/archive/pslib/include/psBitMask.h
r240 r247 1 1 # if !defined (PS_BIT_MASK_H) 2 2 # define PS_BIT_MASK_H 3 4 /** \file psBitMask.h 5 * \brief Bitmask manipulations and operations. 6 * \ingroup MathGroup 7 */ 3 8 4 9 /** A bitmask of arbitrary length. */ -
trunk/archive/pslib/include/psDateTime.h
r153 r247 2 2 #define PS_DATE_TIME_H 3 3 4 /* Dates and Times */ 4 /** \file psDateTime.h 5 * \brief Dates and Times 6 * \ingroup AstroGroup 7 */ 5 8 6 9 /** Get current MJD, for a timestamp */ -
trunk/archive/pslib/include/psDlist.h
r196 r247 1 1 #if !defined(PS_DLIST_H) 2 2 #define PS_DLIST_H 3 /* 4 * Support for doubly linked lists 3 4 /** \file psDlist.h 5 * \brief Support for doubly linked lists 6 * \ingroup DataGroup 5 7 */ 6 8 -
trunk/archive/pslib/include/psFFT.h
r153 r247 2 2 #define PS_FFT_H 3 3 4 #include "psStdArrays.h" 5 6 /* Fourier Transform functions */ 4 /** \file psFFT.h 5 * \brief Fourier Transform functions 6 * \ingroup MathGroup 7 */ 7 8 8 9 /** Return Fourier Transform of an array */ -
trunk/archive/pslib/include/psFunctions.h
r226 r247 2 2 #define PS_FUNCTIONS_H 3 3 4 #include "psStdArrays.h" 4 /** \file psFunctions.h 5 * \brief Standard Mathematical Functions. 6 * \ingroup MathGroup 7 */ 5 8 6 /* Standard Functions */ 7 8 /** Gaussian. Note that this is not a Gaussian deviate */ 9 /** evaluate a non-normalized Gaussian with the given mean and sigma at the given coordianate. Note that this 10 is not a Gaussian deviate. The evaluated Gaussian is: \f[ exp(-\frac{(x-mean)^2}{2\sigma^2}) \f] */ 9 11 float 10 12 psGaussian(float x, //!< Value at which to evaluate -
trunk/archive/pslib/include/psHash.h
r196 r247 2 2 #define PS_HASH_H 3 3 4 /** \file psHash.h 5 * \brief Hash Table manipulation 6 * \ingroup DataGroup 7 */ 8 9 /** DO WE NEED TO DEFINE HashTable? */ 4 10 typedef struct HashTable psHash; //!< Opaque type for a hash table 5 11 -
trunk/archive/pslib/include/psLogMsg.h
r196 r247 1 1 #if !defined(PS_LOG_MSG_H) 2 2 #define PS_LOG_MSG_H 3 #include <stdarg.h> 3 4 /** \file psLogMsg.h 5 * \brief log messaging facilities 6 * \ingroup SystemGroup 7 */ 4 8 5 9 enum { PS_LOG_ABORT = 0, PS_LOG_ERROR, PS_LOG_WARN, PS_LOG_INFO }; //!< Status codes for log messages -
trunk/archive/pslib/include/psMath.h
r238 r247 2 2 #define PS_MATH_H 3 3 4 /** in this method, the data types (psImage, psVector) include embedded information about their data type in 5 * the structure. The constant value is then handled by calling the psScalar function which returns a private 6 * scalar data type which is always freed by the code. This forces the layout of the data structures to be 7 * consistent, with the type information as the first entry. We can then define a data type which is 8 * completely flat and can be used to check on the data type of the data. 4 /** \file psMath.h 5 * \brief math operators between PSLib data types 6 * \ingroup MathGroup 9 7 */ 8 9 /** private structure used to pass constant values into the math operators. */ 10 typedef struct { 11 psType type; ///< data type information 12 union { 13 int i; ///< integer value entry 14 float f; ///< float value entry 15 double d; ///< double value entry 16 complex float c; ///< complex value entry 17 } 18 } p_psScalar; 10 19 11 20 /** Perform a binary operation on two data items (psImage, psVector, psScalar). */ … … 24 33 ); 25 34 26 /** create a psType-ed structure from a constant value. */35 /** create a psType-ed structure from a constant double value. */ 27 36 p_ps_Scalar * 28 37 psScalar (double value); … … 34 43 ); 35 44 36 typedef struct { 37 psType type; 38 union { 39 int i; 40 float f; 41 double d; 42 complex float c; 43 } 44 } p_psScalar; 45 /** the functions defined here can operate on the basic PSLib data types: psImage, psVector, XXX. These data 46 * types include embedded information about their type in the structure. Constant values are handled by 47 * wrapping the value in the psScalar function, which returns a private scalar data type, p_ps_Scalar, which 48 * is always freed by the function. The return value type can be determined by casting the return to psType 49 * and checking the type entry. 50 */ 45 51 46 52 /* examples of usage: … … 66 72 67 73 */ 68 69 74 70 75 #endif -
trunk/archive/pslib/include/psMatrix.h
r239 r247 1 1 #if !defined(PS_MATRIX_H) 2 2 #define PS_MATRIX_H 3 4 /** \file psMatrix.h 5 * \brief matrix math operators 6 * \ingroup MathGroup 7 */ 3 8 4 9 /** A matrix */ -
trunk/archive/pslib/include/psMemory.h
r222 r247 1 1 #if !defined(PS_MEMORY_H) 2 2 #define PS_MEMORY_H 3 #include <stdio.h> 4 /** 5 * Book-keeping data for storage allocator. 6 * 7 * N.b. sizeof(psMemBlock) must be chosen such that if ptr is a pointer 8 * returned by malloc, then ((char *)ptr + sizeof(psMemBlock)) is properly 9 * aligned for all storage types. 3 4 /** \file psMemory.h 5 * \brief Memory alloc/free routines 6 * \ingroup SystemGroup 7 */ 8 9 /** Book-keeping data for storage allocator. 10 * N.b. sizeof(psMemBlock) must be chosen such that if ptr is a pointer 11 * returned by malloc, then ((char *)ptr + sizeof(psMemBlock)) is properly 12 * aligned for all storage types. 10 13 */ 11 14 typedef struct { … … 18 21 } psMemBlock; 19 22 20 /** */23 /** prototype of a basic callback used by memory functions */ 21 24 typedef int (*psMemCallback)(const psMemBlock *ptr); 22 typedef void (*psMemProblemCallback)(const psMemBlock *ptr, 23 const char *file, int lineno); 25 26 /** prototype of a callback used in error conditions */ 27 typedef void (*psMemProblemCallback)(const psMemBlock *ptr, const char *file, int lineno); 28 29 /** prototype of a callback used when memory runs out */ 24 30 typedef void *(*psMemExhaustedCallback)(size_t size); 25 31 26 32 /*****************************************************************************/ 27 33 28 /** Fake for p_psAlloc */ 29 void *psAlloc(size_t size //!< Size required 30 ); 31 /** Fake for p_psRealloc */ 32 void *psRealloc(void *ptr, //!< Pointer to re-allocate 33 size_t size //!< Size required 34 ); 35 /** Fake for p_psFree */ 36 void psFree(void *ptr //!< Pointer to free 37 ); 38 39 /** Memory allocation */ 34 /** Memory allocation. Underlying private function called by macro psAlloc. */ 40 35 void *p_psAlloc(size_t size, //!< Size required 41 36 const char *file, //!< File of call … … 43 38 ); 44 39 45 /** Memory re-allocation */40 /** Memory re-allocation. Underlying private function called by macro psRealloc. */ 46 41 void *p_psRealloc(void *ptr, //!< Pointer to re-allocate 47 42 size_t size, //!< Size required … … 50 45 ); 51 46 52 /** Free memory */47 /** Free memory. Underlying private function called by macro psFree. */ 53 48 void p_psFree(void *ptr, //!< Pointer to free 54 49 const char *file, //!< File of call … … 56 51 ); 57 52 58 /** psAlloc sends file and line number to p_psAlloc*/53 /** Memory allocation. psAlloc sends file and line number to p_psAlloc. */ 59 54 #define psAlloc(size) p_psAlloc(size, __FILE__, __LINE__) 60 /** psRealloc sends file and line number to p_psRealloc */ 55 56 /** Memory re-allocation. psRealloc sends file and line number to p_psRealloc. */ 61 57 #define psRealloc(ptr, size) p_psRealloc(ptr, size, __FILE__, __LINE__) 62 /** psFree sends file and line number to p_psFree */ 58 59 /** Free memory. psFree sends file and line number to p_psFree. */ 63 60 #define psFree(size) p_psFree(size, __FILE__, __LINE__) 64 61 65 /* 66 * Ensure that any program using malloc/realloc/free will fail to compile 67 */ 62 /** prevent the use of 'malloc'. malloc is re-defined to throw an error in the C preprocessor */ 68 63 #define malloc(S) for 64 65 /** prevent the use of 'realloc'. realloc is re-defined to throw an error in the C preprocessor */ 69 66 #define realloc(P,S) for 67 68 /** prevent the use of 'free'. free is re-defined to throw an error in the C preprocessor */ 70 69 #define free(P) for 71 70 … … 112 111 long psMemSetAllocateID(long id); //!< set p_psMemAllocateID to id 113 112 long psMemSetFreeID(long id); //!< set p_psMemFreeID to id 113 114 114 #endif -
trunk/archive/pslib/include/psMetaData.h
r188 r247 2 2 #define PS_META_DATA_H 1 3 3 4 #include "psImages.h" // for psImage 5 #include "psAstrom.h" // for psAstrom 6 /* 7 * Possible types of metadata. 4 /** \file psMetaData.h 5 * \brief Metadata handling structures and functions 6 * \ingroup AstroGroup 8 7 */ 8 9 /** Possible types of metadata. */ 9 10 typedef enum { // type of val is: 10 11 PS_META_ITEM_SET = 0, // NULL; metadata is in psMetaDataType.items … … 20 21 } psMetaDataType; 21 22 23 /** Metadata flags (not exclusive with psMetaDataType). */ 22 24 typedef enum { 23 25 PS_META_TYPE_MASK = 0xffff, // the type enum must fit in this mask … … 26 28 } psMetaDataFlags; 27 29 28 /* 29 * A struct to define a single item of metadata 30 */ 30 /** A struct to define a single item of metadata */ 31 31 typedef struct { 32 32 const int id; // unique ID for this item 33 34 33 char *restrict name; // Name of item 35 34 psMetaDataType type; // type of this item … … 44 43 } psMetaDataItem; 45 44 46 /* 47 * A set of metadata 48 */ 45 /** A set of metadata */ 49 46 typedef struct { 50 47 psDlist *restrict list; // list of psMetaDataItem … … 52 49 } psMetaDataSet; 53 50 54 /*****************************************************************************/ 55 /* 56 * Constructors and destructors 57 */ 51 /** Constructor */ 58 52 psMetaDataItem *psMetaDataItemAlloc( 59 53 int typeFlags, // type of this piece of metadata + flags … … 65 59 ...); // possible arguments for name format 66 60 61 /** Destructor */ 67 62 void psMetaDataItemFree(psMetaDataItem *ms); // piece of metadata to destroy 68 63 64 /** Constructor */ 69 65 psMetaDataSet *psMetaDataSetAlloc(void); // make a new set of metadata 66 67 /** Destructor */ 70 68 void psMetaDataSetFree(psMetaDataSet *ms); // destroy a set of metadata 71 69 72 /*****************************************************************************/ 73 /* 74 * Utilities 75 */ 70 /**** Utilities **********************************************************************/ 71 76 72 psMetaDataItem *psMetaDataAppend(psMetaDataSet *restrict ms, psMetaDataItem *restrict item); 77 73 psMetaDataItem *psMetaDataRemove(psMetaDataSet *restrict ms, const char *restrict key); -
trunk/archive/pslib/include/psMinimize.h
r245 r247 1 #if !defined(PS_MINIMI SE_H)2 #define PS_MINIMI SE_H1 #if !defined(PS_MINIMIZE_H) 2 #define PS_MINIMIZE_H 3 3 4 4 /** \file psMinimize.h … … 7 7 */ 8 8 9 /* Minimisation */ 10 11 /** Minimise a particular function */ 9 /** Minimize a particular function */ 12 10 psFloatArray * 13 psMinimi se(float (*myFunction)(const psFloatArray *restrict), //!< Function to minimise11 psMinimize(float (*myFunction)(const psFloatArray *restrict), //!< Function to minimize 14 12 psFloatArray *restrict initialGuess //!< Initial guess 15 13 ); 16 14 17 15 18 /** Minimi se chi^2 for input data */16 /** Minimize chi^2 for input data */ 19 17 psFloatArray * 20 psMinimi seChi2(float (*evalModel)(const psFloatArray *restrict,18 psMinimizeChi2(float (*evalModel)(const psFloatArray *restrict, 21 19 const psFloatArray *restrict), //!< Model to fit; receives domain and 22 20 //!< parameters -
trunk/archive/pslib/include/psMisc.h
r196 r247 1 1 #if !defined(PS_MISC_H) 2 2 #define PS_MISC_H 3 /** 4 * Concatenate two macro arguments 3 4 /** \file psMisc.h 5 * \brief miscellaneous system utilities 6 * \ingroup SystemGroup 5 7 */ 6 #define P_PS_CONCAT(A, B) A ## B //!< Expands to AB7 #define PS_CONCAT(A, B) A ## B //!< Also Expands to AB8 #define PS_CONCAT2(A, B) PS_CONCAT(A, B) //!< Also expands to AB9 #define PS_CONCAT3(A, B, C) A ## B ## C //!< Expands to ABC10 #define PS_CONCAT4(A, B, C, D) A ## B ## C ## D //!< Expands to ABCD11 8 12 9 #define PS_STRING(S) #S //!< converts argument to string … … 27 24 ); 28 25 26 /** Magic values for errors */ 27 enum { 28 PS_NO_VALUE = -111, //!< Corresponding value not yet measured 29 PS_NO_ERROR = -222 //!< Corresponding value has no error 30 }; 31 29 32 #endif -
trunk/archive/pslib/include/psPosition.h
r226 r247 2 2 #define PS_POSITION_H 3 3 4 /* Include array declaration macros */ 5 #include "psArray.h" 6 #include "psObjects.h" 7 8 /***********************************************************************************************************/ 9 10 /** Magic values for errors */ 11 enum { 12 PS_NO_VALUE = -111, //!< Corresponding value not yet measured 13 PS_NO_ERROR = -222 //!< Corresponding value has no error 14 }; 4 /** \file psPosition.h 5 * \brief Definitions of objects in 2-D space 6 * \ingroup AstroGroup 7 */ 15 8 16 9 /***********************************************************************************************************/ -
trunk/archive/pslib/include/psSort.h
r153 r247 2 2 #define PS_SORT_H 3 3 4 #include "psStdArrays.h" 5 6 /* Sorting */ 4 /** \file psSort.h 5 * \brief general sorting operations 6 * \ingroup MathGroup 7 */ 7 8 8 9 /** Sort an array. Inputs not restrict-ed to allow sort in place */ … … 10 11 psSort(psFloatArray *out, //!< Sorted array to return. May be NULL 11 12 const psFloatArray *myArray //!< Array to sort 12 );13 ); 13 14 14 15 /** Sort an array, along with some other stuff. Returns an index array */ 15 16 psIntArray * 16 ps CoSort(psIntArray *restrict out; //!< Output index array (may be NULL)17 const psFloatArray *restrict myArray //!< Array to sort18 );17 psSortIndex(psIntArray *restrict out; //!< Output index array (may be NULL) 18 const psFloatArray *restrict myArray //!< Array to sort 19 ); 19 20 20 21 #endif -
trunk/archive/pslib/include/psStats.h
r226 r247 2 2 #define PS_STATS_H 3 3 4 /* Include standard arrays */ 5 #include "psStdArrays.h" 4 /** \file psStats.h 5 * \brief basic statistical operations 6 * \ingroup MathGroup 7 */ 6 8 9 /** statistics which may be calculated */ 7 10 typedef enum { 8 11 PS_STAT_SAMPLE_MEAN = 0x000001, … … 73 76 /** Histograms */ 74 77 typedef struct { 75 const psFloatArray *restrict lower, *restrict upper; //!< Lower and upper bounds for the bins 78 const psFloatArray *restrict lower; //!< Lower bounds for the bins 79 const psFloatArray *restrict upper; //!< Upper bounds for the bins 76 80 psIntArray *nums; //!< Number in each of the bins 77 81 const float minVal, maxVal; //!< Minimum and maximum values 78 82 int minNum, maxNum; //!< Number below the minimum and above the maximum 79 83 } psHistogram; 80 81 84 82 85 /** Constructor */ -
trunk/archive/pslib/include/psStdArrays.h
r226 r247 2 2 #define PS_TYPES_H 3 3 4 #include <complex.h> 5 #include <stdint.h> 6 #include "psArray.h" 7 4 /** \file psStdArrays.h 5 * \brief Support for basic flat arrays 6 * \ingroup DataGroup 7 */ 8 8 9 9 /** Types of the elements of vectors, matrices, etc. */ … … 189 189 /************************************************************************************************************/ 190 190 191 /*****************************************************************************/ 192 /** Array of pointers to void. 193 * psVoidPtrArray is special, as it needs to have a destructor that 194 * accepts a destructor for the array elements 195 */ 196 typedef struct { 197 int n; //!< Number of elements in use 198 int size; //!< Number of total elements 199 void **arr; //!< The elements 200 } psVoidPtrArray; 201 202 /** Constructor */ 203 psVoidPtrArray *psVoidPtrArrayAlloc(int n, //!< Number of elements to use 204 int s //!< Total number of elements 205 ); 206 /** Reallocate */ 207 psVoidPtrArray *psVoidPtrArrayRealloc(psVoidPtrArray *arr, //!< Array to reallocate 208 int n //!< Number of elements 209 ); 210 /** Destructor */ 211 void psVoidPtrArrayFree(psVoidPtrArray *arr, //!< array to destroy 212 void (*elemFree)(void *) //!< destructor for array data 213 ); 214 215 191 216 #endif -
trunk/archive/pslib/include/psTrace.h
r196 r247 2 2 #define PS_TRACE_H 1 3 3 4 /** \file psTrace.h 5 * \brief basic run-time trace facilities 6 * \ingroup SystemGroup 7 */ 8 4 9 //#define PS_NTRACE 1 //!< to turn off all tracing 10 5 11 #if defined(PS_NTRACE) 6 12 # define psTrace(facil, level, ...) /* do nothing */ … … 11 17 12 18 /** Send a trace message */ 13 void p_psTrace(const char *facil, int level, ...); 19 void p_psTrace(const char *facil, //!< facilty of interest 20 int level, //!< desired trace level 21 ... //!< trace message arguments 22 ); 14 23 15 24 /** Set trace level */ 16 25 int psSetTraceLevel(const char *facil, //!< facilty of interest 17 26 int level //!< desired trace level 18 );27 ); 19 28 20 29 /** Get the trace level */ 21 30 int psGetTraceLevel(const char *name //!< facilty of interest 22 );31 ); 23 32 24 33 /** turn off all tracing, and free trace's allocated memory */
Note:
See TracChangeset
for help on using the changeset viewer.
