IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1149


Ignore:
Timestamp:
Jun 30, 2004, 10:06:41 AM (22 years ago)
Author:
harman
Message:

Added more error checks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/dataManip/psMatrixVectorArithmetic.c

    r1139 r1149  
    2929 *  @author Ross Harman, MHPCC
    3030 *
    31  *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
    32  *  @date $Date: 2004-06-30 01:31:15 $
     31 *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
     32 *  @date $Date: 2004-06-30 20:06:41 $
    3333 *
    3434 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    8888    complex double out = 0+0i;
    8989    out = a/b;
    90     if(isnan(creal(out))) {
    91         psError(__func__, ": NAN encountered in real portion of division");
    92     } else if(isnan(cimag(out))) {
    93         psError(__func__, ": NAN encountered in imaginary portion of division");
     90    if(isnan(creal(out)) || isnan(cimag(out))) {
     91        psError(__func__, ": Divide by zero");
    9492    }
    9593
     
    387385    }                                                                                                        \
    388386} else {                                                                                                     \
    389     psError(__func__, ": Invalid binary operator: %s", #OP);                                                 \
     387    psError(__func__, ": Invalid operation: %s", OP);                                                        \
    390388}
    391389
     
    695693    }                                                                                                        \
    696694} else {                                                                                                     \
    697     psError(__func__, ": Line %d - Invalid operator: %s", __LINE__, #OP);                                    \
     695    psError(__func__, ": Invalid operation: %s", OP);                                                        \
    698696}
    699697
     
    735733    }
    736734
     735    if(dimIn!=dimOut) {
     736        psError(__func__, ": Line %d - Dimensionality for arguments inconsistent: (%d, %d)", __LINE__,
     737                dimIn, dimOut);
     738        return out;
     739    }
     740
    737741    if(dimIn==PS_DIMEN_OTHER || dimOut==PS_DIMEN_OTHER) {
    738742        psError(__func__, ": Line %d - PS_DIMEN_OTHER not allowed for arguments: (%d, %d)", __LINE__,
Note: See TracChangeset for help on using the changeset viewer.