IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 13, 2014, 8:35:36 AM (12 years ago)
Author:
eugene
Message:

remove pmModel class functions from pmModel and replace with a pointer to the class; call model->class->function instead of model->function

File:
1 edited

Legend:

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

    r36623 r36859  
    3333#include "pmMoments.h"
    3434#include "pmModelFuncs.h"
     35#include "pmModelClass.h"
    3536#include "pmModel.h"
    3637#include "pmModelUtils.h"
    37 #include "pmModelClass.h"
    3838#include "pmSourceMasks.h"
    3939#include "pmSourceExtendedPars.h"
     
    170170    psMinConstraint *constraint = psMinConstraintAlloc();
    171171    constraint->paramMask = psVectorAlloc (params->n, PS_TYPE_VECTOR_MASK);
    172     constraint->checkLimits = model->modelLimits;
     172    constraint->checkLimits = model->class->modelLimits;
    173173
    174174    // set parameter mask based on fitting mode
     
    233233    // force the floating parameters to fall within the contraint ranges
    234234    for (int i = 0; i < params->n; i++) {
    235         model->modelLimits (PS_MINIMIZE_PARAM_MIN, i, params->data.F32, NULL);
    236         model->modelLimits (PS_MINIMIZE_PARAM_MAX, i, params->data.F32, NULL);
     235        model->class->modelLimits (PS_MINIMIZE_PARAM_MIN, i, params->data.F32, NULL);
     236        model->class->modelLimits (PS_MINIMIZE_PARAM_MAX, i, params->data.F32, NULL);
    237237    }
    238238
     
    254254    psImage *covar = psImageAlloc (params->n, params->n, PS_TYPE_F32);
    255255
    256     fitStatus = psMinimizeLMChi2(myMin, covar, params, constraint, x, y, yErr, model->modelFunc);
     256    fitStatus = psMinimizeLMChi2(myMin, covar, params, constraint, x, y, yErr, model->class->modelFunc);
    257257    for (int i = 0; i < dparams->n; i++) {
    258258        if ((constraint->paramMask != NULL) && constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[i])
     
    306306            altmask->data.PS_TYPE_VECTOR_MASK_DATA[i] = (constraint->paramMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) ? 0 : 1;
    307307        }
    308         psMinimizeGaussNewtonDelta(delta, params, altmask, x, y, yErr, model->modelFunc);
     308        psMinimizeGaussNewtonDelta(delta, params, altmask, x, y, yErr, model->class->modelFunc);
    309309
    310310        for (int i = 0; i < dparams->n; i++) {
Note: See TracChangeset for help on using the changeset viewer.