IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 4, 2004, 1:37:39 PM (22 years ago)
Author:
desonia
Message:

found the server astyle upgrade was faulty, so the format was reset.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/math/psMatrix.c

    r908 r1385  
    2020 *  @author Ross Harman, MHPCC
    2121 *   
    22  *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
    23  *  @date $Date: 2004-06-08 01:57:52 $
     22 *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
     23 *  @date $Date: 2004-08-04 23:37:39 $
    2424 *
    2525 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    475475        PS_CHECK_ALLOC_VECTOR(outVector, inImage->numCols, inImage->type.type);
    476476        outVector->type.dimen = PS_DIMEN_TRANSV;
    477     } else if(inImage->numCols == 1) {
    478         // Create non-transposed column vector
    479         PS_CHECK_ALLOC_VECTOR(outVector, inImage->numRows, inImage->type.type);
    480     } else {
    481         psError(__func__, "Image does not have dim with 1 col or 1 row: (%d x %d).", inImage->numRows,
    482                 inImage->numCols);
    483         return outVector;
    484     }
     477    } else
     478        if(inImage->numCols == 1) {
     479            // Create non-transposed column vector
     480            PS_CHECK_ALLOC_VECTOR(outVector, inImage->numRows, inImage->type.type);
     481        } else {
     482            psError(__func__, "Image does not have dim with 1 col or 1 row: (%d x %d).", inImage->numRows,
     483                    inImage->numCols);
     484            return outVector;
     485        }
    485486
    486487    PS_CHECK_NULL_VECTOR(outVector, outVector);
     
    502503        size = PSELEMTYPE_SIZEOF(inImage->type.type)*inImage->numRows;
    503504
    504     } else if(outVector->type.dimen == PS_DIMEN_TRANSV) {
    505         PS_CHECK_DIMEN_AND_TYPE(outVector, PS_DIMEN_TRANSV, outVector);
    506 
    507         if(outVector->n == 0) {
    508             outVector->n = inImage->numCols;
     505    } else
     506        if(outVector->type.dimen == PS_DIMEN_TRANSV) {
     507            PS_CHECK_DIMEN_AND_TYPE(outVector, PS_DIMEN_TRANSV, outVector);
     508
     509            if(outVector->n == 0) {
     510                outVector->n = inImage->numCols;
     511            }
     512
     513            if(outVector->n != inImage->numCols) {
     514                psError(__func__, "Image and vector sizes differ: (%d vs %d).", inImage->numCols, outVector->n);
     515                return outVector;
     516            }
     517
     518            size = PSELEMTYPE_SIZEOF(inImage->type.type)*inImage->numCols;
    509519        }
    510 
    511         if(outVector->n != inImage->numCols) {
    512             psError(__func__, "Image and vector sizes differ: (%d vs %d).", inImage->numCols, outVector->n);
    513             return outVector;
    514         }
    515 
    516         size = PSELEMTYPE_SIZEOF(inImage->type.type)*inImage->numCols;
    517     }
    518520
    519521    memcpy(outVector->data.V, inImage->data.V[0], size);
     
    538540            psError(__func__, "Image has more than 1 column: numCols = %d.", outImage->numCols);
    539541            return outImage;
    540         } else if(outImage->numRows != inVector->n) {
    541             psError(__func__, "Image and vector sizes differ: (%d vs %d).", outImage->numRows, inVector->n);
    542             return outImage;
     542        } else
     543            if(outImage->numRows != inVector->n) {
     544                psError(__func__, "Image and vector sizes differ: (%d vs %d).", outImage->numRows, inVector->n);
     545                return outImage;
     546            }
     547
     548        size = PSELEMTYPE_SIZEOF(outImage->type.type)*outImage->numRows;
     549
     550    } else
     551        if(inVector->type.dimen == PS_DIMEN_TRANSV) {
     552            PS_CHECK_DIMEN_AND_TYPE(inVector, PS_DIMEN_TRANSV, outImage);
     553            PS_CHECK_SIZE_VECTOR(inVector, outImage);
     554            PS_CHECK_ALLOC_IMAGE(outImage, inVector->n, 1, PS_TYPE_F64)
     555
     556            // More checks for PS_DIMEN_TRANSV
     557            if(outImage->numRows > 1) {
     558                psError(__func__, "Image has more than 1 row: numRows = %d.", outImage->numRows);
     559                return outImage;
     560            } else
     561                if(outImage->numCols != inVector->n) {
     562                    psError(__func__, "Image and vector sizes differ: (%d vs %d).", outImage->numCols, inVector->n);
     563                    return outImage;
     564                }
     565
     566            size = PSELEMTYPE_SIZEOF(outImage->type.type)*outImage->numCols;
    543567        }
    544 
    545         size = PSELEMTYPE_SIZEOF(outImage->type.type)*outImage->numRows;
    546 
    547     } else if(inVector->type.dimen == PS_DIMEN_TRANSV) {
    548         PS_CHECK_DIMEN_AND_TYPE(inVector, PS_DIMEN_TRANSV, outImage);
    549         PS_CHECK_SIZE_VECTOR(inVector, outImage);
    550         PS_CHECK_ALLOC_IMAGE(outImage, inVector->n, 1, PS_TYPE_F64)
    551 
    552         // More checks for PS_DIMEN_TRANSV
    553         if(outImage->numRows > 1) {
    554             psError(__func__, "Image has more than 1 row: numRows = %d.", outImage->numRows);
    555             return outImage;
    556         } else if(outImage->numCols != inVector->n) {
    557             psError(__func__, "Image and vector sizes differ: (%d vs %d).", outImage->numCols, inVector->n);
    558             return outImage;
    559         }
    560 
    561         size = PSELEMTYPE_SIZEOF(outImage->type.type)*outImage->numCols;
    562     }
    563568
    564569    PS_CHECK_NULL_IMAGE(outImage, outImage);
Note: See TracChangeset for help on using the changeset viewer.