Browse code

standardize all exported C level functionality

git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/preprocessCore@27386 bc3139a8-67e5-0310-9ffc-ced21a209358

Ben Bolstad authored on 21/09/2007 02:12:55
Showing8 changed files

... ...
@@ -1,5 +1,5 @@
1 1
 Package: preprocessCore
2
-Version: 0.99.20
2
+Version: 0.99.21
3 3
 Title: A collection of pre-processing functions
4 4
 Author: Benjamin Milo Bolstad <bmb@bmbolstad.com>
5 5
 Maintainer: Benjamin Milo Bolstad <bmb@bmbolstad.com>
6 6
new file mode 100644
... ...
@@ -0,0 +1,10 @@
1
+#ifndef AVG_H
2
+#define AVG_H
3
+
4
+void ColAverage(double *data, int rows, int cols, int *cur_rows, double *results, int nprobes, double *resultsSE);
5
+void ColAverage_noSE(double *data, int rows, int cols, int *cur_rows, double *results, int nprobes);
6
+
7
+void colaverage_no_copy(double *data, int rows, int cols, double *results, double *resultsSE);
8
+void colaverage(double *data, int rows, int cols, double *results, double *resultsSE);
9
+
10
+#endif
... ...
@@ -2,7 +2,11 @@
2 2
 #define BIWEIGHT_H 1
3 3
 
4 4
 void tukeybiweight(double *data, int rows, int cols, double *results, double *resultsSE);
5
+void tukeybiweight_no_log(double *data, int rows, int cols, double *results, double *resultsSE);
5 6
 void TukeyBiweight(double *data, int rows, int cols, int *cur_rows, double *results, int nprobes, double *resultsSE);
7
+void TukeyBiweight_noSE(double *data, int rows, int cols, int *cur_rows, double *results, int nprobes);
8
+void TukeyBiweight_no_log_noSE(double *data, int rows, int cols, int *cur_rows, double *results, int nprobes);
9
+
6 10
 double Tukey_Biweight(double *x, int length);
7 11
 
8 12
 #endif
... ...
@@ -4,6 +4,7 @@
4 4
 
5 5
 
6 6
 void LogMedian(double *data, int rows, int cols, int *cur_rows, double *results, int nprobes, double *resultsSE);
7
+void LogMedian_noSE(double *data, int rows, int cols, int *cur_rows, double *results, int nprobes);
7 8
 
8 9
 void logmedian(double *data, int rows, int cols, double *results, double *resultsSE);
9 10
 void logmedian_no_copy(double *data, int rows, int cols, double *results, double *resultsSE);
