https://github.com/cran/aster
Raw File
Tip revision: c45193827d47cd090900035e43f3188cd3fbc795 authored by Charles J. Geyer on 05 May 2013, 00:00:00 UTC
version 0.8-23
Tip revision: c451938
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