IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 2, 2008, 10:39:04 AM (18 years ago)
Author:
gusciora
Message:

Removed pmSourceTest() and added some PS_ASSERTS.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmSourceFitSet.c

    r15622 r15980  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2007-11-15 23:18:20 $
     8 *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2008-01-02 20:39:04 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    120120bool pmSourceFitSetJoin (psVector *deriv, psVector *param, pmSourceFitSetData *set)
    121121{
    122     assert (set);
    123     assert (set->paramSet->n == set->derivSet->n);
    124 
     122    PS_ASSERT_PTR_NON_NULL(set, false);
     123    PS_ASSERT_PTR_NON_NULL(set->paramSet, false);
     124    PS_ASSERT_PTR_NON_NULL(set->derivSet, false);
     125    PS_ASSERT_VECTORS_SIZE_EQUAL(set->paramSet, set->derivSet, false);
    125126    int n = 0;
     127    int sum = 0;
     128    for (int i = 0; i < set->paramSet->n; i++) {
     129        sum+= set->paramSet->n;
     130    }
     131
     132    // Must assert that the deriv and param psVectors are large enough, or else
     133    // a seg fault occurs.
     134    // XXX: Put the correct error call in here:
     135    if (0) {
     136        if (deriv->n < sum || param->n < sum) {
     137            PS_ASSERT_PTR_NON_NULL(0, false);
     138        }
     139    }
     140
    126141    for (int i = 0; i < set->paramSet->n; i++) {
    127142
     
    150165bool pmSourceFitSetSplit (pmSourceFitSetData *set, const psVector *deriv, const psVector *param)
    151166{
    152     assert (param);
    153     assert (set);
    154     assert (set->paramSet->n == set->derivSet->n);
     167    PS_ASSERT_VECTOR_NON_NULL(param, false);
     168    PS_ASSERT_PTR_NON_NULL(set, false);
     169    PS_ASSERT_PTR_NON_NULL(set->paramSet, false);
     170    PS_ASSERT_PTR_NON_NULL(set->derivSet, false);
     171    PS_ASSERT_VECTORS_SIZE_EQUAL(set->paramSet, set->derivSet, false);
    155172
    156173    int n = 0;
     
    175192                           psMinimization *myMin, int nPix, bool fitStatus)
    176193{
    177     assert (set);
     194    PS_ASSERT_PTR_NON_NULL(set, false);
     195    PS_ASSERT_PTR_NON_NULL(set->paramSet, false);
     196    PS_ASSERT_VECTOR_NON_NULL(dparam, false);
     197    PS_ASSERT_VECTOR_NON_NULL(param, false);
     198    PS_ASSERT_PTR_NON_NULL(source, false);
     199    PS_ASSERT_PTR_NON_NULL(source->pixels, false);
     200    PS_ASSERT_PTR_NON_NULL(myMin, false);
     201
    178202    bool onPic = true;
    179203
     
    216240psF32 pmSourceFitSetFunction(psVector *deriv, const psVector *param, const psVector *x)
    217241{
    218     assert (thisSet);
     242    PS_ASSERT_PTR_NON_NULL(thisSet, NAN);
    219243    float chisqSum = 0.0;
    220244    float chisqOne = 0.0;
Note: See TracChangeset for help on using the changeset viewer.