libtpcmodel
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines
Functions
constraints.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "include/constraints.h"
Include dependency graph for constraints.c:

Go to the source code of this file.

Functions

int modelCheckParameters (int par_nr, double *lower_p, double *upper_p, double *test_p, double *accept_p, double *penalty)
int modelCheckLimits (int par_nr, double *lower_p, double *upper_p, double *test_p)

Function Documentation

int modelCheckLimits ( int  par_nr,
double *  lower_p,
double *  upper_p,
double *  test_p 
)

Check if model parameters have collided with given limits. If parameter is fixed (equal lower and upper limit) then it is not counted as collision.

Returns:
Return the number of parameters that too close to the limits; 0 in case all are well inside the limits.
Parameters:
par_nrNr of parameters
lower_pLower limits
upper_pUpper limits
test_pParameters to test

Definition at line 94 of file constraints.c.

int modelCheckParameters ( int  par_nr,
double *  lower_p,
double *  upper_p,
double *  test_p,
double *  accept_p,
double *  penalty 
)

Check that model parameters are within given limits. If not, then compute a penalty factor.

Returns:
Return the number of parameters that are outside the constraints; 0 in case all are inside or at the limits.
Parameters:
par_nrNr of parameters
lower_pLower limits
upper_pUpper limits
test_pParameters to test
accept_pPointer to corrected parameters (NULL if not needed)
penaltyPointer to variable in which the possible penalty factor will be written; 1 if no penalty, or >1. Set to NULL if not needed.

Definition at line 51 of file constraints.c.