File: isAllFinite.c

package info (click to toggle)
r-cran-mcmc 0.9-7-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 2,352 kB
  • sloc: ansic: 1,298; makefile: 14; sh: 8
file content (20 lines) | stat: -rw-r--r-- 304 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

#include <R.h>
#include <Rinternals.h>
#include "myutil.h"

int
isAllFinite(SEXP foo)
{
    int d, i;
    int result = TRUE;

    if (! isReal(foo))
        error("argument must be real");

    d = LENGTH(foo);
    for (i = 0; i < d; i++)
        result &= R_finite(REAL(foo)[i]);
    return result;
}