IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 12431


Ignore:
Timestamp:
Mar 13, 2007, 2:39:51 PM (19 years ago)
Author:
Paul Price
Message:

Removing complex number support. No-one was using it, and it prevents compilation on Solaris.

Location:
trunk/psLib
Files:
34 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/db/psDB.c

    r12394 r12431  
    1212 *  @author Joshua Hoblitt
    1313 *
    14  *  @version $Revision: 1.139 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2007-03-10 01:24:40 $
     14 *  @version $Revision: 1.140 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2007-03-14 00:39:50 $
    1616 *
    1717 *  Copyright (C) 2005-2006  Joshua Hoblitt, University of Hawaii
     
    504504    case PS_DATA_F64:
    505505        PS_STR_ARRAY_TO_PTYPE(column->data.F64, stringColumn, atof, psF64, PS_DATA_F64);
    506         break;
    507     case PS_TYPE_C32:
    508         // this is a bogus SQL type
    509         PS_STR_ARRAY_TO_PTYPE(column->data.C32, stringColumn, atof, psC32, PS_TYPE_C32);
    510         break;
    511     case PS_TYPE_C64:
    512         // this is a bogus SQL type
    513         PS_STR_ARRAY_TO_PTYPE(column->data.C64, stringColumn, atof, psC64, PS_TYPE_C64);
    514506        break;
    515507    case PS_DATA_BOOL:
     
    21892181        psDBAddToLookupTable(pTypeToSQLlookupTable, PS_DATA_F32, "FLOAT");
    21902182        psDBAddToLookupTable(pTypeToSQLlookupTable, PS_DATA_F64, "DOUBLE");
    2191         psDBAddToLookupTable(pTypeToSQLlookupTable, PS_TYPE_C32, "PS_TYPE_C32 is not supported");
    2192         psDBAddToLookupTable(pTypeToSQLlookupTable, PS_TYPE_C64, "PS_TYPE_C64 is not supported");
    21932183        // XXX Since BOOL is added after S8 all "TINYINT" data will appear in
    21942184        // the database as boolean data.  There does not seem to be any way to
     
    23362326        psDBAddVoidToLookupTable(pTypeToMysqlLookupTable, PS_DATA_F32,    psDBMySQLTypeAlloc(MYSQL_TYPE_FLOAT,      false));
    23372327        psDBAddVoidToLookupTable(pTypeToMysqlLookupTable, PS_DATA_F64,    psDBMySQLTypeAlloc(MYSQL_TYPE_DOUBLE,     false));
    2338         // bogus type
    2339         psDBAddVoidToLookupTable(pTypeToMysqlLookupTable, PS_TYPE_C32,    psDBMySQLTypeAlloc(MYSQL_TYPE_VAR_STRING, false));
    2340         // bogus type
    2341         psDBAddVoidToLookupTable(pTypeToMysqlLookupTable, PS_TYPE_C64,    psDBMySQLTypeAlloc(MYSQL_TYPE_VAR_STRING, false));
    23422328        psDBAddVoidToLookupTable(pTypeToMysqlLookupTable, PS_DATA_BOOL,   psDBMySQLTypeAlloc(MYSQL_TYPE_TINY,       true));
    23432329        // XXX: removed PS_DATA_PTR, can this be removed too?
     
    24682454        PS_NAN_ALLOC(myNaN, psF64, NAN);
    24692455        break;
    2470     case PS_TYPE_C32:
    2471         // this is a bogus SQL type
    2472         PS_NAN_ALLOC(myNaN, psC32, NAN);
    2473         break;
    2474     case PS_TYPE_C64:
    2475         // this is a bogus SQL type
    2476         PS_NAN_ALLOC(myNaN, psC64, NAN);
    2477         break;
    24782456    case PS_DATA_BOOL:
    24792457        // XXX: what is NaN for a bool?
     
    25222500    case PS_DATA_F64:
    25232501        isNaN = PS_IS_NAN(psF64, data, NAN);
    2524         break;
    2525     case PS_TYPE_C32:
    2526         // this is a bogus SQL type
    2527         isNaN = PS_IS_NAN(psC32, data, NAN);
    2528         break;
    2529     case PS_TYPE_C64:
    2530         // this is a bogus SQL type
    2531         isNaN = PS_IS_NAN(psC64, data, NAN);
    25322502        break;
    25332503    case PS_DATA_BOOL:
  • trunk/psLib/src/fits/psFits.c

    r11998 r12431  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.61 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2007-02-22 21:47:29 $
     9 *  @version $Revision: 1.62 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2007-03-14 00:39:50 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    524524    case TDOUBLE:
    525525        return PS_TYPE_F64;
    526     case TCOMPLEX:
    527         return PS_TYPE_C32;
    528     case TDBLCOMPLEX:
    529         return PS_TYPE_C64;
    530526    case TLOGICAL:
    531527        return PS_TYPE_BOOL;
  • trunk/psLib/src/fits/psFitsTable.c

    r11686 r12431  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2007-02-07 23:52:53 $
     9 *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2007-03-14 00:39:50 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    447447    case PS_TYPE_F64:
    448448        return 'D';
    449     case PS_TYPE_C32:
    450         return 'C';
    451     case PS_TYPE_C64:
    452         return 'M';
    453449    case PS_TYPE_BOOL:
    454450        return 'L';
  • trunk/psLib/src/imageops/psImageGeomManip.c

    r12330 r12431  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2007-03-08 22:12:56 $
     12 *  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2007-03-14 00:39:50 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2020#endif
    2121
    22 #include <complex.h>
    2322#include <math.h>                          // for isfinite(), etc.
    2423#include <stdlib.h>
     
    158157        PS_IMAGE_REBIN_CASE(F32);
    159158        PS_IMAGE_REBIN_CASE(F64);
    160         //        PS_IMAGE_REBIN_CASE(C32);      Not valid since psVectorStats doesn't allow
    161         //        PS_IMAGE_REBIN_CASE(C64);      Not valid since psVectorStats doesn't allow
    162159
    163160    default: {
     
    241238        PSIMAGE_RESAMPLE_CASE(F32)
    242239        PSIMAGE_RESAMPLE_CASE(F64)
    243         PSIMAGE_RESAMPLE_CASE(C32)
    244         PSIMAGE_RESAMPLE_CASE(C64)
    245240    default: {
    246241            char* typeStr;
     
    312307                       const psImage* input,
    313308                       float angle,
    314                        double complex exposed,
     309                       double exposed,
    315310                       psImageInterpolateMode mode)
    316311{
     
    356351            PSIMAGE_ROTATE_LEFT_90(F32);
    357352            PSIMAGE_ROTATE_LEFT_90(F64);
    358             PSIMAGE_ROTATE_LEFT_90(C32);
    359             PSIMAGE_ROTATE_LEFT_90(C64);
    360353
    361354        default: {
     
    402395            PSIMAGE_ROTATE_180_CASE(F32);
    403396            PSIMAGE_ROTATE_180_CASE(F64);
    404             PSIMAGE_ROTATE_180_CASE(C32);
    405             PSIMAGE_ROTATE_180_CASE(C64);
    406397
    407398        default: {
     
    447438            PSIMAGE_ROTATE_RIGHT_90(F32);
    448439            PSIMAGE_ROTATE_RIGHT_90(F64);
    449             PSIMAGE_ROTATE_RIGHT_90(C32);
    450             PSIMAGE_ROTATE_RIGHT_90(C64);
    451440
    452441        default: {
     
    504493
    505494        #define PSIMAGE_ROTATE_ARBITRARY_LOOP(TYPE,MODE) { \
    506             if (creal(exposed) < PS_MIN_##TYPE || \
    507                     creal(exposed) > PS_MAX_##TYPE || \
    508                     cimag(exposed) < PS_MIN_##TYPE || \
    509                     cimag(exposed) > PS_MAX_##TYPE) { \
     495            if (exposed < PS_MIN_##TYPE || \
     496                    exposed > PS_MAX_##TYPE || \
     497                    exposed < PS_MIN_##TYPE || \
     498                    exposed > PS_MAX_##TYPE) { \
    510499                psError(PS_ERR_BAD_PARAMETER_VALUE, true, \
    511500                        _("Specified %s value, %g%+gi, is not the the range of input psImage's valid pixel values (%s), i.e. [%g:%g]."), \
    512501                        "exposed", \
    513                         creal(exposed),cimag(exposed), \
     502                        exposed, exposed, \
    514503                        PS_TYPE_##TYPE##_NAME,  \
    515504                        (double)PS_MIN_##TYPE,(double)PS_MAX_##TYPE); \
     
    566555            PSIMAGE_ROTATE_ARBITRARY_LOOP(F64,MODE); \
    567556            break; \
    568         case PS_TYPE_C32: \
    569             PSIMAGE_ROTATE_ARBITRARY_LOOP(C32,MODE); \
    570             break; \
    571         case PS_TYPE_C64: \
    572             PSIMAGE_ROTATE_ARBITRARY_LOOP(C64,MODE); \
    573             break; \
    574557        default: { \
    575558                char* typeStr; \
     
    690673                      float dx,
    691674                      float dy,
    692                       double complex exposed,
     675                      double exposed,
    693676                      psImageInterpolateMode mode)
    694677{
     
    714697    #define PSIMAGE_SHIFT_CASE(MODE,TYPE) \
    715698case PS_TYPE_##TYPE: \
    716     if (creal(exposed) < PS_MIN_##TYPE || \
    717             creal(exposed) > PS_MAX_##TYPE || \
    718             cimag(exposed) < PS_MIN_##TYPE || \
    719             cimag(exposed) > PS_MAX_##TYPE) { \
     699    if (exposed < PS_MIN_##TYPE || \
     700            exposed > PS_MAX_##TYPE || \
     701            exposed < PS_MIN_##TYPE || \
     702            exposed > PS_MAX_##TYPE) { \
    720703        psError(PS_ERR_BAD_PARAMETER_VALUE, true, \
    721704                _("Specified %s value, %g%+gi, is not the the range of input psImage's valid pixel values (%s), i.e. [%g:%g]."), \
    722705                "exposed", \
    723                 creal(exposed),cimag(exposed), \
     706                exposed,exposed, \
    724707                PS_TYPE_##TYPE##_NAME,  \
    725708                (double)PS_MIN_##TYPE,(double)PS_MAX_##TYPE); \
     
    755738        PSIMAGE_SHIFT_CASE(MODE,F32); \
    756739        PSIMAGE_SHIFT_CASE(MODE,F64); \
    757         PSIMAGE_SHIFT_CASE(MODE,C32); \
    758         PSIMAGE_SHIFT_CASE(MODE,C64); \
    759         \
     740       \
    760741    default: { \
    761742            char* typeStr; \
     
    10291010            FLIP_X_CASE(PS_TYPE_F32, F32);
    10301011            FLIP_X_CASE(PS_TYPE_F64, F64);
    1031             FLIP_X_CASE(PS_TYPE_C32, C32);
    1032             FLIP_X_CASE(PS_TYPE_C64, C64);
    10331012        default:
    10341013            psFree(output);
     
    10501029            FLIP_Y_CASE(PS_TYPE_F32, F32);
    10511030            FLIP_Y_CASE(PS_TYPE_F64, F64);
    1052             FLIP_Y_CASE(PS_TYPE_C32, C32);
    1053             FLIP_Y_CASE(PS_TYPE_C64, C64);
    10541031        default:
    10551032            psFree(output);
  • trunk/psLib/src/imageops/psImageGeomManip.h

    r11248 r12431  
    66 * @author Robert DeSonia, MHPCC
    77 *
    8  * @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
    9  * @date $Date: 2007-01-23 22:47:23 $
     8 * @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
     9 * @date $Date: 2007-03-14 00:39:50 $
    1010 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
    1111 */
     
    2727 *  specified the number of pixels used to define a new pixel in the output image.
    2828 *  The output image is generated from all input image pixels. This function is
    29  *  defined for psU8, psS8, psS16, psF32, psF64, psC32, and psC64.
     29 *  defined for psU8, psS8, psS16, psF32, psF64.
    3030 *
    3131 *  @return psImage    new image formed by rebinning input image.
     
    6565 *  center pixel of the image. The rotation is specified in the sense that a
    6666 *  positive angle is an anti-clockwise rotation. This function must be
    67  *  defined for the following types: psU8, psU16, psS8, psS16, psF32, psF64,
    68  *  psC32, psC64.
     67 *  defined for the following types: psU8, psU16, psS8, psS16, psF32, psF64.
    6968 *
    7069 *  @return psImage*     the rotated image result.
     
    7473    const psImage* input,              ///< input image
    7574    float angle,                       ///< the rotation angle in radians.
    76     double complex exposed,            ///< the output image pixel values for non-imagery areas
     75    double exposed,                    ///< the output image pixel values for non-imagery areas
    7776    psImageInterpolateMode mode        ///< the interpolation mode used
    7877);
     
    8584 *  output image are lost. Newly exposed pixels are set to the value given by
    8685 *  exposed. This function must be defined for the following types: psU8,
    87  *  psU16, psS8, psS16, psF32, psF64, psC32, psC64.
     86 *  psU16, psS8, psS16, psF32, psF64.
    8887 *
    8988 *  @return psImage*     the shifted image result.
     
    9493    float dx,                          ///< the shift in x direction.
    9594    float dy,                          ///< the shift in y direction.
    96     double complex exposed,            ///< the output image pixel values for non-imagery areas
     95    double exposed,                    ///< the output image pixel values for non-imagery areas
    9796    psImageInterpolateMode mode        ///< the interpolation mode to use
    9897);
     
    105104 *  output image are lost. Newly exposed pixels are set to the value given by
    106105 *  exposed. This function must be defined for the following types: psU8,
    107  *  psU16, psS8, psS16, psF32, psF64, psC32, psC64.
     106 *  psU16, psS8, psS16, psF32, psF64.
    108107 *
    109108 *  This implementation uses a NxN kernel generated based on the interpolation method
    110109 *  the image is first shifted by a fractional amount with the kernel, then
    111  *  shifted in place by an integer amount. 
     110 *  shifted in place by an integer amount.
    112111 *
    113112 *  XXX the integer shift portion is not implemented
     
    136135 *  The output image is the same dimensions as the input image.  Edge pixels
    137136 *  wrap to the other side (no values are lost).  This function is
    138  *  defined for psU8, psS8, psS16, psF32, psF64, psC32, and psC64.
     137 *  defined for psU8, psS8, psS16, psF32, psF64.
    139138 *
    140139 *  @return psImage* the rolled version of the input image.
     
    169168 *  return to the user. This function must be capable of handling the following
    170169 *  types for the input (with corresponding types for the output): psF32, psF64.
    171  
     170
    172171 *
    173172 *  @return psImage*    The transformed image.
  • trunk/psLib/src/imageops/psImageMaskOps.c

    r10999 r12431  
    88 *  @author David Robbins, MHPCC
    99 *
    10  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2007-01-09 22:38:52 $
     10 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2007-03-14 00:39:50 $
    1212 *
    1313 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    1818#endif
    1919
    20 #include <complex.h>
    2120#include <math.h>                          // for isfinite(), etc.
    2221#include <stdlib.h>
  • trunk/psLib/src/imageops/psImagePixelExtract.c

    r10999 r12431  
    88 *  @author Robert DeSonia, MHPCC
    99 *
    10  *  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2007-01-09 22:38:52 $
     10 *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2007-03-14 00:39:50 $
    1212 *
    1313 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    103103        VECTOR_STORE_ROW_CASE(F32);
    104104        VECTOR_STORE_ROW_CASE(F64);
    105         VECTOR_STORE_ROW_CASE(C32);
    106         VECTOR_STORE_ROW_CASE(C64);
    107105    default:
    108106        psError(PS_ERR_BAD_PARAMETER_TYPE, true,
     
    193191        VECTOR_STORE_COL_CASE(F32);
    194192        VECTOR_STORE_COL_CASE(F64);
    195         VECTOR_STORE_COL_CASE(C32);
    196         VECTOR_STORE_COL_CASE(C64);
    197193    default:
    198194        psError(PS_ERR_BAD_PARAMETER_TYPE, true,
     
    463459            PSIMAGE_CUT_VERTICAL(F32);
    464460            PSIMAGE_CUT_VERTICAL(F64);
    465             PSIMAGE_CUT_VERTICAL(C32); // Not a requirement
    466             PSIMAGE_CUT_VERTICAL(C64); // Not a requirement
    467461        default: {
    468462                char* typeStr;
     
    715709        LINEAR_CUT_CASE(F32);
    716710        LINEAR_CUT_CASE(F64);
    717         LINEAR_CUT_CASE(C32);
    718         LINEAR_CUT_CASE(C64);
    719711
    720712    default: {
  • trunk/psLib/src/imageops/psImagePixelManip.c

    r12256 r12431  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2007-03-06 03:09:58 $
     12 *  @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2007-03-14 00:39:50 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2020#endif
    2121
    22 #include <complex.h>
    2322#include <math.h>                          // for isfinite(), etc.
    2423#include <stdlib.h>
     
    9089        break;
    9190
    92         #define psImageClipCaseComplex(type,absfcn)\
    93     case PS_TYPE_##type: { \
    94             if (vmin < PS_MIN_##type || vmin > PS_MAX_##type) { \
    95                 psError(PS_ERR_BAD_PARAMETER_VALUE, true, \
    96                         _("Specified %s value, %g, is outside of psImage type's range (%s: %g to %g)."), \
    97                         "vmin",vmin, PS_TYPE_##type##_NAME, \
    98                         (psF64)PS_MIN_##type,(psF64)PS_MAX_##type); \
    99             } \
    100             if (vmax > PS_MAX_##type || vmax < PS_MIN_##type) { \
    101                 psError(PS_ERR_BAD_PARAMETER_VALUE, true, \
    102                         _("Specified %s value, %g, is outside of psImage type's range (%s: %g to %g)."), \
    103                         "vmax",vmax, PS_TYPE_##type##_NAME, \
    104                         (psF64)PS_MIN_##type,(psF64)PS_MAX_##type); \
    105             } \
    106             for (psU32 row = 0;row<numRows;row++) { \
    107                 ps##type* inputRow = input->data.type[row]; \
    108                 for (psU32 col = 0; col < numCols; col++) { \
    109                     if (absfcn(inputRow[col]) < min) { \
    110                         inputRow[col] = (ps##type)vmin; \
    111                         numClipped++; \
    112                     } else if (absfcn(inputRow[col]) > max) { \
    113                         inputRow[col] = (ps##type)vmax; \
    114                         numClipped++; \
    115                     } \
    116                 } \
    117             } \
    118         } \
    119         break;
    120 
    12191        psImageClipCase(S8)
    12292        psImageClipCase(S16)
     
    12999        psImageClipCase(F32)
    130100        psImageClipCase(F64)
    131         psImageClipCaseComplex(C32, cabsf)
    132         psImageClipCaseComplex(C64, cabs)
    133101
    134102    default: {
     
    174142        psImageClipNaNCase(F32)
    175143        psImageClipNaNCase(F64)
    176         psImageClipNaNCase(C32)
    177         psImageClipNaNCase(C64)
    178144
    179145    default: {
     
    331297        psImageOverlayCase(F32,NAN);
    332298        psImageOverlayCase(F64,NAN);
    333         psImageOverlayCase(C32,NAN);
    334         psImageOverlayCase(C64,NAN);
    335299
    336300    default: {
     
    347311}
    348312
    349 int psImageClipComplexRegion(psImage* input,
    350                              double complex min,
    351                              double complex vmin,
    352                              double complex max,
    353                              double complex vmax)
    354 {
    355     psS32 numClipped = 0;
    356     psU32 numRows;
    357     psU32 numCols;
    358     psF64 realMin = creal(min);
    359     psF64 imagMin = cimag(min);
    360     psF64 realMax = creal(max);
    361     psF64 imagMax = cimag(max);
    362 
    363     if (input == NULL) {
    364         psError(PS_ERR_BAD_PARAMETER_NULL, true,
    365                 _("Can not operate on a NULL psImage."));
    366         return 0;
    367     }
    368 
    369     if (realMax < realMin) {
    370         psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    371                 _("Specified real-portion of min value, %g, can not be greater than the real-portion of max value, %g."),
    372                 (double)realMin, (double)realMax);
    373         return 0;
    374     }
    375     if (imagMax < imagMin) {
    376         psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    377                 _("Specified imaginary-portion of min value, %g, can not be greater than the imaginary-portion of max value, %g."),
    378                 (double)imagMin, (double)imagMax);
    379         return 0;
    380     }
    381 
    382     numRows = input->numRows;
    383     numCols = input->numCols;
    384 
    385     #define psImageClipComplexRegionCase(type,realfcn,imagfcn) \
    386 case PS_TYPE_##type: { \
    387         if (realfcn(vmin) < PS_MIN_##type || imagfcn(vmin) < PS_MIN_##type || \
    388                 realfcn(vmin) > PS_MAX_##type || imagfcn(vmin) > PS_MAX_##type ) { \
    389             psError(PS_ERR_BAD_PARAMETER_VALUE, true, \
    390                     _("Specified %s value, %g%+gi, is not the the range of input psImage's valid pixel values (%s), i.e. [%g:%g]."), \
    391                     "vmin", creal(vmin), cimag(vmin), \
    392                     PS_TYPE_##type##_NAME, PS_MIN_##type, PS_MAX_##type); \
    393             break; \
    394         } \
    395         if (realfcn(vmax) > PS_MAX_##type || imagfcn(vmax) > PS_MAX_##type || \
    396                 realfcn(vmax) < PS_MIN_##type || imagfcn(vmax) < PS_MIN_##type ) { \
    397             psError(PS_ERR_BAD_PARAMETER_VALUE, true, \
    398                     _("Specified %s value, %g%+gi, is not the the range of input psImage's valid pixel values (%s), i.e. [%g:%g]."), \
    399                     "vmax", creal(vmax), cimag(vmax), \
    400                     PS_TYPE_##type##_NAME, PS_MIN_##type, PS_MAX_##type); \
    401             break; \
    402         } \
    403         for (psU32 row = 0;row<numRows;row++) { \
    404             ps##type* inputRow = input->data.type[row]; \
    405             for (psU32 col = 0; col < numCols; col++) { \
    406                 if ( (realfcn(inputRow[col]) > realMax) || (imagfcn(inputRow[col]) > imagMax) ) { \
    407                     inputRow[col] = (ps##type)vmax; \
    408                     numClipped++; \
    409                 } else if ( (realfcn(inputRow[col]) < realMin) || (imagfcn(inputRow[col]) < imagMin) ){ \
    410                     inputRow[col] = (ps##type)vmin; \
    411                     numClipped++; \
    412                 } \
    413             } \
    414         } \
    415     } \
    416     break;
    417 
    418     switch (input->type.type) {
    419 
    420         psImageClipComplexRegionCase(C32, crealf, cimagf)
    421         psImageClipComplexRegionCase(C64, creal, cimag)
    422 
    423     default: {
    424             char* typeStr;
    425             PS_TYPE_NAME(typeStr,input->type.type);
    426             psError(PS_ERR_BAD_PARAMETER_TYPE, true,
    427                     _("Specified psImage type, %s, is not supported."),
    428                     typeStr);
    429         }
    430     }
    431 
    432     return numClipped;
    433 }
  • trunk/psLib/src/imageops/psImagePixelManip.h

    r11248 r12431  
    55 * @author Robert DeSonia, MHPCC
    66 *
    7  * @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
    8  * @date $Date: 2007-01-23 22:47:23 $
     7 * @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
     8 * @date $Date: 2007-03-14 00:39:50 $
    99 *
    1010 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2626 *  All pixels with values less than min are set to the value vmin.  all pixels
    2727 *  with values greater than max are set to the value vmax. This function is
    28  *  defined for psU8, psU16, psS8, psS16, psF32, psF64, psC32, and psC64.
     28 *  defined for psU8, psU16, psS8, psS16, psF32, psF64.
    2929 *
    3030 *  @return int     The number of clipped pixels
     
    3838);
    3939
    40 /** Clip image values outside of a specified complex region
    41  *
    42  *  All pixels outside of the rectangular region in complex space formed by
    43  *  the min and max input parameters are set to the value vmax (if either
    44  *  the real or imaginary portion exceeds the respective max values), or vmin.
    45  *  This function is defined for psC32, and psC64 imagery only.
    46  *
    47  *  @return int     The number of clipped pixels
    48  */
    49 int psImageClipComplexRegion(
    50     psImage* input,                    ///< the image to clip
    51     double complex min,                ///< the minimum image value allowed
    52     double complex vmin,               ///< the value pixels < min are set to
    53     double complex max,                ///< the maximum image value allowed
    54     double complex vmax                ///< the value pixels > max are set to
    55 );
    56 
    5740/** Clip NaN image pixels to given value.
    5841 *
    5942 *  Pixels with NaN, +Inf, or -Inf values are set to the specified value. This
    60  *  function is defined for psF32, psF64, psC32, and psC64.
     43 *  function is defined for psF32, psF64.
    6144 *
    6245 *  @return int     The number of clipped pixels
     
    7457 *  OVERLAY value to image value), "-" (subtract OVERLAY from image), "*"
    7558 *  (multiply OVERLAY times image), "/" (divide image by OVERLAY).  This
    76  *  function is defined for psU8, psS8, psS16, psF32, psF64, psC32, and psC64.
     59 *  function is defined for psU8, psS8, psS16, psF32, psF64.
    7760 *
    7861 *  @return int         0 if success, non-zero if failed.
  • trunk/psLib/src/imageops/psImageStats.c

    r11760 r12431  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.105 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2007-02-13 03:08:17 $
     11 *  @version $Revision: 1.106 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2007-03-14 00:39:50 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    634634    case PS_TYPE_F32:
    635635    case PS_TYPE_F64:
    636     case PS_TYPE_C32:
    637     case PS_TYPE_C64:
    638636    default:
    639637        // XXX this should include the mask type (as a string)
  • trunk/psLib/src/imageops/psImageStructManip.c

    r10999 r12431  
    88 *  @author Robert DeSonia, MHPCC
    99 *
    10  *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2007-01-09 22:38:52 $
     10 *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2007-03-14 00:39:50 $
    1212 *
    1313 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    239239            PSIMAGE_ELEMENT_COPY(input,F64,OUT,OUTTYPE,elements); \
    240240            break; \
    241         case PS_TYPE_C32: \
    242             PSIMAGE_ELEMENT_COPY(input,C32,OUT,OUTTYPE,elements); \
    243             break; \
    244         case PS_TYPE_C64: \
    245             PSIMAGE_ELEMENT_COPY(input,C64,OUT,OUTTYPE,elements); \
    246             break; \
    247241        default: \
    248242            break; \
     
    280274    case PS_TYPE_F64:
    281275        PSIMAGE_COPY_CASE(output, F64);
    282         break;
    283     case PS_TYPE_C32:
    284         PSIMAGE_COPY_CASE(output, C32);
    285         break;
    286     case PS_TYPE_C64:
    287         PSIMAGE_COPY_CASE(output, C64);
    288276        break;
    289277    default: {
  • trunk/psLib/src/imageops/psImageStructManip.h

    r11248 r12431  
    55*  @author Robert DeSonia, MHPCC
    66*
    7 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
    8 *  @date $Date: 2007-01-23 22:47:23 $
     7*  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
     8*  @date $Date: 2007-03-14 00:39:50 $
    99*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
    1010*/
     
    2929 *  parent image in that dimension. The entire subraster must be contained within the raster of
    3030 *  the parent image. Note that the refCounter for the parent should be incremented.  This
    31  *  function must be defined for the following types: psU8, psU16, psS8, psS16, psF32, psF64,
    32  *  psC32, psC64.
     31 *  function must be defined for the following types: psU8, psU16, psS8, psS16, psF32, psF64.
    3332 *
    3433 *  @return psImage* : Pointer to psImage.
  • trunk/psLib/src/math/psBinaryOp.c

    r10999 r12431  
    3030 *  @author Robert DeSonia, MHPCC
    3131 *
    32  *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
    33  *  @date $Date: 2007-01-09 22:38:52 $
     32 *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
     33 *  @date $Date: 2007-03-14 00:39:50 $
    3434 *
    3535 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    323323    DIM1##_##DIM2(OUT,IN1,OP,IN2,F64);                                                                       \
    324324    break;                                                                                                   \
    325 case PS_TYPE_C32:                                                                                            \
    326     DIM1##_##DIM2(OUT,IN1,OP,IN2,C32);                                                                       \
    327     break;                                                                                                   \
    328 case PS_TYPE_C64:                                                                                            \
    329     DIM1##_##DIM2(OUT,IN1,OP,IN2,C64);                                                                       \
    330     break;                                                                                                   \
    331 default:                                                                                                     \
    332     /* char* strType;                                                                                        \
    333     PS_TYPE_NAME(strType,IN1->type);                                                                         \
    334     psError(PS_ERR_BAD_PARAMETER_TYPE, true,                                                                 \
    335             _("Specified data type, %s, is not supported."),                                                             \
    336             strType);  */                                                                                    \
    337     if (OUT != IN1 && OUT != IN2) {                                                                          \
    338         psFree(OUT);                                                                                         \
     325default: {                                                                                                   \
     326        char* strType;                                                                                       \
     327        PS_TYPE_NAME(strType,IN1->type);                                                                     \
     328        psError(PS_ERR_BAD_PARAMETER_TYPE, true,                                                             \
     329                _("Specified data type, %s, is not supported."),                                             \
     330                strType);                                                                                    \
     331        if (OUT != IN1 && OUT != IN2) {                                                                      \
     332            psFree(OUT);                                                                                     \
     333        }                                                                                                    \
     334        return NULL;                                                                                         \
    339335    }                                                                                                        \
    340     return NULL;                                                                                             \
    341336}
    342337
     
    364359    } else {                                                                                                 \
    365360        psError(PS_ERR_BAD_PARAMETER_VALUE, true,                                                            \
    366                 "Types (%x,%x) are not appropriate for logical OR.\n", IN1->type, IN2->type);               \
     361                "Types (%x,%x) are not appropriate for logical OR.\n", IN1->type, IN2->type);                \
    367362        return NULL;                                                                                         \
    368363    }                                                                                                        \
    369364} else if (!strncmp(OP, "^", 1)) {                                                                           \
    370     if (PS_IS_PSELEMTYPE_COMPLEX(IN1->type)) {                                                               \
    371         BINARY_TYPE(DIM1,DIM2,OUT,IN1,cpow(*i1,*i2),IN2);                                                    \
    372     } else {                                                                                                 \
    373         BINARY_TYPE(DIM1,DIM2,OUT,IN1,pow(*i1,*i2),IN2);                                                     \
    374     }                                                                                                        \
     365    BINARY_TYPE(DIM1,DIM2,OUT,IN1,pow(*i1,*i2),IN2);                                                         \
    375366} else if (!strncmp(OP, "min", 3)) {                                                                         \
    376     if (PS_IS_PSELEMTYPE_COMPLEX(IN1->type)) {                                                               \
    377         psError(PS_ERR_BAD_PARAMETER_VALUE, true,                                                            \
    378                 _("The minimum operation is not supported with complex data."));                                                  \
    379         if (OUT != IN1 && OUT != IN2) {                                                                      \
    380             psFree(OUT);                                                                                     \
    381         }                                                                                                    \
    382         return NULL;                                                                                         \
    383     } else {                                                                                                 \
    384         BINARY_TYPE(DIM1,DIM2,OUT,IN1,fmin(*i1,*i2),IN2);                                                    \
    385     }                                                                                                        \
     367    BINARY_TYPE(DIM1,DIM2,OUT,IN1,fmin(*i1,*i2),IN2);                                                        \
    386368} else if (!strncmp(OP, "max", 3)) {                                                                         \
    387     if (PS_IS_PSELEMTYPE_COMPLEX(IN1->type)) {                                                               \
    388         psError(PS_ERR_BAD_PARAMETER_VALUE, true,                                                            \
    389                 _("The maximum operation is not supported with complex data."));                                                  \
    390         if (OUT != IN1 && OUT != IN2) {                                                                      \
    391             psFree(OUT);                                                                                     \
    392         }                                                                                                    \
    393         return NULL;                                                                                         \
    394     } else {                                                                                                 \
    395         BINARY_TYPE(DIM1,DIM2,OUT,IN1,fmax(*i1,*i2),IN2);                                                    \
    396     }                                                                                                        \
     369    BINARY_TYPE(DIM1,DIM2,OUT,IN1,fmax(*i1,*i2),IN2);                                                        \
    397370} else {                                                                                                     \
    398371    psError(PS_ERR_BAD_PARAMETER_VALUE, true,                                                                \
    399             _("Specified operation, %s, is not supported."),                                                     \
     372            _("Specified operation, %s, is not supported."),                                                 \
    400373            OP);                                                                                             \
    401374    if (OUT != IN1 && OUT != IN2) {                                                                          \
  • trunk/psLib/src/math/psUnaryOp.c

    r10999 r12431  
    3131 *  @author Robert DeSonia, MHPCC
    3232 *
    33  *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    34  *  @date $Date: 2007-01-09 22:38:53 $
     33 *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     34 *  @date $Date: 2007-03-14 00:39:50 $
    3535 *
    3636 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    4545 ******************************************************************************/
    4646#include <string.h>
    47 #include <complex.h>
    4847#include <math.h>
    4948#include <stdint.h>
     
    123122#define UNARY_TYPE(DIM,OUT,IN,OP) \
    124123switch (IN->type) { \
     124case PS_TYPE_U8: \
     125    DIM(OUT,IN,OP,U8); \
     126    break; \
     127case PS_TYPE_U16: \
     128    DIM(OUT,IN,OP,U16); \
     129    break; \
     130case PS_TYPE_U32: \
     131    DIM(OUT,IN,OP,U32); \
     132    break; \
     133case PS_TYPE_U64: \
     134    DIM(OUT,IN,OP,U64); \
     135    break; \
     136case PS_TYPE_S8: \
     137    DIM(OUT,IN,OP,S8); \
     138    break; \
     139case PS_TYPE_S16: \
     140    DIM(OUT,IN,OP,S16); \
     141    break; \
    125142case PS_TYPE_S32: \
    126143    DIM(OUT,IN,OP,S32); \
    127144    break; \
     145case PS_TYPE_S64: \
     146    DIM(OUT,IN,OP,S64); \
     147    break; \
    128148case PS_TYPE_F32: \
    129149    DIM(OUT,IN,OP,F32); \
     
    131151case PS_TYPE_F64: \
    132152    DIM(OUT,IN,OP,F64); \
    133     break; \
    134 case PS_TYPE_C32: \
    135     DIM(OUT,IN,OP,C32); \
    136     break; \
    137 case PS_TYPE_S8: \
    138     DIM(OUT,IN,OP,C32); \
    139     break; \
    140 case PS_TYPE_U8: \
    141     DIM(OUT,IN,OP,C32); \
    142     break; \
    143 case PS_TYPE_S16: \
    144     DIM(OUT,IN,OP,C32); \
    145     break; \
    146 case PS_TYPE_U16: \
    147     DIM(OUT,IN,OP,C32); \
    148     break; \
    149 case PS_TYPE_U32: \
    150     DIM(OUT,IN,OP,C32); \
    151     break; \
    152 case PS_TYPE_S64: \
    153     DIM(OUT,IN,OP,C32); \
    154     break; \
    155 case PS_TYPE_U64: \
    156     DIM(OUT,IN,OP,C32); \
    157     break; \
    158 case PS_TYPE_C64: \
    159     DIM(OUT,IN,OP,C32); \
    160153    break; \
    161154default: { \
     
    174167#define UNARY_OP(DIM,OUT,IN,OP) \
    175168if(!strncmp(OP, "abs", 3)) { \
    176     if(PS_IS_PSELEMTYPE_COMPLEX(IN->type)) { \
    177         UNARY_TYPE(DIM,OUT,IN,cabs((double complex)*i1)); \
    178     } else { \
    179         UNARY_TYPE(DIM,OUT,IN,fabs((double)*i1)); \
    180     } \
     169    UNARY_TYPE(DIM,OUT,IN,fabs((double)*i1)); \
    181170} else if(!strncmp(OP, "sqrt", 4)) { \
    182     if(PS_IS_PSELEMTYPE_COMPLEX(IN->type)) { \
    183         UNARY_TYPE(DIM,OUT,IN,csqrt((double complex)*i1)); \
    184     } else { \
    185         UNARY_TYPE(DIM,OUT,IN,sqrt((double)*i1)); \
    186     } \
     171    UNARY_TYPE(DIM,OUT,IN,sqrt((double)*i1)); \
    187172} else if(!strncmp(OP, "exp", 3)) { \
    188     if(PS_IS_PSELEMTYPE_COMPLEX(IN->type)) { \
    189         UNARY_TYPE(DIM,OUT,IN,cexp((double complex)*i1)); \
    190     } else { \
    191         UNARY_TYPE(DIM,OUT,IN,exp((double)*i1)); \
    192     } \
     173    UNARY_TYPE(DIM,OUT,IN,exp((double)*i1)); \
    193174} else if(!strncmp(OP, "ln", 2)) { \
    194     if(PS_IS_PSELEMTYPE_COMPLEX(IN->type)) { \
    195         UNARY_TYPE(DIM,OUT,IN,clog((double complex)*i1)); \
    196     } else { \
    197         UNARY_TYPE(DIM,OUT,IN,log((double)*i1)); \
    198     } \
     175    UNARY_TYPE(DIM,OUT,IN,log((double)*i1)); \
    199176} else if(!strncmp(OP, "ten", 3)) { \
    200     if(PS_IS_PSELEMTYPE_COMPLEX(IN->type)) { \
    201         UNARY_TYPE(DIM,OUT,IN,cpow(10.0,(double complex)*i1)); \
    202     } else { \
    203         UNARY_TYPE(DIM,OUT,IN,pow(10.0,(double)*i1)); \
    204     } \
     177    UNARY_TYPE(DIM,OUT,IN,pow(10.0,(double)*i1)); \
    205178} else if(!strncmp(OP, "log", 3)) { \
    206     if(PS_IS_PSELEMTYPE_COMPLEX(IN->type)) { \
    207         UNARY_TYPE(DIM,OUT,IN,clog((double complex)*i1)/log(10.0)); \
    208     } else { \
    209         UNARY_TYPE(DIM,OUT,IN,log10((double)*i1)); \
    210     } \
     179    UNARY_TYPE(DIM,OUT,IN,log10((double)*i1)); \
    211180} else if(!strncmp(OP, "sin", 3)) { \
    212     if(PS_IS_PSELEMTYPE_COMPLEX(IN->type)) { \
    213         UNARY_TYPE(DIM,OUT,IN,csin((double complex)*i1)); \
    214     } else { \
    215         UNARY_TYPE(DIM,OUT,IN,sin((double)*i1)); \
    216     } \
     181    UNARY_TYPE(DIM,OUT,IN,sin((double)*i1)); \
    217182} else if(!strncmp(OP, "dsin", 4)) { \
    218     if(PS_IS_PSELEMTYPE_COMPLEX(IN->type)) { \
    219         UNARY_TYPE(DIM,OUT,IN,csin((double complex)*i1*D2R)); \
    220     } else { \
    221         UNARY_TYPE(DIM,OUT,IN,sin((double)*i1*D2R)); \
    222     } \
     183    UNARY_TYPE(DIM,OUT,IN,sin((double)*i1*D2R)); \
    223184} else if(!strncmp(OP, "cos", 3)) { \
    224     if(PS_IS_PSELEMTYPE_COMPLEX(IN->type)) { \
    225         UNARY_TYPE(DIM,OUT,IN,ccos((double complex)*i1)); \
    226     } else { \
    227         UNARY_TYPE(DIM,OUT,IN,cos((double)*i1)); \
    228     } \
     185    UNARY_TYPE(DIM,OUT,IN,cos((double)*i1)); \
    229186} else if(!strncmp(OP, "dcos", 4)) { \
    230     if(PS_IS_PSELEMTYPE_COMPLEX(IN->type)) { \
    231         UNARY_TYPE(DIM,OUT,IN,ccos((double complex)*i1*D2R)); \
    232     } else { \
    233         UNARY_TYPE(DIM,OUT,IN,cos((double)*i1*D2R)); \
    234     } \
     187    UNARY_TYPE(DIM,OUT,IN,cos((double)*i1*D2R)); \
    235188} else if(!strncmp(OP, "tan", 3)) { \
    236     if(PS_IS_PSELEMTYPE_COMPLEX(IN->type)) { \
    237         UNARY_TYPE(DIM,OUT,IN,ctan((double complex)*i1)); \
    238     } else { \
    239         UNARY_TYPE(DIM,OUT,IN,tan((double)*i1)); \
    240     } \
     189    UNARY_TYPE(DIM,OUT,IN,tan((double)*i1)); \
    241190} else if(!strncmp(OP, "dtan", 4)) { \
    242     if(PS_IS_PSELEMTYPE_COMPLEX(IN->type)) { \
    243         UNARY_TYPE(DIM,OUT,IN,ctan((double complex)*i1*D2R)); \
    244     } else { \
    245         UNARY_TYPE(DIM,OUT,IN,tan((double)*i1*D2R)); \
    246     } \
     191    UNARY_TYPE(DIM,OUT,IN,tan((double)*i1*D2R)); \
    247192} else if(!strncmp(OP, "asin", 4)) { \
    248     if(PS_IS_PSELEMTYPE_COMPLEX(IN->type)) { \
    249         UNARY_TYPE(DIM,OUT,IN,casin((double complex)*i1)); \
    250     } else { \
    251         UNARY_TYPE(DIM,OUT,IN,asin((double)*i1)); \
    252     } \
     193    UNARY_TYPE(DIM,OUT,IN,asin((double)*i1)); \
    253194} else if(!strncmp(OP, "dasin", 5)) { \
    254     if(PS_IS_PSELEMTYPE_COMPLEX(IN->type)) { \
    255         UNARY_TYPE(DIM,OUT,IN,R2D*casin((double complex)*i1)); \
    256     } else { \
    257         UNARY_TYPE(DIM,OUT,IN,(R2D*asin((double)*i1))); \
    258     } \
     195    UNARY_TYPE(DIM,OUT,IN,(R2D*asin((double)*i1))); \
    259196} else if(!strncmp(OP, "acos", 4)) { \
    260     if(PS_IS_PSELEMTYPE_COMPLEX(IN->type)) { \
    261         UNARY_TYPE(DIM,OUT,IN,cacos((double complex)*i1)); \
    262     } else { \
    263         UNARY_TYPE(DIM,OUT,IN,acos((double)*i1)); \
    264     } \
     197    UNARY_TYPE(DIM,OUT,IN,acos((double)*i1)); \
    265198} else if(!strncmp(OP, "dacos", 5)) { \
    266     if(PS_IS_PSELEMTYPE_COMPLEX(IN->type)) { \
    267         UNARY_TYPE(DIM,OUT,IN,R2D*cacos((double complex)*i1)); \
    268     } else { \
    269         UNARY_TYPE(DIM,OUT,IN,R2D*acos((double)*i1)); \
    270     } \
     199    UNARY_TYPE(DIM,OUT,IN,R2D*acos((double)*i1)); \
    271200} else if(!strncmp(OP, "atan", 4)) { \
    272     if(PS_IS_PSELEMTYPE_COMPLEX(IN->type)) { \
    273         UNARY_TYPE(DIM,OUT,IN,catan((double complex)*i1)); \
    274     } else { \
    275         UNARY_TYPE(DIM,OUT,IN,atan((double)*i1)); \
    276     } \
     201    UNARY_TYPE(DIM,OUT,IN,atan((double)*i1)); \
    277202} else if(!strncmp(OP, "datan", 5)) { \
    278     if(PS_IS_PSELEMTYPE_COMPLEX(IN->type)) { \
    279         UNARY_TYPE(DIM,OUT,IN,R2D*catan((double complex)*i1)); \
    280     } else { \
    281         UNARY_TYPE(DIM,OUT,IN,R2D*atan((double)*i1)); \
    282     } \
     203    UNARY_TYPE(DIM,OUT,IN,R2D*atan((double)*i1)); \
    283204} else { \
    284205    psError(PS_ERR_BAD_PARAMETER_VALUE, true, _("Specified operation, %s, is not supported."), OP); \
  • trunk/psLib/src/mathtypes/psImage.c

    r12381 r12431  
    99 *  @author Ross Harman, MHPCC
    1010 *
    11  *  @version $Revision: 1.124 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2007-03-09 20:16:40 $
     11 *  @version $Revision: 1.125 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2007-03-14 00:39:50 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3131#include "psString.h"
    3232
    33 
    34 
    35 #define SQUARE(x) ((x)*(x))
    36 #define MIN(x,y) (((x) > (y)) ? (y) : (x))
    37 #define MAX(x,y) (((x) > (y)) ? (x) : (y))
    3833
    3934static void imageFree(psImage* image)
     
    209204                int x,
    210205                int y,
    211                 double complex value)
     206                double value)
    212207{
    213208    PS_ASSERT_IMAGE_NON_NULL(image, false);
     
    276271        IMAGE_SET_CASE(F32);
    277272        IMAGE_SET_CASE(F64);
    278         IMAGE_SET_CASE(C32);
    279         IMAGE_SET_CASE(C64);
    280273    default:
    281274        psError(PS_ERR_BAD_PARAMETER_TYPE, true, "Invalid psImage Data Type\n");
     
    286279}
    287280
    288 double complex psImageGet(const psImage *image,
     281double psImageGet(const psImage *image,
    289282                          int x,
    290283                          int y)
     
    354347        IMAGE_GET_CASE(F32);
    355348        IMAGE_GET_CASE(F64);
    356         IMAGE_GET_CASE(C32);
    357         IMAGE_GET_CASE(C64);
    358349    default:
    359350        psError(PS_ERR_BAD_PARAMETER_TYPE, true, "Invalid psImage Data Type\n");
     
    485476            PSIMAGE_BUFFER_COPY(F64,OUTTYPE); \
    486477            break; \
    487         case PS_TYPE_C32: \
    488             PSIMAGE_BUFFER_COPY(C32,OUTTYPE); \
    489             break; \
    490         case PS_TYPE_C64: \
    491             PSIMAGE_BUFFER_COPY(C64,OUTTYPE); \
    492             break; \
    493478        default: \
    494479            break; \
     
    526511    case PS_TYPE_F64:
    527512        PSIMAGE_BUFFER_COPY_CASE(output, F64);
    528         break;
    529     case PS_TYPE_C32:
    530         PSIMAGE_BUFFER_COPY_CASE(output, C32);
    531         break;
    532     case PS_TYPE_C64:
    533         PSIMAGE_BUFFER_COPY_CASE(output, C64);
    534513        break;
    535514    default: {
     
    593572}
    594573
    595 double complex psImagePixelInterpolate(const psImage* input,
     574double psImagePixelInterpolate(const psImage* input,
    596575                                       float x,
    597576                                       float y,
    598577                                       const psImage* mask,
    599578                                       psMaskType maskVal,
    600                                        double complex unexposedValue,
     579                                       double unexposedValue,
    601580                                       psImageInterpolateMode mode)
    602581{
     
    660639        PSIMAGE_PIXEL_INTERPOLATE_CASE(F32);
    661640        PSIMAGE_PIXEL_INTERPOLATE_CASE(F64);
    662         PSIMAGE_PIXEL_INTERPOLATE_CASE(C32);
    663         PSIMAGE_PIXEL_INTERPOLATE_CASE(C64);
    664641    default: {
    665642            char* typeStr;
     
    729706        float y, \
    730707        const psImage* mask, \
    731         psU32 maskVal, \
     708        psMaskType maskVal, \
    732709        RETURNTYPE unexposedValue) \
    733710{ \
     
    759736PSIMAGE_PIXEL_INTERPOLATE_FLAT(F32,psF64)
    760737PSIMAGE_PIXEL_INTERPOLATE_FLAT(F64,psF64)
    761 PSIMAGE_PIXEL_INTERPOLATE_FLAT(C32,psC64)
    762 PSIMAGE_PIXEL_INTERPOLATE_FLAT(C64,psC64)
    763738
    764739#define PSIMAGE_PIXEL_INTERPOLATE_BILINEAR(TYPE, RETURNTYPE, SUFFIX, FRACFUNC) \
     
    768743        float y, \
    769744        const psImage* mask, \
    770         psU32 maskVal, \
     745        psMaskType maskVal, \
    771746        RETURNTYPE unexposedValue) \
    772747{ \
    773748    int floorX = floor((x) - 0.5); \
    774749    int floorY = floor((y) - 0.5); \
    775     psF64 fracX = x - 0.5 - floorX; \
    776     psF64 fracY = y - 0.5 - floorY; \
    777     psS32 lastX = input->numCols - 1; \
    778     psS32 lastY = input->numRows - 1; \
    779     ps##TYPE V00 = 0; \
    780     ps##TYPE V01 = 0; \
    781     ps##TYPE V10 = 0; \
    782     ps##TYPE V11 = 0; \
    783     bool valid00 = false; \
    784     bool valid01 = false; \
    785     bool valid10 = false; \
    786     bool valid11 = false; \
     750    float fracX = x - 0.5 - floorX; \
     751    float fracY = y - 0.5 - floorY; \
     752    int lastX = input->numCols - 1; \
     753    int lastY = input->numRows - 1; \
     754    ps##TYPE V00; \
     755    ps##TYPE V01; \
     756    ps##TYPE V10; \
     757    ps##TYPE V11; \
     758    bool valid00; \
     759    bool valid01; \
     760    bool valid10; \
     761    bool valid11; \
    787762    \
    788763    if (floorY >= 0 && floorY <= lastY) { \
     
    791766            valid00 = (mask == NULL) || \
    792767                      ((mask->data.PS_TYPE_MASK_DATA[floorY][floorX] & maskVal) == 0); \
     768        } else { \
     769            valid00 = false; \
    793770        } \
    794771        if (floorX >= -1 && floorX < lastX) { \
     
    796773            valid10 = (mask == NULL) || \
    797774                      ((mask->data.PS_TYPE_MASK_DATA[floorY][floorX+1] & maskVal) == 0); \
     775        } else { \
     776            valid10 = false; \
    798777        } \
     778    } else { \
     779        valid00 = false; \
     780        valid10 = false; \
    799781    } \
    800782    if (floorY >= -1 && floorY < lastY) { \
     
    803785            valid01 = (mask == NULL) || \
    804786                      ((mask->data.PS_TYPE_MASK_DATA[floorY+1][floorX] & maskVal) == 0); \
     787        } else { \
     788            valid01 = false; \
    805789        } \
    806790        if (floorX >= -1 && floorX < lastX) { \
     
    808792            valid11 = (mask == NULL) || \
    809793                      ((mask->data.PS_TYPE_MASK_DATA[floorY+1][floorX+1] & maskVal) == 0); \
     794        } else { \
     795            valid11 = false; \
    810796        } \
     797    } else { \
     798        valid01 = false; \
     799        valid11 = false; \
    811800    } \
    812801    \
     
    814803    if (valid00 && valid10 && valid01 && valid11) { \
    815804        /* formula from the ADD */ \
    816         /* XXX this had V01 and V10 exchanged! */ \
    817805        return V00*FRACFUNC((1.0-fracX)*(1.0-fracY)) + V10*FRACFUNC(fracX*(1.0-fracY)) + \
    818806               V01*FRACFUNC(fracY*(1.0-fracX)) + V11*FRACFUNC(fracX*fracY); \
     
    864852        float y, \
    865853        const psImage* mask, \
    866         psU32 maskVal, \
     854        psMaskType maskVal, \
    867855        RETURNTYPE unexposedValue) \
    868856{ \
     
    917905PSIMAGE_PIXEL_INTERPOLATE_BILINEAR(F32,psF64,F32,)
    918906PSIMAGE_PIXEL_INTERPOLATE_BILINEAR(F64,psF64,F64,)
    919 PSIMAGE_PIXEL_INTERPOLATE_BILINEAR(C32,psC64,C32,)
    920 PSIMAGE_PIXEL_INTERPOLATE_BILINEAR(C64,psC64,C64,)
    921907
    922908PSIMAGE_PIXEL_INTERPOLATE_BICUBE(U8,psF64,U8,)
     
    930916PSIMAGE_PIXEL_INTERPOLATE_BICUBE(F32,psF64,F32,)
    931917PSIMAGE_PIXEL_INTERPOLATE_BICUBE(F64,psF64,F64,)
    932 PSIMAGE_PIXEL_INTERPOLATE_BICUBE(C32,psC64,C32,)
    933 PSIMAGE_PIXEL_INTERPOLATE_BICUBE(C64,psC64,C64,)
    934918
    935919// Variance Version
    936 PSIMAGE_PIXEL_INTERPOLATE_BILINEAR(U8,psF64,VARIANCE_U8,SQUARE)
    937 PSIMAGE_PIXEL_INTERPOLATE_BILINEAR(U16,psF64,VARIANCE_U16,SQUARE)
    938 PSIMAGE_PIXEL_INTERPOLATE_BILINEAR(U32,psF64,VARIANCE_U32,SQUARE)
    939 PSIMAGE_PIXEL_INTERPOLATE_BILINEAR(U64,psF64,VARIANCE_U64,SQUARE)
    940 PSIMAGE_PIXEL_INTERPOLATE_BILINEAR(S8,psF64,VARIANCE_S8,SQUARE)
    941 PSIMAGE_PIXEL_INTERPOLATE_BILINEAR(S16,psF64,VARIANCE_S16,SQUARE)
    942 PSIMAGE_PIXEL_INTERPOLATE_BILINEAR(S32,psF64,VARIANCE_S32,SQUARE)
    943 PSIMAGE_PIXEL_INTERPOLATE_BILINEAR(S64,psF64,VARIANCE_S64,SQUARE)
    944 PSIMAGE_PIXEL_INTERPOLATE_BILINEAR(F32,psF64,VARIANCE_F32,SQUARE)
    945 PSIMAGE_PIXEL_INTERPOLATE_BILINEAR(F64,psF64,VARIANCE_F64,SQUARE)
    946 PSIMAGE_PIXEL_INTERPOLATE_BILINEAR(C32,psC64,VARIANCE_C32,SQUARE)
    947 PSIMAGE_PIXEL_INTERPOLATE_BILINEAR(C64,psC64,VARIANCE_C64,SQUARE)
     920PSIMAGE_PIXEL_INTERPOLATE_BILINEAR(U8,psF64,VARIANCE_U8,PS_SQR)
     921PSIMAGE_PIXEL_INTERPOLATE_BILINEAR(U16,psF64,VARIANCE_U16,PS_SQR)
     922PSIMAGE_PIXEL_INTERPOLATE_BILINEAR(U32,psF64,VARIANCE_U32,PS_SQR)
     923PSIMAGE_PIXEL_INTERPOLATE_BILINEAR(U64,psF64,VARIANCE_U64,PS_SQR)
     924PSIMAGE_PIXEL_INTERPOLATE_BILINEAR(S8,psF64,VARIANCE_S8,PS_SQR)
     925PSIMAGE_PIXEL_INTERPOLATE_BILINEAR(S16,psF64,VARIANCE_S16,PS_SQR)
     926PSIMAGE_PIXEL_INTERPOLATE_BILINEAR(S32,psF64,VARIANCE_S32,PS_SQR)
     927PSIMAGE_PIXEL_INTERPOLATE_BILINEAR(S64,psF64,VARIANCE_S64,PS_SQR)
     928PSIMAGE_PIXEL_INTERPOLATE_BILINEAR(F32,psF64,VARIANCE_F32,PS_SQR)
     929PSIMAGE_PIXEL_INTERPOLATE_BILINEAR(F64,psF64,VARIANCE_F64,PS_SQR)
  • trunk/psLib/src/mathtypes/psImage.h

    r12381 r12431  
    99 * @author Joshua Hoblitt, University of Hawaii
    1010 *
    11  * @version $Revision: 1.89 $ $Name: not supported by cvs2svn $
    12  * @date $Date: 2007-03-09 20:16:40 $
     11 * @version $Revision: 1.90 $ $Name: not supported by cvs2svn $
     12 * @date $Date: 2007-03-14 00:39:51 $
    1313 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
    1414 */
     
    2020/// @{
    2121
    22 #include <complex.h>
    2322#include <stdio.h>
    2423#include "psType.h"
     
    7069        psF32** F32;                   ///< Single-precision float data.
    7170        psF64** F64;                   ///< Double-precision float data.
    72         psC32** C32;                   ///< Single-precision complex data.
    73         psC64** C64;                   ///< Double-precision complex data.
    7471        psPtr*  V;                     ///< Pointer to data.
    7572    } data;                            ///< Union for data types.
     
    143140bool psImageSet(
    144141    psImage *image,                     ///< the image to set
    145     int x,                             ///< x-position
    146     int y,                             ///< y-position
    147     double complex value               ///< specified value to set
     142    int x,                              ///< x-position
     143    int y,                              ///< y-position
     144    double value                        ///< specified value to set
    148145);
    149146
     
    152149 *  A negative value for the x or y positions means index from the end.
    153150 *
    154  *  @return complex: The value at the specified x,y position.
    155  */
    156 double complex psImageGet(
     151 *  @return double: The value at the specified x,y position.
     152 */
     153double psImageGet(
    157154    const psImage *image,              ///< the image from which to get
    158155    int x,                             ///< x-position
     
    230227/** Interpolate image pixel value given floating point coordinates.
    231228 *
    232  *  @return complex    Pixel value interpolated from image or unexposedValue if
     229 *  @return double    Pixel value interpolated from image or unexposedValue if
    233230 *                   given x,y doesn't coorespond to a valid image location
    234231 */
    235 double complex psImagePixelInterpolate(
     232double psImagePixelInterpolate(
    236233    const psImage* input,              ///< input image for interpolation
    237234    float x,                           ///< column location to derive value of
     
    239236    const psImage* mask,               ///< if not NULL, the mask of the input image
    240237    psMaskType maskVal,                ///< the mask value
    241     double complex unexposedValue,            ///< return value if x,y location is not in image.
     238    double unexposedValue,             ///< return value if x,y location is not in image.
    242239    psImageInterpolateMode mode        ///< interpolation mode
    243240);
     
    250247        float y,                       /**< row location ot derive value of */ \
    251248        const psImage* mask,           /**< if not NULL, the mask of the input image */ \
    252         psU32 maskVal,                 /**< the mask value */ \
     249        psMaskType maskVal,            /**< the mask value */ \
    253250        RETURNTYPE unexposedValue      /**< return value if x,y location is not in image. */ \
    254251                                                   );
     
    264261PIXEL_INTERPOLATE_FCN_PROTOTYPE(MODE##_S64,psF64) \
    265262PIXEL_INTERPOLATE_FCN_PROTOTYPE(MODE##_F32,psF64) \
    266 PIXEL_INTERPOLATE_FCN_PROTOTYPE(MODE##_F64,psF64) \
    267 PIXEL_INTERPOLATE_FCN_PROTOTYPE(MODE##_C32,psC64) \
    268 PIXEL_INTERPOLATE_FCN_PROTOTYPE(MODE##_C64,psC64)
     263PIXEL_INTERPOLATE_FCN_PROTOTYPE(MODE##_F64,psF64)
    269264
    270265#ifndef SWIG
  • trunk/psLib/src/mathtypes/psScalar.c

    r11697 r12431  
    88 *  @author Ross Harman, MHPCC
    99 *
    10  *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2007-02-08 02:42:46 $
     10 *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2007-03-14 00:39:51 $
    1212 *
    1313 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3434                          unsigned int lineno,
    3535                          const char *func,
    36                           double complex value,
     36                          double value,
    3737                          psElemType type)
    3838{
     
    7575    case PS_TYPE_F64:
    7676        scalar->data.F64 = (psF64) value;
    77         break;
    78     case PS_TYPE_C32:
    79         scalar->data.C32 = (psC32) value;
    80         break;
    81     case PS_TYPE_C64:
    82         scalar->data.C64 = (psC64) value;
    8377        break;
    8478    default:
     
    148142        newScalar =  p_psScalarAlloc(file, lineno, func, value->data.F64, dataType);
    149143        break;
    150     case PS_TYPE_C32:
    151         newScalar =  p_psScalarAlloc(file, lineno, func, value->data.C32, dataType);
    152         break;
    153     case PS_TYPE_C64:
    154         newScalar =  p_psScalarAlloc(file, lineno, func, value->data.C64, dataType);
    155         break;
    156144    default:
    157145        psError(PS_ERR_BAD_PARAMETER_TYPE, true,
  • trunk/psLib/src/mathtypes/psScalar.h

    r11697 r12431  
    88 * @author Joshua Hoblitt, University of Hawaii
    99 *
    10  * @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
    11  * @date $Date: 2007-02-08 02:42:46 $
     10 * @version $Revision: 1.23 $ $Name: not supported by cvs2svn $
     11 * @date $Date: 2007-03-14 00:39:51 $
    1212 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
    1313 */
     
    4141        psF32 F32;              ///< Single-precision float data.
    4242        psF64 F64;              ///< Double-precision float data.
    43         psC32 C32;              ///< Single-precision complex data.
    44         psC64 C64;              ///< Double-precision complex data.
    4543    } data;                     ///< Union for data types.
    4644}
     
    5654 *
    5755 * Uses psLib memory allocation functions to create scalar data as defined by the psType type.
    58  * Accepts a complex 64 bit float for input value, as max size, but resizes according to
    59  * correct type.
     56 * Accepts a double for input value, as max size, but resizes according to correct type.
    6057 *
    6158 * @return psScalar*   Pointer to a new psScalar.
     
    6360#ifdef DOXYGEN
    6461psScalar* psScalarAlloc(
    65     double complex value,               ///< Data to be put into psScalar
     62    double value,                       ///< Data to be put into psScalar
    6663    psElemType type                     ///< Type of data to be held by psScalar
    6764);
     
    7168    unsigned int lineno,                ///< Line number of caller
    7269    const char *func,                   ///< Function name of caller
    73     double complex value,               ///< Data to be put into psScalar
     70    double value,                       ///< Data to be put into psScalar
    7471    psElemType type                     ///< Type of data to be held by psScalar
    7572);
  • trunk/psLib/src/mathtypes/psVector.c

    r12381 r12431  
    1010*  @author Joshua Hoblitt, University of Hawaii
    1111*
    12 *  @version $Revision: 1.95 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2007-03-09 20:16:40 $
     12*  @version $Revision: 1.96 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2007-03-14 00:39:51 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3333#include "psAssert.h"
    3434#include "psString.h"
    35 
    36 typedef struct
    37 {
    38     union {
    39         psU8* U8;                      ///< Unsigned 8-bit integer data.
    40         psU16* U16;                    ///< Unsigned 16-bit integer data.
    41         psU32* U32;                    ///< Unsigned 32-bit integer data.
    42         psU64* U64;                    ///< Unsigned 64-bit integer data.
    43         psS8* S8;                      ///< Signed 8-bit integer data.
    44         psS16* S16;                    ///< Signed 16-bit integer data.
    45         psS32* S32;                    ///< Signed 32-bit integer data.
    46         psS64* S64;                    ///< Signed 64-bit integer data.
    47         psF32* F32;                    ///< Single-precision float data.
    48         psF64* F64;                    ///< Double-precision float data.
    49         psC32* C32;                    ///< Single-precision complex data.
    50         psC64* C64;                    ///< Double-precision complex data.
    51     } data;
    52     psU32 index;
    53 }
    54 indexedVector;
    55 
    56 static void vectorFree(psVector* psVec);
    5735
    5836static void vectorFree(psVector* psVec)
     
    270248            PSVECTOR_COPY_SAME_CASE(F32);
    271249            PSVECTOR_COPY_SAME_CASE(F64);
    272             PSVECTOR_COPY_SAME_CASE(C32);
    273             PSVECTOR_COPY_SAME_CASE(C64);
    274250        default: {
    275251                char* typeStr;
     
    326302            PSVECTOR_COPY(F64,OUTTYPE); \
    327303            break; \
    328         case PS_TYPE_C32: \
    329             PSVECTOR_COPY(C32,OUTTYPE); \
    330             break; \
    331         case PS_TYPE_C64: \
    332             PSVECTOR_COPY(C64,OUTTYPE); \
    333             break; \
    334304        default: { \
    335305                char* typeStr; \
     
    355325        PSVECTOR_COPY_CASE(F32);
    356326        PSVECTOR_COPY_CASE(F64);
    357         PSVECTOR_COPY_CASE(C32);
    358         PSVECTOR_COPY_CASE(C64);
    359327    default: {
    360328            char* typeStr;
     
    560528    break;
    561529
    562     #define APPEND_ELEMENTS_CASE_COMPLEX(TYPE,CREAL,CIMAG) \
    563 case PS_TYPE_##TYPE: \
    564     for (lcv=0; lcv < size && ! full; lcv++) { \
    565         snprintf(tempStr, maxLength, "%s%g%+gi", prefix, \
    566                  CREAL(vector->data.TYPE[lcv]), \
    567                  CIMAG(vector->data.TYPE[lcv])); \
    568         strncat(str,tempStr,maxLength); \
    569         full = (strlen(str) > maxLength-2); \
    570         prefix = ","; \
    571     } \
    572     break;
    573 
    574530    int lcv;
    575531    char* prefix = "[";
     
    585541        APPEND_ELEMENTS_CASE(F32,double,"%g")
    586542        APPEND_ELEMENTS_CASE(F64,double,"%g")
    587         APPEND_ELEMENTS_CASE_COMPLEX(C32,crealf,cimagf)
    588         APPEND_ELEMENTS_CASE_COMPLEX(C64,creal,cimag)
    589543    default:
    590544        snprintf(str,maxLength,"[...]");
     
    822776bool psVectorSet(psVector *input,
    823777                 long position,
    824                  double complex value)
     778                 double value)
    825779{
    826780    if (input == NULL) {
     
    880834        input->data.F64[position] = (psF64)value;
    881835        break;
    882     case PS_TYPE_C32:
    883         input->data.C32[position] = (psC32)value;
    884         break;
    885     case PS_TYPE_C64:
    886         input->data.C64[position] = (psC64)value;
    887         break;
    888836    default:
    889837        psError(PS_ERR_BAD_PARAMETER_TYPE, true, "Invalid psVector Data Type\n");
     
    894842}
    895843
    896 double complex psVectorGet(const psVector *input,
     844double psVectorGet(const psVector *input,
    897845                           long position)
    898846{
     
    941889    case PS_TYPE_F64:
    942890        return input->data.F64[position];
    943         break;
    944     case PS_TYPE_C32:
    945         return input->data.C32[position];
    946         break;
    947     case PS_TYPE_C64:
    948         return input->data.C64[position];
    949891        break;
    950892    default:
     
    992934    case PS_TYPE_F32:
    993935    case PS_TYPE_F64:
    994     case PS_TYPE_C32:
    995     case PS_TYPE_C64:
    996936    default:
    997937        psError(PS_ERR_BAD_PARAMETER_TYPE, true,
  • trunk/psLib/src/mathtypes/psVector.h

    r12381 r12431  
    1010 * @author Joshua Hoblitt, University of Hawaii
    1111 *
    12  * @version $Revision: 1.66 $ $Name: not supported by cvs2svn $
    13  * @date $Date: 2007-03-09 20:16:40 $
     12 * @version $Revision: 1.67 $ $Name: not supported by cvs2svn $
     13 * @date $Date: 2007-03-14 00:39:51 $
    1414 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
    1515 */
     
    4545        psF32* F32;                    ///< Single-precision float data.
    4646        psF64* F64;                    ///< Double-precision float data.
    47         psC32* C32;                    ///< Single-precision complex data.
    48         psC64* C64;                    ///< Double-precision complex data.
    4947    } data;
    5048    void *lock;                        ///< Optional lock for thread safety.
     
    227225/** Sort an array of floats.
    228226 *
    229  *  Sorts an array of floats in ascending order.  This function is valid for
    230  *  all non-complex data types.
     227 *  Sorts an array of floats in ascending order.
    231228 *
    232229 *  @return  psVector*     Pointer to sorted psVector.
     
    334331 */
    335332bool psVectorSet(
    336     psVector *input,                   ///< Input vector to set
    337     long position,                     ///< vector position
    338     double complex value               ///< value to set
     333    psVector *input,                    ///< Input vector to set
     334    long position,                      ///< vector position
     335    double value                        ///< value to set
    339336);
    340337
     
    344341 *  A negative position means index from the end.
    345342 *
    346  *  @return complex:        Value of the input vector at the specified position.
    347  */
    348 double complex psVectorGet(
     343 *  @return double:        Value of the input vector at the specified position.
     344 */
     345double psVectorGet(
    349346    const psVector *input,             ///< Input vector from which to get value
    350347    long position                      ///< vector position
  • trunk/psLib/src/sys/psType.h

    r11694 r12431  
    1010*  @author Ross Harman, MHPCC
    1111*
    12 *  @version $Revision: 1.56 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2007-02-08 01:59:28 $
     12*  @version $Revision: 1.57 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2007-03-14 00:39:51 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2222/// @{
    2323
    24 #include <complex.h>
    2524#include <stdint.h>
    2625#include <float.h>
     
    5049typedef float psF32;                   ///< 32-bit floating point
    5150typedef double psF64;                  ///< 64-bit floating point
    52 
    53 #ifdef SWIG
    54 /** 32-bit complex value */
    55 typedef struct
    56 {
    57     float re, im;
    58 }
    59 psC32;
    60 
    61 
    62 /** 64-bit complex value */
    63 typedef struct
    64 {
    65     double re,im;
    66 }
    67 psC64;
    68 
    69 
    70 #else // SWIG
    71 typedef float complex psC32;          ///< complex with 32-bit floating point Real and Imagary numbers
    72 typedef double complex psC64;         ///< complex with 64-bit floating point Real and Imagary numbers
    73 #endif // !SWIG
    74 
    7551typedef char* psString;                ///< string value
    7652typedef void* psPtr;                   ///< void pointer
     53
    7754// XXX psBool can't be removed until all macros that 'generate' this type are
    7855// fixed -JH
     
    9875    PS_TYPE_F32  = 0x0404,             ///< Single-precision Floating point.
    9976    PS_TYPE_F64  = 0x0408,             ///< Double-precision floating point.
    100     PS_TYPE_C32  = 0x0808,             ///< Complex numbers consisting of single-precision floating point.
    101     PS_TYPE_C64  = 0x0810,             ///< Complex numbers consisting of double-precision floating point.
    10277    PS_TYPE_BOOL = 0x1301              ///< Boolean.
    10378} psElemType;
     
    170145#define PS_MIN_F32       -FLT_MAX      /**< minimum valid psF32 value */
    171146#define PS_MIN_F64       -DBL_MAX      /**< minimum valid psF64 value */
    172 #define PS_MIN_C32       -FLT_MAX      /**< minimum valid real or imaginary psC32 value */
    173 #define PS_MIN_C64       -DBL_MAX      /**< minimum valid real or imaginary psC32 value */
    174147
    175148#define PS_MAX_S8        INT8_MAX      /**< maximum valid psS8 value */
     
    183156#define PS_MAX_F32       FLT_MAX       /**< maximum valid psF32 value */
    184157#define PS_MAX_F64       DBL_MAX       /**< maximum valid psF64 value */
    185 #define PS_MAX_C32       FLT_MAX       /**< maximum valid real or imaginary psC32 value */
    186 #define PS_MAX_C64       DBL_MAX       /**< maximum valid real or imaginary psC32 value */
    187158
    188159#define PS_TYPE_BOOL_NAME "psBool"
     
    197168#define PS_TYPE_F32_NAME  "psF32"
    198169#define PS_TYPE_F64_NAME  "psF64"
    199 #define PS_TYPE_C32_NAME  "psC32"
    200 #define PS_TYPE_C64_NAME  "psC64"
    201170
    202171#define PS_TYPE_NAME(value,type) \
     
    234203case PS_TYPE_F64: \
    235204    value = PS_TYPE_F64_NAME; \
    236     break; \
    237 case PS_TYPE_C32: \
    238     value = PS_TYPE_C32_NAME; \
    239     break; \
    240 case PS_TYPE_C64: \
    241     value = PS_TYPE_C64_NAME; \
    242205    break; \
    243206default: \
     
    261224/// Macro to determine if the psElemType is unsigned.
    262225#define PS_IS_PSELEMTYPE_UNSIGNED(x) ((x & 0x200) == 0x200)
    263 /// Macro to determine if the psElemType is a real (non-complex) floating-point type.
     226/// Macro to determine if the psElemType is a real floating-point type.
    264227#define PS_IS_PSELEMTYPE_REAL(x) ((x & 0x400) == 0x400)
    265 /// Macro to determine if the psElemType is complex number type.
    266 #define PS_IS_PSELEMTYPE_COMPLEX(x) ((x & 0x800) == 0x800)
    267228/// Macro to determine if the psElemType is boolean type.
    268229#define PS_IS_PSELEMTYPE_BOOL(x) ((x & 0x1000) == 0x1000)
  • trunk/psLib/test/imageops/tap_psImageGeomManip.c

    r12250 r12431  
    66 *  @author Robert DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2007-03-06 02:37:41 $
     8 *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2007-03-14 00:39:51 $
    1010 *
    1111 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    531531        testRollType(S16);
    532532        testRollType(F64);
    533         testRollType(C32);
    534         testRollType(C64);
    535533        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    536534    }
  • trunk/psLib/test/imageops/tap_psImageInterpolate.c

    r11398 r12431  
    55 * @author Eric Van Alst, MHPCC
    66 *
    7  * @version $Revision: 1.1 $
     7 * @version $Revision: 1.2 $
    88 *          $Name: not supported by cvs2svn $
    9  * @date $Date: 2007-01-30 00:13:01 $
     9 * @date $Date: 2007-03-14 00:39:51 $
    1010 *
    1111 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6868    CHECK_INTERP_BY_TYPE(F32)
    6969    CHECK_INTERP_BY_TYPE(F64)
    70     CHECK_INTERP_BY_TYPE(C32)
    71     CHECK_INTERP_BY_TYPE(C64)
    7270
    7371    // testInterpolateError(void)
  • trunk/psLib/test/imageops/tap_psImagePixelManip.c

    r12405 r12431  
    66 *  @author Robert DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2007-03-12 20:46:45 $
     8 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2007-03-14 00:39:51 $
    1010 *
    1111 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    9696        }
    9797
    98         #define testImageClipByComplexType(datatype) \
    99         { \
    100             psU32 c = 128; \
    101             psU32 r = 256; \
    102             psF64 min; \
    103             psF64 max; \
    104             psS32 numClipped = 0; \
    105             psS32 retVal; \
    106             psMemId id = psMemGetId(); \
    107             psImage *img = psImageAlloc(c,r,PS_TYPE_##datatype); \
    108             for (psU32 row=0;row<r;row++) { \
    109                 ps##datatype* imgRow = img->data.datatype[row]; \
    110                 for (psU32 col=0;col<c;col++) { \
    111                     imgRow[col] = (ps##datatype)(row+I*col); \
    112                 } \
    113             } \
    114             min = (float)r/2.0f; \
    115             max = (float)r; \
    116             \
    117             retVal = psImageClip(img,min,-1.0f,max,-2.0f); \
    118             \
    119             numClipped = 0; \
    120             bool errorFlag = false; \
    121             for (psU32 row=0;row<r;row++) { \
    122                 ps##datatype* imgRow = img->data.datatype[row]; \
    123                 for (psU32 col=0;col<c;col++) { \
    124                     ps##datatype value = row+I*col; \
    125                     if (cabs(value) < min) { \
    126                         numClipped++; \
    127                         value = -1.0f; \
    128                     } else if (cabs(value) > max) { \
    129                         numClipped++; \
    130                         value = -2.0f; \
    131                     } \
    132                     if (fabsf(creal(imgRow[col])-creal(value)) > FLT_EPSILON || \
    133                             fabsf(cimag(imgRow[col])-cimag(value)) > FLT_EPSILON) { \
    134                         diag("Pixel value is not as expected (%.2f+%.2fi vs %.2f+%.2fi) at %u,%u", \
    135                              creal(imgRow[col]),cimag(imgRow[col]),creal(value),cimag(value),col,row); \
    136                         errorFlag = true; \
    137                     } \
    138                 } \
    139             } \
    140             ok(!errorFlag, "psImageClip() produced the correct data values"); \
    141             ok(retVal == numClipped, "Got the expected number of clips"); \
    142             psFree(img); \
    143             ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); \
    144         }
    145 
    14698        testImageClipByType(F64);
    14799        testImageClipByType(F32);
     
    152104        testImageClipByType(U16);
    153105        testImageClipByType(U8);
    154         testImageClipByComplexType(C32);
    155         testImageClipByComplexType(C64);
    156 
    157106
    158107        psF64 min=0.0;
     
    241190        testImageClipNaNByType(F32);
    242191        testImageClipNaNByType(F64);
    243         testImageClipNaNByType(C32);
    244         testImageClipNaNByType(C64);
    245192
    246193        // Verify the retuned integer is zero, psImage structure input is unmodified
     
    251198
    252199        // Verify program execution doesn't stop if the input image type is something
    253         // other than F32, F64, C32, C64.
     200        // other than F32, F64.
    254201        img = psImageAlloc(c,r,PS_TYPE_S32);
    255202        // Following should be an error (incorrect type)
     
    260207        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    261208    }
    262 
    263 
    264     // testImageClipComplexRegion()
    265     {
    266         psMemId id = psMemGetId();
    267         psImage* img = NULL;
    268         psU32 c = 1024;
    269         psU32 r = 2048;
    270         psS32 numClipped = 0;
    271         psS32 retVal;
    272 
    273         // psImageClipNaN shall modified pixel values of NaN with a specified value
    274 
    275         // 1. Create a complex image with a wide range of complex values
    276         //
    277         // 2. call psImageClipComplexRegion with min and max where there is at least
    278         //    2 pixels in the image above) that is:
    279         //   a) real(p) < real(min) && complex(p) < complex(min),
    280         //   b) real(p) < real(min) && complex(min) < complex(p) < complex(max)
    281         //   c) real(min) < real(p) < real(max) && complex(p) < complex(min)
    282         //   d) real(min) < real(p) < real(max) && complex(min) < complex(p) < complex(max)
    283         //   e) real(p) > real(max) && complex(min) < complex(p) < complex(max)
    284         //   f) real(pmin) < real(p) < real(max) && complex(p) > complex(max)
    285         //   g) real(p) > real(max) && complex(p) > complex(max)
    286         //   h) real(p) < real(min) && complex(p) > complex(max)
    287         //   i) real(p) > real(max) && complex(p) < complex(min)
    288         //
    289         // 3. verify that All pixels in case (a), (b), and (c) have the value vmin
    290         //
    291         // 4. verify that all pixels in case (d) are unchanged from input
    292         //
    293         // 5. verify that all pixels in case (e), (f), (g), (h), and (i) have the
    294         //    value vmax
    295         #define testImageClipComplexByType(datatype,MIN,MAX) \
    296         { \
    297             psMemId id = psMemGetId(); \
    298             img = psImageAlloc(c,r,PS_TYPE_##datatype); \
    299             for (unsigned row=0;row<r;row++) { \
    300                 ps##datatype* imgRow = img->data.datatype[row]; \
    301                 for (unsigned col=0;col<c;col++) { \
    302                     imgRow[col] = row+I*col; \
    303                 } \
    304             } \
    305             \
    306             retVal = psImageClipComplexRegion(img,MIN,-1.0-1.0*I,MAX,-2.0-2.0*I); \
    307             \
    308             numClipped = 0; \
    309             bool errorFlag = false; \
    310             for (unsigned row=0;row<r;row++) { \
    311                 ps##datatype* imgRow = img->data.datatype[row]; \
    312                 for (unsigned col=0;col<c;col++) { \
    313                     ps##datatype value = (ps##datatype)(row+I*col); \
    314                     if ( (row > creal(MAX)) || (col > cimag(MAX)) ) { \
    315                         numClipped++; \
    316                         value = -2.0-2.0*I; \
    317                     } else if ((row < creal(MIN)) || (col < cimag(MIN)) ) { \
    318                         numClipped++; \
    319                         value = -1.0-1.0*I; \
    320                     } \
    321                     if (cabs(imgRow[col]-value) > FLT_EPSILON) { \
    322                         diag("Pixel value is not as expected (%g%+gi vs %g%+gi) at %d,%d", \
    323                              creal(imgRow[col]),cimag(imgRow[col]),creal(value),cimag(value),col,row); \
    324                         errorFlag = true; \
    325                     } \
    326                 } \
    327             } \
    328             ok(!errorFlag, "psImageClip() produced the correct data values"); \
    329             ok(retVal == numClipped, "Got the expected number of clips"); \
    330             psFree(img); \
    331             ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks"); \
    332         }
    333 
    334         complex double min = ((double)r)/5.0+I*((double)c)/4.0;
    335         complex double max = ((double)r)/3.0+I*((double)c)/2.0;
    336 
    337         // Testing clipping at %g%+gi to %g%+gi for psC32, creal(min),cimag(min),creal(max),cimag(max));
    338 
    339         testImageClipComplexByType(C32,min,max);
    340 
    341         // Testing clipping at %g%+gi to %g%+gi for psC64, creal(min),cimag(min),creal(max),cimag(max));
    342         testImageClipComplexByType(C64,min,max);
    343 
    344         //  6. Call psImageClipComplexRegion with NULL input parameter; should error
    345         //     but not stop execution.
    346         // Following should be an error
    347         // XXX: Verify error
    348         retVal = psImageClipComplexRegion(NULL,0,0,0,0);
    349         ok(retVal == 0, "Expected zero return for clips of a NULL image");
    350 
    351         img = psImageAlloc(c,r,PS_TYPE_C32);
    352         for (unsigned row=0;row<r;row++)
    353         {
    354             psC32* imgRow = img->data.C32[row];
    355             for (unsigned col=0;col<c;col++) {
    356                 imgRow[col] = row+I*col;
    357             }
    358         }
    359 
    360         //  7. Call psImageClipComplexRegion with min > max; should error and return 0,
    361         //     but not stop execution
    362         // Following should be an error
    363         // XXX: Verify error
    364         retVal = psImageClipComplexRegion(img,10.0+I*1.0,-1.0,5.0+5.0*I,-2.0);
    365         ok(retVal == 0, "Expected zero return for creal(min)>creal(max)");
    366 
    367         // Following should be an error
    368         // XXX: Verify error
    369         retVal = psImageClipComplexRegion(img,1.0+I*10.0,-1.0,5.0+5.0*I,-2.0);
    370         ok(retVal == 0, "Expected zero return for cimag(min)>cimag(max)");
    371 
    372         // Following should be an error
    373         // XXX: Verify error
    374         retVal = psImageClipComplexRegion(img,10.0+I*10.0,-1.0,5.0+5.0*I,-2.0);
    375         ok(retVal == 0, "Expected zero return for min>max");
    376 
    377         //  8. Call psImageClipComplexRegion with the follow vmin/vmax values; each
    378         //     should error and return 0, but not stop execution
    379         //      a) vmin < datatype region's minimum
    380         //      b) vmax < datatype region's minimum
    381         //      c) vmin > datatype region's maximum
    382         //      d) vmax > datatype region's maximum
    383         // Following should be an error
    384         // XXX: Verify error
    385         retVal = psImageClipComplexRegion(img,
    386                                           1.0+I*1.0,
    387                                           -2.0*(double)FLT_MAX,
    388                                           5.0+5.0*I,
    389                                           0.0);
    390         ok(retVal == 0, "Expected zero return for vmin not in datatype range");
    391 
    392         // Following should be an error
    393         // XXX: Verify error
    394         retVal = psImageClipComplexRegion(img,
    395                                           1.0+I*1.0,
    396                                           2.0*(double)FLT_MAX,
    397                                           5.0+5.0*I,
    398                                           0.0);
    399         ok(retVal == 0, "Expected zero return for vmin not in datatype range");
    400 
    401         // Following should be an error
    402         // XXX: Verify error
    403         retVal = psImageClipComplexRegion(img,
    404                                           1.0+I*1.0,
    405                                           FLT_EPSILON-2.0*(double)FLT_MAX*I,
    406                                           5.0+5.0*I,
    407                                           0.0);
    408         ok(retVal == 0, "Expected zero return for vmin not in datatype range");
    409 
    410         // Following should be an error
    411         // XXX: Verify error
    412         retVal = psImageClipComplexRegion(img,
    413                                           1.0+I*1.0,
    414                                           FLT_EPSILON+2.0*(double)FLT_MAX*I,
    415                                           5.0+5.0*I,
    416                                           0.0);
    417         ok(retVal == 0, "Expected zero return for vmin not in datatype range");
    418 
    419         // Following should be an error
    420         // XXX: Verify error
    421         retVal = psImageClipComplexRegion(img,
    422                                           1.0+I*1.0,
    423                                           0.0,
    424                                           5.0+5.0*I,
    425                                           -2.0*(double)FLT_MAX);
    426         ok(retVal == 0, "Expected zero return for vmax not in datatype range");
    427 
    428         // Following should be an error
    429         // XXX: Verify error
    430         retVal = psImageClipComplexRegion(img,
    431                                           1.0+I*1.0,
    432                                           0.0,
    433                                           5.0+5.0*I,
    434                                           2.0*(double)FLT_MAX);
    435         ok(retVal == 0, "Expected zero return for vmax not in datatype range");
    436 
    437         // Following should be an error
    438         // XXX: Verify error
    439         retVal = psImageClipComplexRegion(img,
    440                                           1.0+I*1.0,
    441                                           0.0,
    442                                           5.0+5.0*I,
    443                                           FLT_EPSILON-2.0*(double)FLT_MAX*I);
    444         ok(retVal == 0, "Expected zero return for vmax not in datatype range");
    445 
    446         // Following should be an error
    447         // XXX: Verify error
    448         retVal = psImageClipComplexRegion(img,
    449                                           1.0+I*1.0,
    450                                           0.0,
    451                                           5.0+5.0*I,
    452                                           FLT_EPSILON+2.0*(double)FLT_MAX*I);
    453         ok(retVal == 0, "Expected zero return for vmax not in datatype range");
    454 
    455         // now check if vmin > vmax is OK
    456         for (unsigned row=0;row<r;row++)
    457         {
    458             psC32* imgRow = img->data.C32[row];
    459             for (unsigned col=0;col<c;col++) {
    460                 imgRow[col] = row+I*col;
    461             }
    462         }
    463         retVal = psImageClipComplexRegion(img,
    464                                           1.0+I*1.0,
    465                                           10.0,
    466                                           5.0+5.0*I,
    467                                           0.0);
    468         ok(retVal != 0, "Didn't expect zero return for vmin > vmax");
    469         psFree(img);
    470         img = NULL;
    471 
    472         //  9. Call psImageClipComplexRegion with the max value out of datatype's
    473         //     range; should clip as expected (see step 1-5). Repeat with min value
    474         //     out of datatype's range.
    475 
    476         testImageClipComplexByType(C32,-(double)FLT_MAX*2.0-I*(double)FLT_MAX*2.0,10.0+I*10.0);
    477         testImageClipComplexByType(C32,10.0+I*10.0,(double)FLT_MAX*2.0+I*(double)FLT_MAX*2.0);
    478 
    479         // Verify program execution doesn't stop if the input image type is something
    480         // other than C32, C64.
    481         img = psImageAlloc(c,r,PS_TYPE_S32);
    482         // Following should be an error (incorrect type)
    483         // XXX: Verify error
    484         retVal = psImageClipComplexRegion(img,2.0,10.0,5.0,0.0);
    485         ok(retVal == 0, "Expected zero return for clip of incorrect image type");
    486         psFree(img);
    487         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    488     }
    489 
    490209
    491210    // testImageOverlay()
     
    568287
    569288
    570         //      testOverlayType(C64);
    571         //        testOverlayType(C32);
    572289        //        testOverlayType(F64);
    573290        //        testOverlayType(F32);
  • trunk/psLib/test/math/tap_psMatrix02.c

    r10816 r12431  
    1212 *  @author  Ross Harman, MHPCC
    1313 *
    14  *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
    15  *  @date  $Date: 2006-12-20 20:02:29 $
     14 *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
     15 *  @date  $Date: 2007-03-14 00:39:51 $
    1616 *
    1717 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    5656        psMemId id = psMemGetId();
    5757        psImage *outImage = (psImage*)psImageAlloc(3, 3, PS_TYPE_F64);
    58         psImage *badImage1 = (psImage*)psImageAlloc(3, 3, PS_TYPE_C32);
     58        psImage *badImage1 = (psImage*)psImageAlloc(3, 3, PS_TYPE_U8);
    5959        psMemIncrRefCounter(outImage);
    6060        ok(psMatrixTranspose(outImage, badImage1) == NULL, "psMatrixTranspose(): inImage = outImage results in NULL return");
     
    6969        psMemId id = psMemGetId();
    7070        psImage *inImage = (psImage*)psImageAlloc(3, 3, PS_TYPE_F64);
    71         psImage *badImage1 = (psImage*)psImageAlloc(3, 3, PS_TYPE_C32);
     71        psImage *badImage1 = (psImage*)psImageAlloc(3, 3, PS_TYPE_U8);
    7272        badImage1 = psMatrixTranspose(badImage1, inImage);
    7373        ok(badImage1 != NULL, "psMatrixTranspose() results in non-NULL return");
  • trunk/psLib/test/math/tap_psMatrixVectorArithmetic01.c

    r11397 r12431  
    44 *
    55 *  This test driver tests combinations of matrix, vector, and scalar binary operations including:
    6  *     Matrix-matrix with +,-,*,/ with S32, F32, F64, C32
    7  *     Matrix-vector with +,-,*,/ with S32, F32, F64, C32
    8  *     Matrix-scalar with +,-,*,/ with S32, F32, F64, C32
     6 *     Matrix-matrix with +,-,*,/ with S32, F32, F64
     7 *     Matrix-vector with +,-,*,/ with S32, F32, F64
     8 *     Matrix-scalar with +,-,*,/ with S32, F32, F64
    99 *
    1010 *  @author  Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
    13  *  @date  $Date: 2007-01-30 00:11:31 $
     12 *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
     13 *  @date  $Date: 2007-03-14 00:39:51 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    140140    ok(errorFlag== false, "psBinaryOp(): was successful: (matrix-matrix, +, F64)");
    141141    ok(memoryFlag== false, "no memory leaks");
    142     testBinaryOpMM(+,C32,10.0+10.0i,10.0+10.0i,3,2,errorFlag,memoryFlag);
    143     ok(errorFlag== false, "psBinaryOp(): was successful: (matrix-matrix, +, C32)");
    144     ok(memoryFlag== false, "no memory leaks");
    145142    testBinaryOpMM(-,S32,20,10,3,2,errorFlag,memoryFlag);
    146143    ok(errorFlag== false, "psBinaryOp(): was successful: (matrix-matrix, -, S32)");
     
    161158    ok(errorFlag== false, "psBinaryOp(): was successful: (matrix-matrix, *, F64)");
    162159    ok(memoryFlag== false, "no memory leaks");
    163     testBinaryOpMM(*,C32,20.0+20.0i,10.0+10.0i,3,2,errorFlag,memoryFlag);
    164     ok(errorFlag== false, "psBinaryOp(): was successful: (matrix-matrix, *, C32)");
    165     ok(memoryFlag== false, "no memory leaks");
    166160    testBinaryOpMM(/,S32,20,10,3,2,errorFlag,memoryFlag);
    167161    ok(errorFlag== false, "psBinaryOp(): was successful: (matrix-matrix, /, S32)");
     
    172166    testBinaryOpMM(/,F64,20.0,10.0,3,2,errorFlag,memoryFlag);
    173167    ok(errorFlag== false, "psBinaryOp(): was successful: (matrix-matrix, /, F64)");
    174     ok(memoryFlag== false, "no memory leaks");
    175     testBinaryOpMM(/,C32,20.0+20.0i,10.0+10.0i,3,2,errorFlag,memoryFlag);
    176     ok(errorFlag== false, "psBinaryOp(): was successful: (matrix-matrix, /, C32)");
    177168    ok(memoryFlag== false, "no memory leaks");
    178169
     
    187178    ok(errorFlag== false, "psBinaryOp(): was successful: (matrix-vector, +, F64)");
    188179    ok(memoryFlag== false, "no memory leaks");
    189     testBinaryOpMV(+,C32,10.0+10.0i,5.0+5.0i,3,2,errorFlag,memoryFlag);
    190     ok(errorFlag== false, "psBinaryOp(): was successful: (matrix-vector, +, C32)");
    191     ok(memoryFlag== false, "no memory leaks");
    192180    testBinaryOpMV(-,S32,20,5,3,2,errorFlag,memoryFlag);
    193181    ok(errorFlag== false, "psBinaryOp(): was successful: (matrix-vector, -, S32)");
     
    208196    ok(errorFlag== false, "psBinaryOp(): was successful: (matrix-vector, *, F64)");
    209197    ok(memoryFlag== false, "no memory leaks");
    210     testBinaryOpMV(*,C32,20.0+20.0i,5.0+5.0i,3,2,errorFlag,memoryFlag);
    211     ok(errorFlag== false, "psBinaryOp(): was successful: (matrix-vector, *, C32)");
    212     ok(memoryFlag== false, "no memory leaks");
    213198    testBinaryOpMV(/,S32,20,5,3,2,errorFlag,memoryFlag);
    214199    ok(errorFlag== false, "psBinaryOp(): was successful: (matrix-vector, /, S32)");
     
    219204    testBinaryOpMV(/,F64,20.0,5.0,3,2,errorFlag,memoryFlag);
    220205    ok(errorFlag== false, "psBinaryOp(): was successful: (matrix-vector, /, F64)");
    221     ok(memoryFlag== false, "no memory leaks");
    222     testBinaryOpMV(/,C32,20.0+20.0i,5.0+5.0i,3,2,errorFlag,memoryFlag);
    223     ok(errorFlag== false, "psBinaryOp(): was successful: (matrix-vector, /, C32)");
    224206    ok(memoryFlag== false, "no memory leaks");
    225207
     
    234216    ok(errorFlag== false, "psBinaryOp(): was successful: (matrix-scalar, +, F64)");
    235217    ok(memoryFlag== false, "no memory leaks");
    236     testBinaryOpMS(+,C32,10.0+10.0i,5.0+5.0i,3,2,errorFlag,memoryFlag);
    237     ok(errorFlag== false, "psBinaryOp(): was successful: (matrix-scalar, +, C32)");
    238     ok(memoryFlag== false, "no memory leaks");
    239218    testBinaryOpMS(-,S32,20,5,3,2,errorFlag,memoryFlag);
    240219    ok(errorFlag== false, "psBinaryOp(): was successful: (matrix-scalar, -, S32)");
     
    255234    ok(errorFlag== false, "psBinaryOp(): was successful: (matrix-scalar, *, F64)");
    256235    ok(memoryFlag== false, "no memory leaks");
    257     testBinaryOpMS(*,C32,20.0+20.0i,5.0+5.0i,3,2,errorFlag,memoryFlag);
    258     ok(errorFlag== false, "psBinaryOp(): was successful: (matrix-scalar, *, C32)");
    259     ok(memoryFlag== false, "no memory leaks");
    260236    testBinaryOpMS(/,S32,20,5,3,2,errorFlag,memoryFlag);
    261237    ok(errorFlag== false, "psBinaryOp(): was successful: (matrix-scalar, /, S32)");
     
    267243    ok(errorFlag== false, "psBinaryOp(): was successful: (matrix-scalar, /, F64)");
    268244    ok(memoryFlag== false, "no memory leaks");
    269     testBinaryOpMS(/,C32,20.0+20.0i,5.0+5.0i,3,2,errorFlag,memoryFlag);
    270     ok(errorFlag== false, "psBinaryOp(): was successful: (matrix-scalar, /, C32)");
    271     ok(memoryFlag== false, "no memory leaks");
    272245    return 0;
    273246}
  • trunk/psLib/test/math/tap_psMatrixVectorArithmetic02.c

    r10945 r12431  
    55 *
    66 *  This test driver tests combinations of matrix, vector, and scalar unary operations including:
    7  *     Matrix with all math operators with S32, F32, F64, C32
    8  *     Vector with all math operators with S32, F32, F64, C32
     7 *     Matrix with all math operators with S32, F32, F64
     8 *     Vector with all math operators with S32, F32, F64
    99 *
    1010 *  @author  Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
    13  *  @date  $Date: 2007-01-06 00:48:54 $
     12 *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
     13 *  @date  $Date: 2007-03-14 00:39:51 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    142142    ok(errorFlag== false, "psUnaryOp(): abs was successful");
    143143    ok(memoryFlag== false, "no memory leaks");
    144     testUnaryOpM( abs, C32, -10.0 - 10.0i, 0.0 + 0.0i, 3, 2,10+10i, errorFlag, memoryFlag);
    145     ok(errorFlag== false, "psUnaryOp(): abs was successful");
    146     ok(memoryFlag== false, "no memory leaks");
    147144    testUnaryOpM( exp, S32, 10, 0, 3, 2, exp(10), errorFlag, memoryFlag);
    148145    ok(errorFlag== false, "psUnaryOp(): exp was successful");
     
    154151    ok(errorFlag== false, "psUnaryOp(): exp was successful");
    155152    ok(memoryFlag== false, "no memory leaks");
    156     testUnaryOpM( exp, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3, 2, cexp(1.0+1.0i), errorFlag, memoryFlag);
    157     ok(errorFlag== false, "psUnaryOp(): exp was successful");
    158     ok(memoryFlag== false, "no memory leaks");
    159153    testUnaryOpM( ln, S32, 10, 0, 3, 2, clog(10), errorFlag, memoryFlag);
    160154    ok(errorFlag== false, "psUnaryOp(): ln was successful");
     
    166160    ok(errorFlag== false, "psUnaryOp(): ln was successful");
    167161    ok(memoryFlag== false, "no memory leaks");
    168     testUnaryOpM( ln, C32, 10.0 + 10.0i, 0.0 + 0.0i, 3, 2, clog(10.0+10.0i), errorFlag, memoryFlag);
    169     ok(errorFlag== false, "psUnaryOp(): ln was successful");
    170     ok(memoryFlag== false, "no memory leaks");
    171162    testUnaryOpM( ten, S32, 3, 0, 3, 2, 1000, errorFlag, memoryFlag);
    172163    ok(errorFlag== false, "psUnaryOp(): ten was successful");
     
    178169    ok(errorFlag== false, "psUnaryOp(): ten was successful");
    179170    ok(memoryFlag== false, "no memory leaks");
    180     testUnaryOpM( ten, C32, 1.0 + 0.0i, 0.0 + 0.0i, 3, 2, 10.0, errorFlag, memoryFlag);
    181     ok(errorFlag== false, "psUnaryOp(): ten was successful");
    182     ok(memoryFlag== false, "no memory leaks");
    183171    testUnaryOpM( log, S32, 1000, 0, 3, 2, 3, errorFlag, memoryFlag);
    184172    ok(errorFlag== false, "psUnaryOp(): log was successful");
     
    190178    ok(errorFlag== false, "psUnaryOp(): log was successful");
    191179    ok(memoryFlag== false, "no memory leaks");
    192     testUnaryOpM( log, C32, 1000.0 + 0.0i, 0.0 + 0.0i, 3, 2, 3, errorFlag, memoryFlag);
    193     ok(errorFlag== false, "psUnaryOp(): log was successful");
    194     ok(memoryFlag== false, "no memory leaks");
    195180    testUnaryOpM( sin, S32, M_PI_2, 0, 3, 2, 1, errorFlag, memoryFlag);
    196181    ok(errorFlag== false, "psUnaryOp(): sin was successful");
     
    202187    ok(errorFlag== false, "psUnaryOp(): sin was successful");
    203188    ok(memoryFlag== false, "no memory leaks");
    204     testUnaryOpM( sin, C32, M_PI_2 + 0.0i, 0.0 + 0.0i, 3, 2, 1.0, errorFlag, memoryFlag);
    205     ok(errorFlag== false, "psUnaryOp(): sin was successful");
    206     ok(memoryFlag== false, "no memory leaks");
    207189    testUnaryOpM( dsin, S32, 90, 0, 3, 2 , 1, errorFlag, memoryFlag);
    208190    ok(errorFlag== false, "psUnaryOp(): dsin was successful");
     
    214196    ok(errorFlag== false, "psUnaryOp(): dsin was successful");
    215197    ok(memoryFlag== false, "no memory leaks");
    216     testUnaryOpM( dsin, C32, 90.0 + 00.0i, 0.0 + 0.0i, 3, 2, 1.0, errorFlag, memoryFlag);
    217     ok(errorFlag== false, "psUnaryOp(): dsin was successful");
    218     ok(memoryFlag== false, "no memory leaks");
    219198    testUnaryOpM( cos, S32, 0, 0, 3, 2, 1, errorFlag, memoryFlag);
    220199    ok(errorFlag== false, "psUnaryOp(): cos was successful");
     
    226205    ok(errorFlag== false, "psUnaryOp(): cos was successful");
    227206    ok(memoryFlag== false, "no memory leaks");
    228     testUnaryOpM( cos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3, 2, 1.0, errorFlag, memoryFlag);
    229     ok(errorFlag== false, "psUnaryOp(): cos was successful");
    230     ok(memoryFlag== false, "no memory leaks");
    231207    testUnaryOpM( dcos, S32, 0, 0, 3, 2, 1, errorFlag, memoryFlag);
    232208    ok(errorFlag== false, "psUnaryOp(): dcos was successful");
     
    238214    ok(errorFlag== false, "psUnaryOp(): dcos was successful");
    239215    ok(memoryFlag== false, "no memory leaks");
    240     testUnaryOpM( dcos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3, 2, 1.0, errorFlag, memoryFlag);
    241     ok(errorFlag== false, "psUnaryOp(): dcos was successful");
    242     ok(memoryFlag== false, "no memory leaks");
    243216    testUnaryOpM( tan, S32, M_PI_4, 0, 3, 2, 1, errorFlag, memoryFlag);
    244217    ok(errorFlag== false, "psUnaryOp(): tan was successful");
     
    250223    ok(errorFlag== false, "psUnaryOp(): tan was successful");
    251224    ok(memoryFlag== false, "no memory leaks");
    252     testUnaryOpM( tan, C32, M_PI_4 + 0.0i, 0.0 + 0.0i, 3, 2, 1, errorFlag, memoryFlag);
    253     ok(errorFlag== false, "psUnaryOp(): tan was successful");
    254     ok(memoryFlag== false, "no memory leaks");
    255225    testUnaryOpM( dtan, S32, 45, 0, 3, 2, 1, errorFlag, memoryFlag);
    256226    ok(errorFlag== false, "psUnaryOp(): dtan was successful");
     
    262232    ok(errorFlag== false, "psUnaryOp(): dtan was successful");
    263233    ok(memoryFlag== false, "no memory leaks");
    264     testUnaryOpM( dtan, C32, 45.0 + 45.0i, 0.0 + 0.0i, 3, 2, 1.0, errorFlag, memoryFlag);
    265     ok(errorFlag== false, "psUnaryOp(): dtan was successful");
    266     ok(memoryFlag== false, "no memory leaks");
    267234    testUnaryOpM( asin, S32, 1, 0, 3, 2, M_PI_2, errorFlag, memoryFlag);
    268235    ok(errorFlag== false, "psUnaryOp(): asin was successful");
     
    274241    ok(errorFlag== false, "psUnaryOp(): asin was successful");
    275242    ok(memoryFlag== false, "no memory leaks");
    276     testUnaryOpM( asin, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3, 2, M_PI_2, errorFlag, memoryFlag);
    277     ok(errorFlag== false, "psUnaryOp(): asin was successful");
    278     ok(memoryFlag== false, "no memory leaks");
    279243    testUnaryOpM( dasin, S32, 1.0, 0, 3, 2, 90, errorFlag, memoryFlag);
    280244    ok(errorFlag== false, "psUnaryOp(): dasin was successful");
     
    286250    ok(errorFlag== false, "psUnaryOp(): dasin was successful");
    287251    ok(memoryFlag== false, "no memory leaks");
    288     testUnaryOpM( dasin, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3, 2, 90.0, errorFlag, memoryFlag);
    289     ok(errorFlag== false, "psUnaryOp(): dasin was successful");
    290     ok(memoryFlag== false, "no memory leaks");
    291252    testUnaryOpM( acos, S32, 0, 0, 3, 2, M_PI_2, errorFlag, memoryFlag);
    292253    ok(errorFlag== false, "psUnaryOp(): acos was successful");
     
    298259    ok(errorFlag== false, "psUnaryOp(): acos was successful");
    299260    ok(memoryFlag== false, "no memory leaks");
    300     testUnaryOpM( acos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3, 2, M_PI_2, errorFlag, memoryFlag);
    301     ok(errorFlag== false, "psUnaryOp(): acos was successful");
    302     ok(memoryFlag== false, "no memory leaks");
    303261    testUnaryOpM( dacos, S32, 0, 0, 3, 2, 90, errorFlag, memoryFlag);
    304262    ok(errorFlag== false, "psUnaryOp(): dacos was successful");
     
    310268    ok(errorFlag== false, "psUnaryOp(): dacos was successful");
    311269    ok(memoryFlag== false, "no memory leaks");
    312     testUnaryOpM( dacos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3, 2, 90.0, errorFlag, memoryFlag);
    313     ok(errorFlag== false, "psUnaryOp(): dacos was successful");
    314     ok(memoryFlag== false, "no memory leaks");
    315270    testUnaryOpM( atan, S32, 1, 0, 3, 2, M_PI_4, errorFlag, memoryFlag);
    316271    ok(errorFlag== false, "psUnaryOp(): atan was successful");
     
    322277    ok(errorFlag== false, "psUnaryOp(): atan was successful");
    323278    ok(memoryFlag== false, "no memory leaks");
    324     testUnaryOpM( atan, C32, 1.0 + 0.0i, 0.0 + 0.0i, 3, 2, M_PI_4, errorFlag, memoryFlag);
    325     ok(errorFlag== false, "psUnaryOp(): atan was successful");
    326     ok(memoryFlag== false, "no memory leaks");
    327279    testUnaryOpM( datan, S32, 1, 0, 3, 2, 45, errorFlag, memoryFlag);
    328280    ok(errorFlag== false, "psUnaryOp(): datan was successful");
     
    334286    ok(errorFlag== false, "psUnaryOp(): datan was successful");
    335287    ok(memoryFlag== false, "no memory leaks");
    336     testUnaryOpM( datan, C32, 1.0 + 0.0i, 0.0 + 0.0i, 3, 2, 45.0, errorFlag, memoryFlag);
    337     ok(errorFlag== false, "psUnaryOp(): datan was successful");
    338     ok(memoryFlag== false, "no memory leaks");
    339288
    340289    testUnaryOpV( abs, S32, -10, 0, 3, 10, errorFlag, memoryFlag);
     
    347296    ok(errorFlag== false, "psUnaryOp(): abs was successful");
    348297    ok(memoryFlag== false, "no memory leaks");
    349     testUnaryOpV( abs, C32, -10.0 - 10.0i, 0.0 + 0.0i, 3, 10+10i, errorFlag, memoryFlag);
    350     ok(errorFlag== false, "psUnaryOp(): abs was successful");
    351     ok(memoryFlag== false, "no memory leaks");
    352298    testUnaryOpV( exp, S32, 10, 0, 3, cexp(10), errorFlag, memoryFlag);
    353299    ok(errorFlag== false, "psUnaryOp(): exp was successful");
     
    359305    ok(errorFlag== false, "psUnaryOp(): exp was successful");
    360306    ok(memoryFlag== false, "no memory leaks");
    361     testUnaryOpV( exp, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3, cexp(1.0+1.0i), errorFlag, memoryFlag);
    362     ok(errorFlag== false, "psUnaryOp(): exp was successful");
    363     ok(memoryFlag== false, "no memory leaks");
    364307    testUnaryOpV( ln, S32, 10, 0, 3, clog(10), errorFlag, memoryFlag);
    365308    ok(errorFlag== false, "psUnaryOp(): ln was successful");
     
    371314    ok(errorFlag== false, "psUnaryOp(): ln was successful");
    372315    ok(memoryFlag== false, "no memory leaks");
    373     testUnaryOpV( ln, C32, 10.0 + 10.0i, 0.0 + 0.0i, 3, clog(10.0+10.0i), errorFlag, memoryFlag);
    374     ok(errorFlag== false, "psUnaryOp(): ln was successful");
    375     ok(memoryFlag== false, "no memory leaks");
    376316    testUnaryOpV( ten, S32, 3, 0, 3, 1000, errorFlag, memoryFlag);
    377317    ok(errorFlag== false, "psUnaryOp(): ten was successful");
     
    383323    ok(errorFlag== false, "psUnaryOp(): ten was successful");
    384324    ok(memoryFlag== false, "no memory leaks");
    385     testUnaryOpV( ten, C32, 1.0 + 0.0i, 0.0 + 0.0i, 3, 10.0, errorFlag, memoryFlag);
    386     ok(errorFlag== false, "psUnaryOp(): ten was successful");
    387     ok(memoryFlag== false, "no memory leaks");
    388325    testUnaryOpV( log, S32, 1000, 0, 3,  3, errorFlag, memoryFlag);
    389326    ok(errorFlag== false, "psUnaryOp(): log was successful");
     
    395332    ok(errorFlag== false, "psUnaryOp(): log was successful");
    396333    ok(memoryFlag== false, "no memory leaks");
    397     testUnaryOpV( log, C32, 1000.0 + 0.0i, 0.0 + 0.0i, 3, 3, errorFlag, memoryFlag);
    398     ok(errorFlag== false, "psUnaryOp(): log was successful");
    399     ok(memoryFlag== false, "no memory leaks");
    400334    testUnaryOpV( sin, S32, M_PI_2, 0, 3, 1, errorFlag, memoryFlag);
    401335    ok(errorFlag== false, "psUnaryOp(): sin was successful");
     
    407341    ok(errorFlag== false, "psUnaryOp(): sin was successful");
    408342    ok(memoryFlag== false, "no memory leaks");
    409     testUnaryOpV( sin, C32, M_PI_2 + 0.0i, 0.0 + 0.0i, 3, 1.0, errorFlag, memoryFlag);
    410     ok(errorFlag== false, "psUnaryOp(): sin was successful");
    411     ok(memoryFlag== false, "no memory leaks");
    412343    testUnaryOpV( dsin, S32, 90, 0, 3, 1, errorFlag, memoryFlag);
    413344    ok(errorFlag== false, "psUnaryOp(): dsin was successful");
     
    419350    ok(errorFlag== false, "psUnaryOp(): dsin was successful");
    420351    ok(memoryFlag== false, "no memory leaks");
    421     testUnaryOpV( dsin, C32, 90.0 + 00.0i, 0.0 + 0.0i, 3, 1.0, errorFlag, memoryFlag);
    422     ok(errorFlag== false, "psUnaryOp(): dsin was successful");
    423     ok(memoryFlag== false, "no memory leaks");
    424352    testUnaryOpV( cos, S32, 0, 0, 3, 1, errorFlag, memoryFlag);
    425353    ok(errorFlag== false, "psUnaryOp(): cos was successful");
     
    431359    ok(errorFlag== false, "psUnaryOp(): cos was successful");
    432360    ok(memoryFlag== false, "no memory leaks");
    433     testUnaryOpV( cos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3, 1.0, errorFlag, memoryFlag);
    434     ok(errorFlag== false, "psUnaryOp(): cos was successful");
    435     ok(memoryFlag== false, "no memory leaks");
    436361    testUnaryOpV( dcos, S32, 0, 0, 3, 1, errorFlag, memoryFlag);
    437362    ok(errorFlag== false, "psUnaryOp(): dcos was successful");
     
    443368    ok(errorFlag== false, "psUnaryOp(): dcos was successful");
    444369    ok(memoryFlag== false, "no memory leaks");
    445     testUnaryOpV( dcos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3, 1.0, errorFlag, memoryFlag);
    446     ok(errorFlag== false, "psUnaryOp(): dcos was successful");
    447     ok(memoryFlag== false, "no memory leaks");
    448370    testUnaryOpV( tan, S32, M_PI_4, 0, 3, 1, errorFlag, memoryFlag);
    449371    ok(errorFlag== false, "psUnaryOp(): tan was successful");
     
    455377    ok(errorFlag== false, "psUnaryOp(): tan was successful");
    456378    ok(memoryFlag== false, "no memory leaks");
    457     testUnaryOpV( tan, C32, M_PI_4 + 0.0i, 0.0 + 0.0i, 3, 1, errorFlag, memoryFlag);
    458     ok(errorFlag== false, "psUnaryOp(): tan was successful");
    459     ok(memoryFlag== false, "no memory leaks");
    460379    testUnaryOpV( dtan, S32, 45, 0, 3, 1, errorFlag, memoryFlag);
    461380    ok(errorFlag== false, "psUnaryOp(): dtan was successful");
     
    467386    ok(errorFlag== false, "psUnaryOp(): dtan was successful");
    468387    ok(memoryFlag== false, "no memory leaks");
    469     testUnaryOpV( dtan, C32, 45.0 + 45.0i, 0.0 + 0.0i, 3, 1.0, errorFlag, memoryFlag);
    470     ok(errorFlag== false, "psUnaryOp(): dtan was successful");
    471     ok(memoryFlag== false, "no memory leaks");
    472388    testUnaryOpV( asin, S32, 1, 0, 3, M_PI_2, errorFlag, memoryFlag);
    473389    ok(errorFlag== false, "psUnaryOp(): asin was successful");
     
    479395    ok(errorFlag== false, "psUnaryOp(): asin was successful");
    480396    ok(memoryFlag== false, "no memory leaks");
    481     testUnaryOpV( asin, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3, M_PI_2, errorFlag, memoryFlag);
    482     ok(errorFlag== false, "psUnaryOp(): asin was successful");
    483     ok(memoryFlag== false, "no memory leaks");
    484397    testUnaryOpV( dasin, S32, 1.0, 0, 3, 90, errorFlag, memoryFlag);
    485398    ok(errorFlag== false, "psUnaryOp(): dasin was successful");
     
    491404    ok(errorFlag== false, "psUnaryOp(): dasin was successful");
    492405    ok(memoryFlag== false, "no memory leaks");
    493     testUnaryOpV( dasin, C32, 1.0 + 1.0i, 0.0 + 0.0i, 3, 90.0, errorFlag, memoryFlag);
    494     ok(errorFlag== false, "psUnaryOp(): dasin was successful");
    495     ok(memoryFlag== false, "no memory leaks");
    496406    testUnaryOpV( acos, S32, 0, 0, 3, M_PI_2, errorFlag, memoryFlag);
    497407    ok(errorFlag== false, "psUnaryOp(): acos was successful");
     
    503413    ok(errorFlag== false, "psUnaryOp(): acos was successful");
    504414    ok(memoryFlag== false, "no memory leaks");
    505     testUnaryOpV( acos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3, M_PI_2, errorFlag, memoryFlag);
    506     ok(errorFlag== false, "psUnaryOp(): acos was successful");
    507     ok(memoryFlag== false, "no memory leaks");
    508415    testUnaryOpV( dacos, S32, 0, 0, 3, 90, errorFlag, memoryFlag);
    509416    ok(errorFlag== false, "psUnaryOp(): dacos was successful");
     
    515422    ok(errorFlag== false, "psUnaryOp(): dacos was successful");
    516423    ok(memoryFlag== false, "no memory leaks");
    517     testUnaryOpV( dacos, C32, 0.0 + 0.0i, 0.0 + 0.0i, 3, 90.0, errorFlag, memoryFlag);
    518     ok(errorFlag== false, "psUnaryOp(): dacos was successful");
    519     ok(memoryFlag== false, "no memory leaks");
    520424    testUnaryOpV( atan, S32, 1, 0, 3, M_PI_4, errorFlag, memoryFlag);
    521425    ok(errorFlag== false, "psUnaryOp(): atan was successful");
     
    527431    ok(errorFlag== false, "psUnaryOp(): atan was successful");
    528432    ok(memoryFlag== false, "no memory leaks");
    529     testUnaryOpV( atan, C32, 1.0 + 0.0i, 0.0 + 0.0i, 3, M_PI_4, errorFlag, memoryFlag);
    530     ok(errorFlag== false, "psUnaryOp(): atan was successful");
    531     ok(memoryFlag== false, "no memory leaks");
    532433    testUnaryOpV( datan, S32, 1, 0, 3, 45, errorFlag, memoryFlag);
    533434    ok(errorFlag== false, "psUnaryOp(): datan was successful");
     
    539440    ok(errorFlag== false, "psUnaryOp(): datan was successful");
    540441    ok(memoryFlag== false, "no memory leaks");
    541     testUnaryOpV( datan, C32, 1.0 + 0.0i, 0.0 + 0.0i, 3, 45.0, errorFlag, memoryFlag);
    542     ok(errorFlag== false, "psUnaryOp(): datan was successful");
    543     ok(memoryFlag== false, "no memory leaks");
    544442
    545443    return 0;
  • trunk/psLib/test/math/tap_psMatrixVectorArithmetic03.c

    r10945 r12431  
    99 *     Inconsistent dimensionality
    1010 *     Division by zero
    11  *     Attempt to use min with complex numbers
    12  *     Attempt to use max with complex numbers
    1311 *     Invalid operation
    1412 *
     
    1715 *  @author  Ross Harman, MHPCC
    1816 *
    19  *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
    20  *  @date  $Date: 2007-01-06 00:48:54 $
     17 *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
     18 *  @date  $Date: 2007-03-14 00:39:51 $
    2119 *
    2220 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    5654    CREATE_AND_SET_IMAGE(image3,F32,0,3,3);
    5755    CREATE_AND_SET_IMAGE(image4,F64,0,2,2);
    58     CREATE_AND_SET_IMAGE(image5,C32,1+1i,3,3);
    5956    CREATE_AND_SET_VECTOR(vector1,F64,0,2);
    6057    CREATE_AND_SET_VECTOR(vector2,F64,0,3);
     
    203200        ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    204201    }
    205 
    206     // Attempt to use min with complex numbers
    207     // Following should generate error message
    208     if (0) {
    209         psMemId id = psMemGetId();
    210         psImage* image6 = (psImage*)psBinaryOp(image6, image5, "min", image5);
    211         ok(image6 == NULL, "psUnaryOp returned NULL with min of complex numbers");
    212         psFree(image6);
    213         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    214     }
    215 
    216 
    217     // Attempt to use max with complex numbers
    218     // Following should generate an error message
    219     if (0) {
    220         psMemId id = psMemGetId();
    221         psImage* image6 = (psImage*)psBinaryOp(image6, image5, "max", image5);
    222         ok(image6 == NULL, "psUnaryOp returned NULL with max of complex numbers");
    223         psFree(image6);
    224         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    225     }
    226 
    227202
    228203    // Invalid operation
  • trunk/psLib/test/mathtypes/tap_psImage.c

    r12196 r12431  
    66 *  @author Robert DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2007-03-03 01:25:22 $
     8 *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2007-03-14 00:39:51 $
    1010 *
    1111 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    8181    psElemType type[] = { PS_TYPE_S8, PS_TYPE_S16, PS_TYPE_S32, PS_TYPE_S64,
    8282                          PS_TYPE_U8, PS_TYPE_U16, PS_TYPE_U32, PS_TYPE_U64,
    83                           PS_TYPE_F32, PS_TYPE_F64, PS_TYPE_C32, PS_TYPE_C64};
     83                          PS_TYPE_F32, PS_TYPE_F64 };
    8484
    8585    for (psU32 t=0;t<types;t++) {
     
    200200                    }
    201201                    ok(!errorFlag, "psImageAlloc() set data correctly (F64)");
    202                 }
    203                 break;
    204             case PS_TYPE_C32: {
    205                     psU32 rows = numRows[i];
    206                     psU32 cols = numCols[i];
    207 
    208                     for (psS32 r=0;r<rows;r++) {
    209                         for (psS32 c=0;c<cols;c++) {
    210                             image->data.C32[r][c] = r + I * c;
    211                         }
    212                     }
    213                     bool errorFlag = false;
    214                     for (psS32 r=0;r<rows;r++) {
    215                         for (psS32 c=0;c<cols;c++) {
    216                             if(fabsf(crealf(image->data.C32[r][c]) - r) > FLT_EPSILON ||
    217                                     fabsf(cimagf(image->data.C32[r][c]) - c) > FLT_EPSILON) {
    218                                 diag("Set all pixels in complex image at (%d,%d)",c,r);
    219                                 errorFlag = true;
    220                             }
    221                         }
    222                     }
    223                     ok(!errorFlag, "psImageAlloc() set data correctly (C32)");
    224202                }
    225203                break;
  • trunk/psLib/test/mathtypes/tap_psScalar.c

    r10808 r12431  
    55 *  @author Eric Van Alst, MHPCC
    66 *
    7  *  @version $Revision: 1.1 $
     7 *  @version $Revision: 1.2 $
    88 *           $Name: not supported by cvs2svn $
    9  *  @date $Date: 2006-12-18 19:10:56 $
     9 *  @date $Date: 2007-03-14 00:39:51 $
    1010 *
    1111 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    7777    tstScalarAllocByType(F32,26);
    7878    tstScalarAllocByType(F64,28);
    79     tstScalarAllocByType(C32,30);
    80     tstScalarAllocByType(C64,32);
    8179}
    8280
     
    107105    tstScalarCopyByType(F32,180);
    108106    tstScalarCopyByType(F64,190);
    109     tstScalarCopyByType(C32,200);
    110     tstScalarCopyByType(C64,210);
    111107}
    112108
  • trunk/psLib/test/mathtypes/tap_psVector.c

    r12389 r12431  
    279279        psFree(vec);
    280280    }
    281 
    282     // XXX: Looks like the C32 case was removed from psVectorInit().
    283     if (0) {
    284         psVector *vec = psVectorAlloc(1, PS_TYPE_C32);
    285         psC32 vC32 = 1.23 + 1.19I;
    286         ok(psVectorInit(vec, vC32), "C32 Case");
    287         psFree(vec);
    288     }
    289 
    290     // XXX: Looks like the C64 case was removed from psVectorInit().
    291     if (0) {
    292         psVector *vec = psVectorAlloc(1, PS_TYPE_C64);
    293         psC64 vC64 = 2.13 + 2.31I;
    294         ok(psVectorInit(vec, vC64), "C64 Case");
    295         psFree(vec);
    296     }
    297 
    298281
    299282
     
    455438    TEST_VECTOR_TO_STRING(PS_TYPE_F64,5,.123,1,"[0.123,1.123,2.123,3.123,4.123]");
    456439
    457     // Must test complex types separately from macro
    458 
    459     // XXX: Looks like the C32 case was removed from psVectorInit().
    460     if (0) {
    461         psVector *vec = psVectorAlloc(1, PS_TYPE_C32);
    462         vec->n = 1;
    463         psC32 vC32 = 1.23 + 1.19I;
    464         psVectorInit(vec, vC32);
    465         psString result = psVectorToString(vec, 100);
    466         \
    467         psString expected = "[1.23+1.19i]";
    468         ok(strcmp(result,expected) == 0,                                   \
    469            "psVectorToString expected:result = %s:%s", expected, result );
    470         \
    471         psFree(vec);
    472     }
    473 
    474     // XXX: Looks like the C64 case was removed from psVectorInit().
    475     if (0) {
    476         psVector *vec = psVectorAlloc(1, PS_TYPE_C64);
    477         vec->n = 1;
    478         psC64 vC64 = 2.13 + 2.31I;
    479         psVectorInit(vec, vC64);
    480         psString result = psVectorToString(vec, 100);
    481         \
    482         psString expected = "[2.13+2.31i]";
    483         ok(strcmp(result,expected) == 0,                                   \
    484            "psVectorToString expected:result = %s:%s", expected, result );
    485         \
    486         psFree(vec);
    487     }
    488 
    489 
    490 
    491440
    492441    diag("p_psVectorGetElementF64() tests");
     
    526475
    527476    TEST_VECTOR_GET_ELEMENT_F64(PS_TYPE_F64,2, psF64, -123.123);
    528 
    529     // Need different test for complex types since NAN returned.
    530 
    531     #define TEST_VECTOR_GET_C_ELEMENT_F64(ELEM_TYPE, SIZE, VALUE_TYPE,      \
    532                                           INIT_VALUE )                                                        \
    533     {                                                                       \
    534         psVector *vec = psVectorAlloc(SIZE, ELEM_TYPE);                     \
    535         vec->n = SIZE;                                                      \
    536         VALUE_TYPE initValue = INIT_VALUE;                                  \
    537         psVectorInit(vec, initValue);                                       \
    538         psF64 result = p_psVectorGetElementF64(vec, 0);                     \
    539         ok(isnan(result),                                                   \
    540            "p_psVectorGetElementF64 expected NAN/nan got %f", result);     \
    541         \
    542         psFree(vec);                                                        \
    543     }
    544 
    545     TEST_VECTOR_GET_C_ELEMENT_F64(PS_TYPE_C32,1, psC32, 1.23+1.19I);
    546 
    547     TEST_VECTOR_GET_C_ELEMENT_F64(PS_TYPE_C64,100, psC64, -1.23-1.19I);
    548 
    549 
    550477
    551478
  • trunk/psLib/test/sys/tap_psMemory.c

    r11665 r12431  
    66*  @author Robert DeSonia, MHPCC
    77*
    8 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    9 *  @date $Date: 2007-02-06 20:31:57 $
     8*  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
     9*  @date $Date: 2007-03-14 00:39:51 $
    1010*
    1111*  XXXX: Several tests fail with an Abort and are commented out.
     
    726726
    727727    psScalar *scalar;
    728     psC64 c64 = 1.1 + 7I;
    729     scalar = psScalarAlloc(c64, PS_TYPE_F64);
     728    psF64 f64 = 1.1;
     729    scalar = psScalarAlloc(f64, PS_TYPE_F64);
    730730    okay = psMemCheckType(PS_DATA_SCALAR, scalar);
    731731    if ( ! okay )
  • trunk/psLib/test/types/tap_psMetadataConfigFormat.c

    r11667 r12431  
    6767        psFree(list);
    6868        psFree(md);
    69     }
    70 
    71 
    72     //Return NULL for attempting to format vector with type = complex
    73     {
    74         psMemId id = psMemGetId();
    75         psVector *vec = psVectorAlloc(60, PS_TYPE_C64);
    76         for (int i = 0; i < 5; i++)
    77         {
    78             vec->data.C64[i] = i+1;
    79         }
    80         md = psMetadataAlloc();
    81         psMetadataAddVector(md, PS_LIST_TAIL, "vectorC64", 0, "", vec);
    82         out = psMetadataConfigFormat(md);
    83         ok( out == NULL,
    84             "psMetadataConfigFormat:         return NULL for metadata containing a "
    85             "Complex vector.");
    86         psFree(vec);
    87         psFree(md);
    88         ok(!psMemCheckLeaks (id, NULL, NULL, false), "no memory leaks");
    8969    }
    9070
  • trunk/psLib/test/types/tap_psMetadata_printing.c

    r10822 r12431  
    153153        psImageSet(image, 0, 0, 1);
    154154        psMetadataAddImage(md, PS_LIST_TAIL, "image1", 0, "I am an Image", image);
    155      
     155
    156156        psHash *hash = psHashAlloc(1);
    157157        psHashAdd(hash, "hash", image);
    158158        psMetadataAddHash(md, PS_LIST_TAIL, "hash1", 0, "I am a Hash", hash);
    159      
     159
    160160        psLookupTable *lookup = psLookupTableAlloc("table2.dat", "%s", 0);
    161161        psMetadataAddLookupTable(md, PS_LIST_TAIL, "lookup", 0, "I am a LookupTable", lookup);
    162      
     162
    163163        psArray *array = psArrayAlloc(1);
    164164        psArraySet(array, 0, image);
    165165        psMetadataAddArray(md, PS_LIST_TAIL, "array", 0, "I am an Array", array);
    166      
     166
    167167        psFree(array);
    168168        psFree(lookup);
     
    230230    psFree(md2);
    231231
    232     //Return false for unsupported vector type (C32)
    233     md2 = psMetadataAlloc();
    234     psVector *vector = psVectorAlloc(2, PS_TYPE_C32);
    235     psMetadataAddVector(md2, PS_LIST_HEAD, "name here", 0, "I vector", vector);
    236     {
    237         ok ( !psMetadataPrint(NULL, md2, 2),
    238              "psMetadataPrint:            return false for metadata with unknown vector-type.");
    239     }
    240     psFree(vector);
    241     psFree(md2);
    242 
    243232    //Valid case where fd is NULL -> stdout
    244233    md2 = psMetadataAlloc();
Note: See TracChangeset for help on using the changeset viewer.