File: local.h

package info (click to toggle)
cufflinks 1.3.0-2
  • links: PTS, VCS
  • area: non-free
  • in suites: wheezy
  • size: 3,864 kB
  • sloc: cpp: 48,999; ansic: 12,297; sh: 3,381; python: 432; makefile: 209
file content (148 lines) | stat: -rw-r--r-- 2,955 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
/*
 *   Copyright (c) 1996-2000 Lucent Technologies.
 *   See README file for details.
 * 
 *
 *  Most of the changes formerly needed here are handled through
 *  the Makefiles and #ifdef's.
 *
 *
 */

#define CVERSION 1

#ifndef I_LF_H
#define I_LF_H

/*RVERSION*/

/*
 *   DIRSEP: '/' for unix; '\\' for DOS
 */
#ifdef DOS
#define DIRSEP '\\'
#else
#define DIRSEP '/'
#endif


/*
   Some older math libraries have no lgamma() function, and gamma(arg)
   actually returns log(gamma(arg)). If so, you need to change
   LGAMMA macro below.

   If all else fails, you can also use lflgamma().

   Use the definitions for erf, erfc and daws only if your
   math libraries don't include these functions.
 */
#ifdef DOS
#define LGAMMA(arg) lflgamma(arg)
#define erf(x) lferf(x)
#define erfc(x) lferfc(x)
#else
#define LGAMMA(arg) lgamma(arg)
#endif
#define daws(x) lfdaws(x)


/*
   Does your system support popen() and pclose()
   for pipes? For most flavours of unix, yes.
   For other OS's, usually not, and you'll need to
   uncomment the following line.

   (This is only relevant if making the C version).
*/
/* #define NOPIPES */


/*
   (the #ifdef's below should now take care of this).
   the INT type is used for all integers provided in .C() calls from S.
   For the S version, this should be long int.
   For the R version, should be int.
   For the C version, either is adequate.
   Usually this only makes a difference on 64 bit systems.
*/

//#ifndef SWINVERSION

//#ifdef RVERSION
//typedef int INT;
//#else
//#ifdef SVERSION
//typedef long int INT;
//#else
typedef int INT;
//#endif /* SVERSION */
//#endif /* RVERSION */

//#endif /* SWINVERSION */

/******** NOTHING BELOW HERE NEEDS CHANGING **********/

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>

#ifdef RVERSION
#undef LGAMMA
#define LGAMMA(arg) Rf_lgammafn(arg)
extern double Rf_lgammafn();
#define SVERSION
#endif

#ifdef SWINVERSION
#define SVERSION
#include "newredef.h"
#endif

#include "mutil.h"
#include "lfcons.h"
#include "lfstruc.h"
#include "design.h"
#include "lffuns.h"

#ifdef CVERSION
//#undef printf
//#define printf lfprintf
//extern int lfprintf(const char *format, ...);
//extern int printf(const char *format, ...);
#endif

#ifdef SVERSION
#define printf printf
#endif

#ifdef INTERFACE
#define printf printf
#endif

#define ERROR(args) printf("Error: "), printf args , printf("\n"), lf_error=1
#define WARN(args)  printf("Warning: "),printf args, printf("\n")

#define MAX(a,b) (((a)>(b)) ? (a) : (b))
#define MIN(a,b) (((a)<(b)) ? (a) : (b))
#define SGN(x) (((x)>0) ? 1 : -1)
#define SQR(x) ((x)*(x))
#define NOSLN 0.1278433
#define GFACT 2.5
#define EFACT 3.0

#define MAXCOLOR 20
#define MAXWIN 5

#ifdef SWINVERSION
#define ISWAP(a,b) { int zz; zz = a; a = b; b = zz; }
#else
#define ISWAP(a,b) { INT zz; zz = a; a = b; b = zz; }
extern INT lf_error;
#endif

extern INT lf_error;

double lf_exp(double x);

#endif /* I_LF_H */