IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 29, 2007, 2:59:23 PM (19 years ago)
Author:
gusciora
Message:

Adding several changes to the objects directory. Most of these changes are
mere additions of PS_ASSERTs to the beginning of psModule functions to ensure
that input parameters are correct.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20071023/psModules/src/objects/pmSourceFitSet.c

    r15055 r15418  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2007-09-28 00:39:41 $
     8 *  @version $Revision: 1.7.2.1 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2007-10-30 00:59:23 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    7979}
    8080
     81bool psMemCheckSourceFitSetData(psPtr ptr)
     82{
     83    PS_ASSERT_PTR(ptr, false);
     84    return ( psMemGetDeallocator(ptr) == (psFreeFunc) pmSourceFitSetDataFree);
     85}
     86
     87
    8188// this function is called with the full set of parameters and the beta values in a single vector
    82 bool pmSourceFitSetCheckLimits (psMinConstraintMode mode, int nParam, float *params, float *betas)
    83 {
    84     assert (thisSet);
     89bool pmSourceFitSetCheckLimits (psMinConstraintMode mode, int nParam, float *params,
     90                                float *betas)
     91{
     92    PS_ASSERT_PTR_NON_NULL(thisSet, false);
    8593
    8694    // nParam is the parameter in the full sequence.  determine which single model this comes from
     
    109117
    110118// merge parameters from FitSet models into single param and deriv vectors
    111 bool pmSourceFitSetJoin (psVector *deriv, psVector *param, pmSourceFitSetData *set) {
    112 
    113     assert (set);
     119bool pmSourceFitSetJoin (psVector *deriv, psVector *param, pmSourceFitSetData *set)
     120{
     121    PS_ASSERT_PTR_NON_NULL(set, false);
     122    PS_ASSERT_PTR_NON_NULL(param, false);
     123
    114124    assert (set->paramSet->n == set->derivSet->n);
    115125
     
    138148// distribute parameters from single param and deriv vectors into FitSet models
    139149bool pmSourceFitSetSplit (pmSourceFitSetData *set, const psVector *deriv, const psVector *param) {
    140 
    141     assert (set);
     150    PS_ASSERT_PTR_NON_NULL(set, false);
     151    PS_ASSERT_PTR_NON_NULL(param, false);
     152
    142153    assert (set->paramSet->n == set->derivSet->n);
    143154
     
    159170}
    160171
    161 bool pmSourceFitSetValues (pmSourceFitSetData *set, const psVector *dparam, const psVector *param, pmSource *source, psMinimization *myMin, int nPix, bool fitStatus) {
    162 
     172bool pmSourceFitSetValues (pmSourceFitSetData *set, const psVector *dparam,
     173                           const psVector *param, pmSource *source,
     174                           psMinimization *myMin, int nPix, bool fitStatus)
     175{
     176    PS_ASSERT_PTR_NON_NULL(set, false);
    163177    bool onPic = true;
    164 
    165     assert (set);
    166178
    167179    int n = 0;
     
    203215psF32 pmSourceFitSetFunction(psVector *deriv, const psVector *param, const psVector *x)
    204216{
     217    PS_ASSERT_PTR_NON_NULL(thisSet, NAN);
    205218    float chisqSum = 0.0;
    206219    float chisqOne = 0.0;
    207 
    208     assert (thisSet);
    209220    pmSourceFitSetSplit (thisSet, deriv, param);
    210221
     
    225236
    226237// XXX allow the mode to be a function of the object (eg, S/N)
    227 bool pmSourceFitSetMasks (psMinConstraint *constraint, pmSourceFitSetData *set, pmSourceFitMode mode) {
     238bool pmSourceFitSetMasks (psMinConstraint *constraint, pmSourceFitSetData *set,
     239                          pmSourceFitMode mode)
     240{
     241    PS_ASSERT_PTR_NON_NULL(set, false);
     242    PS_ASSERT_PTR_NON_NULL(constraint, false);
    228243
    229244    // unmask everyone
Note: See TracChangeset for help on using the changeset viewer.