TPCCLIB
Loading...
Searching...
No Matches
mrl.c
Go to the documentation of this file.
1
5/*****************************************************************************/
6
7/*****************************************************************************/
8#include "libtpcmodext.h"
9/*****************************************************************************/
10
11/*****************************************************************************/
15 double *y1,
17 double *y2,
19 int n
20) {
21 int i, mrl=0, rl=0;
22 char last_sign=0, sign;
23
24 if(n<1 || y1==NULL || y2==NULL) return(0);
25 for(i=0; i<n; i++) {
26 if(isnan(y1[i]) || isnan(y2[i])) continue;
27 if(y1[i]>y2[i]) sign=1; else if(y1[i]<y2[i]) sign=-1; else sign=0;
28 if(sign!=last_sign) {
29 rl=0; last_sign=sign;
30 } else {
31 if(sign!=0) {rl++; if(rl>mrl) mrl=rl;}
32 }
33 }
34 return(mrl);
35}
36/*****************************************************************************/
37
38/*****************************************************************************/
Header file for libtpcmodext.
int mrl_between_tacs(double *y1, double *y2, int n)
Definition mrl.c:13