https://github.com/cran/aster
Raw File
Tip revision: fa7795259e71bf245e06b2cf7c012e2f3322cd2f authored by Charles J. Geyer on 14 March 2008, 00:00:00 UTC
version 0.7-4
Tip revision: fa77952
astorig.c

#include "aster.h"
#include "raster.h"

void aster_default_origin(int *nindin, int *nnodein, int *fam, double *result)
{
    int nind = nindin[0];
    int nnode = nnodein[0];

    int i, j, k;

    if (nind <= 0)
        die("'nind' must be positive integer\n");
    if (nnode <= 0)
        die("'nnode' must be positive integer\n");

    /* fam values are 1-origin indexing */
    for (j = 0, k = 0; j < nnode; ++j) {
        double foo = aster_family_origin(fam[j]);
        for (i = 0; i < nind; ++i, ++k)
            result[k] = foo;
    }
}

back to top