https://github.com/cran/aster
Raw File
Tip revision: 8d6f670524c60fd83d641eebedcc64e4ec53ae23 authored by ORPHANED on 15 February 2018, 07:02:03 UTC
version 0.9.1.1
Tip revision: 8d6f670
asttrans5.c

#include "aster.h"

void aster_theta2ctau(int *nindin, int *nnodein, int *pred, int *fam,
    double *theta, double *ctau)
{
    int nind = nindin[0];
    int nnode = nnodein[0];

    int i, j, jfam, jbase;

    aster_check_model(nindin, nnodein, pred, fam);

    /* j is 1-origin indexing */
    for (j = nnode; j > 0; --j) {
        jfam = fam[j - 1];
        jbase = nind * (j - 1);
        for (i = 0; i < nind; ++i) {
            int one = 1;
            double foo;
            aster_family(&jfam, &one, &theta[jbase + i], &foo);
            ctau[jbase + i] = foo;
        }
    }
}

back to top