10 11
new file mode 100644
... ...
@@ -0,0 +1,15 @@
1
+#ifndef MEDIAN_H
2
+#define MEDIAN_H 1
3
+
4
+
5
+
6
+void ColMedian(double *data, int rows, int cols, int *cur_rows, double *results, int nprobes, double *resultsSE);
7
+void ColMedian_noSE(double *data, int rows, int cols, int *cur_rows, double *results, int nprobes);
8
+
9
+void colmedian(double *data, int rows, int cols, double *results, double *resultsSE);
10
+void colmedian_no_copy(double *data, int rows, int cols, double *results, double *resultsSE);
11
+
12
+
13
+
14
+
15
+#endif
... ...
@@ -7,5 +7,7 @@ void median_polish_log2_no_copy(double *data, int rows, int cols, double *result
7 7
 void median_polish_log2(double *data, int rows, int cols, double *results, double *resultsSE, double *residuals);
8 8
 void median_polish(double *data, int rows, int cols, double *results, double *resultsSE, double *residuals);
9 9
 void MedianPolish(double *data, int rows, int cols, int *cur_rows, double *results, int nprobes, double *resultsSE);
10
+void MedianPolish_no_log(double *data, int rows, int cols, int *cur_rows, double *results, int nprobes, double *resultsSE);
11
+
10 12
 
11 13
 #endif
... ...
@@ -155,7 +155,20 @@ void LogAverage(double *data, int rows, int cols, int *cur_rows, double *results
155 155
   
156 156
   if (fun == NULL)
157 157
     fun =  (void(*)(double*, int, int, int*, double *, int, double *))R_GetCCallable("preprocessCore","LogAverage");
158
-  fun(data,rows,cols,cur_rows,results,nprobes,resultsSE);
158
+  fun(data, rows, cols, cur_rows, results, nprobes, resultsSE);
159
+  return;
160
+}
161
+
162
+
163
+
164
+void LogAverage_noSE(double *data, int rows, int cols, int *cur_rows, double *results, int nprobes){
165
+
166
+
167
+  static void(*fun)(double*, int, int, int*, double *, int) = NULL;
168
+  
169
+  if (fun == NULL)
170
+    fun =  (void(*)(double*, int, int, int*, double *, int))R_GetCCallable("preprocessCore","LogAverage_noSE");
171
+  fun(data, rows, cols, cur_rows, results, nprobes);
159 172
   return;
160 173
 }
161 174
 
... ...
@@ -169,12 +182,23 @@ void tukeybiweight(double *data, int rows, int cols, double *results, double *re
169 182
     fun = (void(*)(double *, int, int, double *, double *))R_GetCCallable("preprocessCore","tukeybiweight");
170 183
   fun(data, rows, cols, results, resultsSE);
171 184
   return;
185
+}
172 186
 
187
+void tukeybiweight_no_log(double *data, int rows, int cols, double *results, double *resultsSE){
173 188
 
189
+  static void(*fun)(double *, int, int, double *, double *) = NULL;
174 190
 
191
+  if (fun == NULL)
192
+    fun = (void(*)(double *, int, int, double *, double *))R_GetCCallable("preprocessCore","tukeybiweight_no_log");
193
+  fun(data, rows, cols, results, resultsSE);
194
+  return;
175 195
 }
176 196
 
177 197
 
198
+
199
+
200
+
201
+
178 202
 void TukeyBiweight(double *data, int rows, int cols, int *cur_rows, double *results, int nprobes, double *resultsSE){
179 203
 
180 204
 
... ...
@@ -184,12 +208,35 @@ void TukeyBiweight(double *data, int rows, int cols, int *cur_rows, double *resu
184 208
     fun = (void(*)(double *, int, int, int *, double *, int, double *))R_GetCCallable("preprocessCore","TukeyBiweight");
185 209
   fun(data, rows, cols, cur_rows,results, nprobes, resultsSE);
186 210
   return;
211
+}
212
+
213
+void TukeyBiweight_noSE(double *data, int rows, int cols, int *cur_rows, double *results, int nprobes){
214
+
215
+
216
+  static void(*fun)(double *, int, int, int *, double *, int) = NULL;
217
+
218
+  if (fun == NULL)
219
+    fun = (void(*)(double *, int, int, int *, double *, int))R_GetCCallable("preprocessCore","TukeyBiweight_noSE");
220
+  fun(data, rows, cols, cur_rows,results, nprobes);
221
+  return;
222
+}
223
+
224
+
225
+void TukeyBiweight_no_log_noSE(double *data, int rows, int cols, int *cur_rows, double *results, int nprobes){
187 226
 
188 227
 
228
+  static void(*fun)(double *, int, int, int *, double *, int) = NULL;
229
+
230
+  if (fun == NULL)
231
+    fun = (void(*)(double *, int, int, int *, double *, int))R_GetCCallable("preprocessCore","TukeyBiweight_no_log_noSE");
232
+  fun(data, rows, cols, cur_rows,results, nprobes);
233
+  return;
189 234
 }
190 235
 
191 236
 
192 237
 
238
+
239
+
193 240
 double Tukey_Biweight(double *x, int length){
194 241
 
195 242
   static double(*fun)(double *, int) = NULL;
... ...
@@ -310,6 +357,19 @@ void MedianPolish(double *data, int rows, int cols, int *cur_rows, double *resul
310 357
 }
311 358
 
312 359
 
360
+void MedianPolish_no_log(double *data, int rows, int cols, int *cur_rows, double *results, int nprobes, double *resultsSE){
361
+
362
+
363
+  static void(*fun)(double *, int, int, int *, double *, int, double *) = NULL;
364
+
365
+  if (fun == NULL)
366
+    fun = (void(*)(double *, int, int, int *, double *, int, double *))R_GetCCallable("preprocessCore","MedianPolish_no_log");
367
+
368
+  fun(data,rows,cols,cur_rows,results,nprobes,resultsSE);
369
+  return;
370
+
371
+}
372
+
313 373
 
314 374
 
315 375
 
... ...
@@ -482,6 +542,17 @@ void LogMedian(double *data, int rows, int cols, int *cur_rows, double *results,
482 542
 
483 543
 }
484 544
 
545
+void LogMedian_noSE(double *data, int rows, int cols, int *cur_rows, double *results, int nprobes, double *resultsSE){
546
+
547
+  static void(*fun)(double *, int, int, int *, double *, int, double *) = NULL;
548
+
549
+  if (fun == NULL)
550
+    fun = (void(*)(double *, int, int, int *, double *, int, double *))R_GetCCallable("preprocessCore","LogMedian_noSE");
551
+  fun(data, rows, cols, cur_rows, results, nprobes, resultsSE);
552
+  return;
553
+
554
+}
555
+
485 556
 
486 557
 void logmedian(double *data, int rows, int cols, double *results, double *resultsSE){
487 558
 
... ...
@@ -505,3 +576,105 @@ void logmedian_no_copy(double *data, int rows, int cols, double *results, double
505 576
   return;
506 577
 
507 578
 }
579
+
580
+
581
+
582
+
583
+
584
+
585
+
586
+void colaverage_no_copy(double *data, int rows, int cols, double *results, double *resultsSE){
587
+
588
+  static void(*fun)(double*, int, int, double *, double *) = NULL;
589
+  
590
+  if (fun == NULL)
591
+    fun =  (void(*)(double*, int, int, double *, double *))R_GetCCallable("preprocessCore","colaverage_no_copy");
592
+  
593
+  fun(data,rows,cols,results,resultsSE);
594
+  return;
595
+}
596
+
597
+void colaverage(double *data, int rows, int cols, double *results, double *resultsSE){
598
+
599
+  static void(*fun)(double*, int, int, double *, double *) = NULL;
600
+  
601
+  if (fun == NULL)
602
+    fun =  (void(*)(double*, int, int, double *, double *))R_GetCCallable("preprocessCore","colaverage");
603
+  
604
+  fun(data,rows,cols,results,resultsSE);
605
+  return;
606
+}
607
+
608
+
609
+
610
+void ColAverage(double *data, int rows, int cols, int *cur_rows, double *results, int nprobes, double *resultsSE){
611
+
612
+  static void(*fun)(double*, int, int, int*, double *, int, double *) = NULL;
613
+  
614
+  if (fun == NULL)
615
+    fun =  (void(*)(double*, int, int, int*, double *, int, double *))R_GetCCallable("preprocessCore","ColAverage");
616
+  
617
+  fun(data, rows, cols, cur_rows, results, nprobes, resultsSE);
618
+  return;
619
+}
620
+
621
+void ColAverage_noSE(double *data, int rows, int cols, int *cur_rows, double *results, int nprobes){
622
+
623
+  static void(*fun)(double*, int, int, int*, double *, int) = NULL;
624
+  
625
+  if (fun == NULL)
626
+    fun =  (void(*)(double*, int, int, int*, double *, int))R_GetCCallable("preprocessCore","ColAverage_noSE");
627
+  
628
+  fun(data, rows, cols, cur_rows, results, nprobes);
629
+  return;
630
+}
631
+
632
+
633
+
634
+
635
+void colmedian_no_copy(double *data, int rows, int cols, double *results, double *resultsSE){
636
+
637
+  static void(*fun)(double*, int, int, double *, double *) = NULL;
638
+  
639
+  if (fun == NULL)
640
+    fun =  (void(*)(double*, int, int, double *, double *))R_GetCCallable("preprocessCore","colmedian_no_copy");
641
+  
642
+  fun(data,rows,cols,results,resultsSE);
643
+  return;
644
+}
645
+
646
+void colmedian(double *data, int rows, int cols, double *results, double *resultsSE){
647
+
648
+  static void(*fun)(double*, int, int, double *, double *) = NULL;
649
+  
650
+  if (fun == NULL)
651
+    fun =  (void(*)(double*, int, int, double *, double *))R_GetCCallable("preprocessCore","colmedian");
652
+  
653
+  fun(data,rows,cols,results,resultsSE);
654
+  return;
655
+}
656
+
657
+
658
+
659
+void ColMedian(double *data, int rows, int cols, int *cur_rows, double *results, int nprobes, double *resultsSE){
660
+
661
+  static void(*fun)(double*, int, int, int*, double *, int, double *) = NULL;
662
+  
663
+  if (fun == NULL)
664
+    fun =  (void(*)(double*, int, int, int*, double *, int, double *))R_GetCCallable("preprocessCore","ColMedian");
665
+  
666
+  fun(data, rows, cols, cur_rows, results, nprobes, resultsSE);
667
+  return;
668
+}
669
+
670
+void ColMedian_noSE(double *data, int rows, int cols, int *cur_rows, double *results, int nprobes){
671
+
672
+  static void(*fun)(double*, int, int, int*, double *, int) = NULL;
673
+  
674
+  if (fun == NULL)
675
+    fun =  (void(*)(double*, int, int, int*, double *, int))R_GetCCallable("preprocessCore","ColMedian_noSE");
676
+  
677
+  fun(data, rows, cols, cur_rows, results, nprobes);
678
+  return;
679
+}
680
+
... ...
@@ -99,7 +99,8 @@ void R_init_preprocessCore(DllInfo *info){
99 99
   R_RegisterCCallable("preprocessCore", "median_polish_log2", (DL_FUNC)&median_polish_log2);
100 100
   R_RegisterCCallable("preprocessCore", "median_polish", (DL_FUNC)&median_polish);
101 101
   R_RegisterCCallable("preprocessCore", "MedianPolish", (DL_FUNC)&MedianPolish);
102
-  
102
+  R_RegisterCCallable("preprocessCore", "MedianPolish_no_log", (DL_FUNC)&MedianPolish_no_log);
103
+
103 104
 
104 105
   R_RegisterCCallable("preprocessCore","AverageLog", (DL_FUNC)&AverageLog);
105 106
   R_RegisterCCallable("preprocessCore","averagelog_no_copy", (DL_FUNC)&averagelog_no_copy);
... ...
@@ -119,6 +120,7 @@ void R_init_preprocessCore(DllInfo *info){
119 120
   R_RegisterCCallable("preprocessCore","LogMedian", (DL_FUNC)&LogMedian);
120 121
   R_RegisterCCallable("preprocessCore","logmedian_no_copy", (DL_FUNC)&logmedian_no_copy);
121 122
   R_RegisterCCallable("preprocessCore","logmedian", (DL_FUNC)&logmedian);
123
+  R_RegisterCCallable("preprocessCore","LogMedian_noSE", (DL_FUNC)&LogMedian_noSE);
122 124
  
123 125
   R_RegisterCCallable("preprocessCore","ColMedian", (DL_FUNC)&ColMedian);
124 126
   R_RegisterCCallable("preprocessCore","colmedian_no_copy", (DL_FUNC)&colmedian_no_copy);
... ...
@@ -130,9 +132,12 @@ void R_init_preprocessCore(DllInfo *info){
130 132
   R_RegisterCCallable("preprocessCore","LogAverage_noSE", (DL_FUNC)&LogAverage_noSE);
131 133
 
132 134
   R_RegisterCCallable("preprocessCore","tukeybiweight", (DL_FUNC)&tukeybiweight);
135
+  R_RegisterCCallable("preprocessCore","tukeybiweight_no_log", (DL_FUNC)&tukeybiweight_no_log);
133 136
   R_RegisterCCallable("preprocessCore","TukeyBiweight", (DL_FUNC)&TukeyBiweight);
137
+  R_RegisterCCallable("preprocessCore","TukeyBiweight_noSE", (DL_FUNC)&TukeyBiweight_noSE);
138
+  R_RegisterCCallable("preprocessCore","TukeyBiweight_no_log_noSE", (DL_FUNC)&TukeyBiweight_no_log_noSE);
134 139
   R_RegisterCCallable("preprocessCore","Tukey_Biweight", (DL_FUNC)&Tukey_Biweight);
135
-
140
+  
136 141
 
137 142
   R_RegisterCCallable("preprocessCore","lm_wfit", (DL_FUNC)&lm_wfit);
138 143