IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 19, 2004, 10:10:46 AM (22 years ago)
Author:
harman
Message:

Changed print statements to logging statements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/collections/psSort.c

    r438 r450  
    1 /** @file  psSort.h
    2  *
    3  *  @brief Sorts an array of floats
     1/** @file  psSort.c
     2 *
     3 *  @brief Sorts arrays
    44 *
    55 *  The psSort functions use the qsort() stdlib function with a user-defined callback to sort an array of
     
    1414 *  @author Ross Harman, MHPCC
    1515 *   
    16  *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    17  *  @date $Date: 2004-04-17 02:43:59 $
     16 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     17 *  @date $Date: 2004-04-19 20:10:46 $
    1818 *
    1919 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3232#include "psArray.h"
    3333#include "psSort.h"
     34#include "psError.h"
    3435
    3536/******************************************************************************/
     
    8081   
    8182    if(x == NULL || y == NULL) {
    82         printf("Null input argument\n");
     83        psError(__func__, " : Line %d - Null input argument: x=%d y=%d\n", __LINE__, x, y);
    8384    }
    8485   
     
    8788   
    8889    if(item1 == NULL || item2 == NULL) {
    89         printf("Improper cast to float\n");
     90        psError(__func__, " : Line %d - Improper cast to float: item1=%d item2=%d\n", __LINE__, item1, item2);
    9091    }
    9192   
     
    101102}
    102103
    103 /** Sort an array of floats.
    104  *
    105  *  Sorts an array of floats in ascendin order with the qsort() stdlib function.
    106  *
    107  *  @return  psFloatArray*: Pointer to sorted psFloatArray.
    108  */
    109  
     104/*****************************************************************************/
     105/* FUNCTION IMPLEMENTATION - PUBLIC                                          */
     106/*****************************************************************************/
     107
    110108psFloatArray *psSort(
    111109    psFloatArray *restrict outArray,        /**< Sorted output array. */
     
    121119
    122120    if(outArray == NULL) {
    123         printf("NULL output array n");
     121        psError(__func__, " : Line %d - Null output array\n", __LINE__);
    124122        return outArray;
    125123    }
    126124   
    127125    if(inArray == NULL) {
    128         printf("NULL input array\n");
     126        psError(__func__, " : Line %d - Null input array\n", __LINE__);
    129127        return outArray;
    130128    }
     
    138136   
    139137    if(inN != outN) {
    140         printf("Input and output array sizes are not equal");
     138        psError(__func__, " : Line %d - Input and output array sizes are not equal: in=%d out=%d\n", __LINE__,
     139                inN, outN);
    141140        return outArray;
    142141    }
     
    152151    return outArray;
    153152}
    154 
    155 /** Creates an array of indices based on sort odred of float array.
    156  *
    157  *  Sorts an array of floats and creates an integer array holding indices of sorted float values based on
    158  *  pre-sort index positions.
    159  *
    160  *  @return  psIntArray*: Pointer to psIntArray of sorted indices.
    161  */
    162153
    163154psIntArray *psSortIndex(
     
    177168   
    178169    if(outArray == NULL) {
    179         printf("NULL output array n");
     170        psError(__func__, " : Line %d - Null output array\n", __LINE__);
    180171        return outArray;
    181172    }
    182173   
    183174    if(inArray == NULL) {
    184         printf("NULL input array\n");
     175        psError(__func__, " : Line %d - Null input array\n", __LINE__);
    185176        return outArray;
    186177    }
     
    193184
    194185    if(inN != outN) {
    195         printf("Input and output array sizes are not equal");
     186        psError(__func__, " : Line %d - Input and output array sizes are not equal: in=%d out=%d\n", __LINE__,
     187                inN, outN);
    196188        return outArray;
    197189    }
Note: See TracChangeset for help on using the changeset viewer.