IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 247


Ignore:
Timestamp:
Mar 15, 2004, 3:20:03 PM (22 years ago)
Author:
eugene
Message:

added Doxygen \file and \defgroup entries
some basic reorganization

Location:
trunk/archive/pslib/include
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/archive/pslib/include/psAstrom.h

    r230 r247  
    22#define PS_ASTROM_H
    33
    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 */
    178
    189/***********************************************************************************************************/
  • trunk/archive/pslib/include/psBitMask.h

    r240 r247  
    11# if !defined (PS_BIT_MASK_H)
    22# define PS_BIT_MASK_H
     3
     4/** \file psBitMask.h
     5 *  \brief Bitmask manipulations and operations.
     6 *  \ingroup MathGroup
     7 */
    38
    49/** A bitmask of arbitrary length. */
  • trunk/archive/pslib/include/psDateTime.h

    r153 r247  
    22#define PS_DATE_TIME_H
    33
    4 /* Dates and Times */
     4/** \file psDateTime.h
     5 *  \brief Dates and Times
     6 *  \ingroup AstroGroup
     7 */
    58
    69/** Get current MJD, for a timestamp */
  • trunk/archive/pslib/include/psDlist.h

    r196 r247  
    11#if !defined(PS_DLIST_H)
    22#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
    57 */
    68
  • trunk/archive/pslib/include/psFFT.h

    r153 r247  
    22#define PS_FFT_H
    33
    4 #include "psStdArrays.h"
    5 
    6 /* Fourier Transform functions */
     4/** \file psFFT.h
     5 *  \brief Fourier Transform functions
     6 *  \ingroup MathGroup
     7 */
    78
    89/** Return Fourier Transform of an array */
  • trunk/archive/pslib/include/psFunctions.h

    r226 r247  
    22#define PS_FUNCTIONS_H
    33
    4 #include "psStdArrays.h"
     4/** \file psFunctions.h
     5 *  \brief Standard Mathematical Functions.
     6 *  \ingroup MathGroup
     7 */
    58
    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] */
    911float
    1012psGaussian(float x,                     //!< Value at which to evaluate
  • trunk/archive/pslib/include/psHash.h

    r196 r247  
    22#define PS_HASH_H
    33
     4/** \file psHash.h
     5 *  \brief Hash Table manipulation
     6 *  \ingroup DataGroup
     7 */
     8
     9/** DO WE NEED TO DEFINE HashTable? */
    410typedef struct HashTable psHash;        //!< Opaque type for a hash table
    511
  • trunk/archive/pslib/include/psLogMsg.h

    r196 r247  
    11#if !defined(PS_LOG_MSG_H)
    22#define PS_LOG_MSG_H
    3 #include <stdarg.h>
     3
     4/** \file psLogMsg.h
     5 *  \brief log messaging facilities
     6 *  \ingroup SystemGroup
     7 */
    48
    59enum { 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  
    22#define PS_MATH_H
    33
    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
    97 */
     8
     9/** private structure used to pass constant values into the math operators. */
     10typedef 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;
    1019
    1120/** Perform a binary operation on two data items (psImage, psVector, psScalar). */
     
    2433);
    2534
    26 /** create a psType-ed structure from a constant value. */
     35/** create a psType-ed structure from a constant double value. */
    2736p_ps_Scalar *
    2837psScalar (double value);
     
    3443);
    3544
    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 */
    4551
    4652/* examples of usage:
     
    6672
    6773*/
    68 
    6974
    7075#endif
  • trunk/archive/pslib/include/psMatrix.h

    r239 r247  
    11#if !defined(PS_MATRIX_H)
    22#define PS_MATRIX_H
     3
     4/** \file psMatrix.h
     5 *  \brief matrix math operators
     6 *  \ingroup MathGroup
     7 */
    38
    49/** A matrix */
  • trunk/archive/pslib/include/psMemory.h

    r222 r247  
    11#if !defined(PS_MEMORY_H)
    22#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.
    1013 */
    1114typedef struct {
     
    1821} psMemBlock;
    1922
    20 /** */
     23/** prototype of a basic callback used by memory functions */
    2124typedef 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 */
     27typedef void (*psMemProblemCallback)(const psMemBlock *ptr, const char *file, int lineno);
     28
     29/** prototype of a callback used when memory runs out */
    2430typedef void *(*psMemExhaustedCallback)(size_t size);
    2531
    2632/*****************************************************************************/
    2733
    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. */
    4035void *p_psAlloc(size_t size,            //!< Size required
    4136                const char *file,       //!< File of call
     
    4338    );
    4439
    45 /** Memory re-allocation */
     40/** Memory re-allocation.  Underlying private function called by macro psRealloc. */
    4641void *p_psRealloc(void *ptr,            //!< Pointer to re-allocate
    4742                  size_t size,          //!< Size required
     
    5045    );
    5146
    52 /** Free memory */
     47/** Free memory.  Underlying private function called by macro psFree. */
    5348void p_psFree(void *ptr,                //!< Pointer to free
    5449              const char *file,         //!< File of call
     
    5651    );
    5752
    58 /** psAlloc sends file and line number to p_psAlloc */
     53/** Memory allocation. psAlloc sends file and line number to p_psAlloc. */
    5954#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. */
    6157#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. */
    6360#define psFree(size) p_psFree(size, __FILE__, __LINE__)
    6461
    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 */
    6863#define malloc(S) for
     64
     65/** prevent the use of 'realloc'. realloc is re-defined to throw an error in the C preprocessor */
    6966#define realloc(P,S) for
     67
     68/** prevent the use of 'free'. free is re-defined to throw an error in the C preprocessor */
    7069#define free(P) for
    7170
     
    112111long psMemSetAllocateID(long id);       //!< set p_psMemAllocateID to id
    113112long psMemSetFreeID(long id);           //!< set p_psMemFreeID to id
     113
    114114#endif
  • trunk/archive/pslib/include/psMetaData.h

    r188 r247  
    22#define PS_META_DATA_H 1
    33
    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
    87 */
     8
     9/** Possible types of metadata. */
    910typedef enum {                          // type of val is:
    1011    PS_META_ITEM_SET = 0,               // NULL; metadata is in psMetaDataType.items
     
    2021} psMetaDataType;
    2122
     23/** Metadata flags (not exclusive with psMetaDataType). */
    2224typedef enum {
    2325    PS_META_TYPE_MASK =     0xffff,     // the type enum must fit in this mask
     
    2628} psMetaDataFlags;
    2729
    28 /*
    29  * A struct to define a single item of metadata
    30  */
     30/** A struct to define a single item of metadata */
    3131typedef struct {
    3232    const int id;                       // unique ID for this item
    33    
    3433    char *restrict name;                // Name of item
    3534    psMetaDataType type;                // type of this item
     
    4443} psMetaDataItem;
    4544
    46 /*
    47  * A set of metadata
    48  */
     45/** A set of metadata */
    4946typedef struct {
    5047    psDlist *restrict list;             // list of psMetaDataItem
     
    5249} psMetaDataSet;
    5350
    54 /*****************************************************************************/
    55 /*
    56  * Constructors and destructors
    57  */
     51/** Constructor */
    5852psMetaDataItem *psMetaDataItemAlloc(
    5953    int typeFlags,                      // type of this piece of metadata + flags
     
    6559    ...);                               // possible arguments for name format
    6660
     61/** Destructor */
    6762void psMetaDataItemFree(psMetaDataItem *ms); // piece of metadata to destroy
    6863
     64/** Constructor */
    6965psMetaDataSet *psMetaDataSetAlloc(void);   // make a new set of metadata
     66
     67/** Destructor */
    7068void psMetaDataSetFree(psMetaDataSet *ms); // destroy a set of metadata
    7169
    72 /*****************************************************************************/
    73 /*
    74  * Utilities
    75  */
     70/**** Utilities **********************************************************************/
     71
    7672psMetaDataItem *psMetaDataAppend(psMetaDataSet *restrict ms, psMetaDataItem *restrict item);
    7773psMetaDataItem *psMetaDataRemove(psMetaDataSet *restrict ms, const char *restrict key);
  • trunk/archive/pslib/include/psMinimize.h

    r245 r247  
    1 #if !defined(PS_MINIMISE_H)
    2 #define PS_MINIMISE_H
     1#if !defined(PS_MINIMIZE_H)
     2#define PS_MINIMIZE_H
    33
    44/** \file psMinimize.h
     
    77 */
    88
    9 /* Minimisation */
    10 
    11 /** Minimise a particular function */
     9/** Minimize a particular function */
    1210psFloatArray *
    13 psMinimise(float (*myFunction)(const psFloatArray *restrict),   //!< Function to minimise
     11psMinimize(float (*myFunction)(const psFloatArray *restrict),   //!< Function to minimize
    1412           psFloatArray *restrict initialGuess //!< Initial guess
    1513           );
    1614
    1715
    18 /** Minimise chi^2 for input data */
     16/** Minimize chi^2 for input data */
    1917psFloatArray *
    20 psMinimiseChi2(float (*evalModel)(const psFloatArray *restrict,
     18psMinimizeChi2(float (*evalModel)(const psFloatArray *restrict,
    2119                                  const psFloatArray *restrict), //!< Model to fit; receives domain and
    2220                                                                 //!< parameters
  • trunk/archive/pslib/include/psMisc.h

    r196 r247  
    11#if !defined(PS_MISC_H)
    22#define PS_MISC_H
    3 /**
    4  * Concatenate two macro arguments
     3
     4/** \file psMisc.h
     5 *  \brief miscellaneous system utilities
     6 *  \ingroup SystemGroup
    57 */
    6 #define P_PS_CONCAT(A, B) A ## B        //!< Expands to AB
    7 #define PS_CONCAT(A, B) A ## B          //!< Also Expands to AB
    8 #define PS_CONCAT2(A, B) PS_CONCAT(A, B) //!< Also expands to AB
    9 #define PS_CONCAT3(A, B, C) A ## B ## C //!< Expands to ABC
    10 #define PS_CONCAT4(A, B, C, D) A ## B ## C ## D //!< Expands to ABCD
    118
    129#define PS_STRING(S) #S                 //!< converts argument to string
     
    2724    );
    2825
     26/** Magic values for errors */
     27enum {
     28    PS_NO_VALUE = -111,                 //!< Corresponding value not yet measured
     29    PS_NO_ERROR = -222                  //!< Corresponding value has no error
     30};
     31
    2932#endif
  • trunk/archive/pslib/include/psPosition.h

    r226 r247  
    22#define PS_POSITION_H
    33
    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 */
    158
    169/***********************************************************************************************************/
  • trunk/archive/pslib/include/psSort.h

    r153 r247  
    22#define PS_SORT_H
    33
    4 #include "psStdArrays.h"
    5 
    6 /* Sorting */
     4/** \file psSort.h
     5 *  \brief general sorting operations
     6 *  \ingroup MathGroup
     7 */
    78
    89/** Sort an array. Inputs not restrict-ed to allow sort in place */
     
    1011psSort(psFloatArray *out,               //!< Sorted array to return. May be NULL
    1112       const psFloatArray *myArray      //!< Array to sort
    12        );
     13    );
    1314
    1415/** Sort an array, along with some other stuff.  Returns an index array */
    1516psIntArray *
    16 psCoSort(psIntArray *restrict out;      //!< Output index array (may be NULL)
    17          const psFloatArray *restrict myArray //!< Array to sort
    18         );
     17psSortIndex(psIntArray *restrict out;   //!< Output index array (may be NULL)
     18            const psFloatArray *restrict myArray //!< Array to sort
     19    );
    1920
    2021#endif
  • trunk/archive/pslib/include/psStats.h

    r226 r247  
    22#define PS_STATS_H
    33
    4 /* Include standard arrays */
    5 #include "psStdArrays.h"
     4/** \file psStats.h
     5 *  \brief basic statistical operations
     6 *  \ingroup MathGroup
     7 */
    68
     9/** statistics which may be calculated */
    710typedef enum {
    811    PS_STAT_SAMPLE_MEAN           = 0x000001,
     
    7376/** Histograms */
    7477typedef 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
    7680    psIntArray *nums;                   //!< Number in each of the bins
    7781    const float minVal, maxVal;         //!< Minimum and maximum values
    7882    int minNum, maxNum;                 //!< Number below the minimum and above the maximum
    7983} psHistogram;
    80 
    8184
    8285/** Constructor */
  • trunk/archive/pslib/include/psStdArrays.h

    r226 r247  
    22#define PS_TYPES_H
    33
    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 */
    88
    99/** Types of the elements of vectors, matrices, etc. */
     
    189189/************************************************************************************************************/
    190190
     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 */
     196typedef 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 */
     203psVoidPtrArray *psVoidPtrArrayAlloc(int n, //!< Number of elements to use
     204                                    int s //!< Total number of elements
     205                                    );
     206/** Reallocate */
     207psVoidPtrArray *psVoidPtrArrayRealloc(psVoidPtrArray *arr, //!< Array to reallocate
     208                                      int n //!< Number of elements
     209                                      );
     210/** Destructor */
     211void psVoidPtrArrayFree(psVoidPtrArray *arr, //!< array to destroy
     212                        void (*elemFree)(void *) //!< destructor for array data
     213                        );
     214
     215
    191216#endif
  • trunk/archive/pslib/include/psTrace.h

    r196 r247  
    22#define PS_TRACE_H 1
    33
     4/** \file psTrace.h
     5 *  \brief basic run-time trace facilities
     6 *  \ingroup SystemGroup
     7 */
     8
    49//#define PS_NTRACE 1                   //!< to turn off all tracing
     10
    511#if defined(PS_NTRACE)
    612#  define psTrace(facil, level, ...)    /* do nothing */
     
    1117
    1218/** Send a trace message */
    13 void p_psTrace(const char *facil, int level, ...);
     19void p_psTrace(const char *facil,       //!< facilty of interest
     20               int level,               //!< desired trace level
     21               ...                      //!< trace message arguments
     22);
    1423
    1524/** Set trace level */
    1625int psSetTraceLevel(const char *facil,  //!< facilty of interest
    1726                    int level           //!< desired trace level
    18     );
     27);
    1928
    2029/** Get the trace level */
    2130int psGetTraceLevel(const char *name    //!< facilty of interest
    22     );
     31);
    2332
    2433/** turn off all tracing, and free trace's allocated memory */
Note: See TracChangeset for help on using the changeset viewer.