# ifndef PS_VECTOR_H
# define PS_VECTOR_H

/** \file psVector.h
 *  \brief Basic vector definitions and operations.
 *  \ingroup DataGroup
 */

/// basic vector data structure.
typedef struct {
    psType type; 			///< vector data type and dimension
    const int n;			///< size of vector 
    const int nalloc;			///< allocated data block
    union {
        psS8  *S8;                      ///< Pointers to byte data
        psS16 *S16;                     ///< Pointers to short-integer data
        psS32 *S32;                     ///< Pointers to integer data
        psS64 *S64;                     ///< Pointers to long-integer data
        psU8  *U18;                     ///< Pointers to unsigned-byte data
        psU16 *U16;                     ///< Pointers to unsigned-short-integer data
        psU32 *U32;                     ///< Pointers to unsigned-integer data
        psU64 *U64;                     ///< Pointers to unsigned-long-integer data
        psF32 *F32;                     ///< Pointers to floating-point data
        psF64 *F64;                     ///< Pointers to double-precision data
        psC32 *C32;                     ///< Pointers to complex floating-point data
        psC64 *C64;                     ///< Pointers to complex floating-point data
    } data;
} psVector;

/** Functions **************************************************************/
/** \addtogroup DataGroup Astronomy-Specific Utilities
 *  \{
 */

/*** Vector structure manipulation ***/

/// Create a vector of the specified size and type.
psVector *
psVectorAlloc(int nalloc,		///< vector length 
	      psElemType type)		///< vector data type 
;

/// Extend a vector 
psVector *
psVectorRealloc(const psVector *vector, ///< vector to reallocate
		int nalloc)		///< required length 
;

/* \} */ // End of DataGroup Functions

#endif
