Exemplo n.º 1
0
void sres_InitBasic (sres_Basic *res, long N, char *nam)
{
   statcoll_Init (res->sVal1, N);
   statcoll_Init (res->pVal1, N);
   gofw_InitTestArray (res->sVal2, -1.0);
   gofw_InitTestArray (res->pVal2, -1.0);
   res->name = (char*) util_Realloc (res->name, 1 + strlen (nam) * sizeof (char));
   strcpy (res->name, nam);
}
Exemplo n.º 2
0
void sres_InitDisc (sres_Disc *res, long N, char *nam)
{
   statcoll_Init (res->sVal1, N);
   res->sVal2 = -1.0;
   res->pLeft = -1.0;
   res->pRight = -1.0;
   res->pVal2 = -1.0;
   res->name = (char*)util_Realloc (res->name, 1 + strlen (nam) * sizeof (char));
   strcpy (res->name, nam);
   
}
Exemplo n.º 3
0
void sres_InitPoisson (sres_Poisson *res, long N, double Lambda, char *nam)
{
   statcoll_Init (res->sVal1, N);
   res->Lambda = Lambda;
   res->Mu = N * Lambda;
   res->sVal2 = -1.0;
   res->pLeft = -1.0;
   res->pRight = -1.0;
   res->pVal2 = -1.0;
   res->name = (char*)util_Realloc (res->name, 1 + strlen (nam) * sizeof (char));
   strcpy (res->name, nam);
   
}
Exemplo n.º 4
0
void sres_InitChi2 (sres_Chi2 *res, long N, long jmax, char *nam)
{
    statcoll_Init (res->sVal1, N);
    statcoll_Init (res->pVal1, N);

    if (jmax < 0) {
        if (res->jmax > 0) {
            res->NbExp = util_Free (res->NbExp);
            res->Count = util_Free (res->Count);
            res->Loc = util_Free (res->Loc);
        }
    } else {
        if (res->jmax < 0) {
            res->NbExp = util_Calloc ((size_t) (jmax + 1), sizeof (double));
            res->Count = util_Calloc ((size_t) (jmax + 1), sizeof (long));
            res->Loc = util_Calloc ((size_t) (jmax + 1), sizeof (long));
        } else {
            int j;
            res->NbExp =
                util_Realloc (res->NbExp, (jmax + 1) * sizeof (double));
            res->Count = util_Realloc (res->Count, (jmax + 1) * sizeof (long));
            res->Loc = util_Realloc (res->Loc, (jmax + 1) * sizeof (long));
            for (j = 0; j <= jmax; j++) {
                res->NbExp[j] = 0.0;
                res->Count[j] = 0;
                res->Loc[j] = 0;
            }
        }
    }
    res->degFree = 0;
    res->jmin = 0;
    res->jmax = jmax;
    gofw_InitTestArray (res->sVal2, -1.0);
    gofw_InitTestArray (res->pVal2, -1.0);
    res->name = util_Realloc (res->name, 1 + strlen (nam) * sizeof (char));
    strcpy (res->name, nam);
}